diff --git a/helm/drbd-adapter/templates/daemonset.yaml b/helm/drbd-adapter/templates/daemonset.yaml index 96cb2c5..c909146 100644 --- a/helm/drbd-adapter/templates/daemonset.yaml +++ b/helm/drbd-adapter/templates/daemonset.yaml @@ -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 }} diff --git a/helm/drbd-adapter/templates/job.yaml b/helm/drbd-adapter/templates/job.yaml index 07e580f..fcfb9cb 100644 --- a/helm/drbd-adapter/templates/job.yaml +++ b/helm/drbd-adapter/templates/job.yaml @@ -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"))}}