Skip to content

Commit

Permalink
Merge pull request #88 from peng9808/main
Browse files Browse the repository at this point in the history
Modify regular expressions to correctly distinguish between large and…
  • Loading branch information
peng9808 authored Sep 19, 2024
2 parents c3c4409 + 7e24e1f commit f2d3748
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions helm/drbd-adapter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ spec:
{{- range $index, $node := (lookup "v1" "Node" "" "").items }}
{{- $osImage := lower $node.status.nodeInfo.osImage }}
{{- with . -}}
{{- if regexMatch "(red hat enterprise|centos) .*7" $osImage }}
{{- if regexMatch "(red hat enterprise|centos) .*7([\\s\\-\\.]|$)" $osImage }}
{{- $distros = append $distros "rhel7" }}
{{- else if regexMatch "(red hat enterprise|centos) .*8" $osImage }}
{{- else if regexMatch "(red hat enterprise|centos) .*8([\\s\\-\\.]|$)" $osImage }}
{{- $distros = append $distros "rhel8" }}
{{- else if regexMatch "ubuntu .*18" $osImage }}
{{- else if regexMatch "ubuntu .*18([\\s\\-\\.]|$)" $osImage }}
{{- $distros = append $distros "bionic" }}
{{- else if regexMatch "ubuntu .*20" $osImage }}
{{- else if regexMatch "ubuntu .*20([\\s\\-\\.]|$)" $osImage }}
{{- $distros = append $distros "focal" }}
{{- else if regexMatch "ubuntu .*22" $osImage }}
{{- else if regexMatch "ubuntu .*22([\\s\\-\\.]|$)" $osImage }}
{{- $distros = append $distros "jammy" }}
{{- end }}
{{- end }}
Expand Down
14 changes: 7 additions & 7 deletions helm/drbd-adapter/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
{{ $kernelVersion := lower $node.status.nodeInfo.kernelVersion }}
{{ $tag := $.Values.drbdVersion }}
{{ $distro := "unsupported" }}
{{ if regexMatch "(red hat enterprise|centos|almalinux|rocky linux) .*7" $osImage }}
{{ if regexMatch "(red hat enterprise|centos|almalinux|rocky linux) .*7([\\s\\-\\.]|$)" $osImage }}
{{ $distro = "rhel7" }}
{{ else if regexMatch "(red hat enterprise|centos|almalinux|rocky linux) .*8" $osImage }}
{{ else if regexMatch "(red hat enterprise|centos|almalinux|rocky linux) .*8([\\s\\-\\.]|$)" $osImage }}
{{ $distro = "rhel8" }}
{{ else if regexMatch "(red hat enterprise|centos|almalinux|rocky linux) .*9" $osImage }}
{{ else if regexMatch "(red hat enterprise|centos|almalinux|rocky linux) .*9([\\s\\-\\.]|$)" $osImage }}
{{ $distro = "rhel9" }}
{{ else if regexMatch "ubuntu .*18" $osImage }}
{{ else if regexMatch "ubuntu .*18([\\s\\-\\.]|$)" $osImage }}
{{ $distro = "bionic" }}
{{ else if regexMatch "ubuntu .*20" $osImage }}
{{ else if regexMatch "ubuntu .*20([\\s\\-\\.]|$)" $osImage }}
{{ $distro = "focal" }}
{{ else if regexMatch "ubuntu .*22" $osImage }}
{{ else if regexMatch "ubuntu .*22([\\s\\-\\.]|$)" $osImage }}
{{ $distro = "jammy" }}
{{ $tag = "v9.1.11" }}
{{ else if regexMatch "kylin .*v10" $osImage }}
{{ else if regexMatch "kylin .*v10([\\s\\-\\.]|$)" $osImage }}
{{ $distro = "kylin10" }}
{{ end }}
{{ if and (ne $.Values.deployOnMasters "yes") (or (hasKey $node.metadata.labels "node-role.kubernetes.io/master") (hasKey $node.metadata.labels "node-role.kubernetes.io/control-plane"))}}
Expand Down

0 comments on commit f2d3748

Please sign in to comment.