Skip to content

Commit

Permalink
[release/v1.2] Hotfix: cloud-init broken flags / bump version to 1.2.5 (
Browse files Browse the repository at this point in the history
#381) (#385)

* [release/v1.2] Hotfix: cloud-init broken flags (#381)

* bump version to 1.2.5

---------

Co-authored-by: Waleed Malik <[email protected]>
  • Loading branch information
xrstf and ahmedwaleedmalik authored Apr 30, 2024
1 parent c8b81ec commit a96954b
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 25 deletions.
12 changes: 10 additions & 2 deletions deploy/osps/default/osp-amzn2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
spec:
osName: "amzn2"
osVersion: "2.0"
version: "v1.2.4"
version: "v1.2.5"
supportedCloudProviders:
- name: "aws"

Expand Down Expand Up @@ -80,7 +80,15 @@ spec:
curl -s -k -v --header 'Authorization: Bearer {{ .Token }}' {{ .ServerURL }}/api/v1/namespaces/cloud-init-settings/secrets/{{ .SecretName }} | jq '.data["cloud-config"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
cloud-init clean
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
CLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')
# Compare the semver values of cloud-init versions to determine the correct command to run.
# This is required because the command line arguments for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.
if [[ $(echo -e "24.0.0\n$CLOUD_INIT_VERSION" | sort -V | head -n1) = "24.0.0" ]]; then
cloud-init init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
else
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
fi
systemctl daemon-reload
# cloud-init should only run on the first boot. From this point forward we don't need cloud-init anymore.
Expand Down
11 changes: 9 additions & 2 deletions deploy/osps/default/osp-centos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
spec:
osName: "centos"
osVersion: "7.7"
version: "v1.2.4"
version: "v1.2.5"
supportedCloudProviders:
- name: "alibaba"
- name: "aws"
Expand Down Expand Up @@ -95,7 +95,14 @@ spec:
curl -s -k -v --header 'Authorization: Bearer {{ .Token }}' {{ .ServerURL }}/api/v1/namespaces/cloud-init-settings/secrets/{{ .SecretName }} | jq '.data["cloud-config"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
cloud-init clean
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
CLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')
# Compare the semver values of cloud-init versions to determine the correct command to run.
# This is required because the command line arguments for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.
if [[ $(echo -e "24.0.0\n$CLOUD_INIT_VERSION" | sort -V | head -n1) = "24.0.0" ]]; then
cloud-init init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
else
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
fi
systemctl daemon-reload
Expand Down
2 changes: 1 addition & 1 deletion deploy/osps/default/osp-flatcar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
osName: flatcar
## Flatcar Stable (09/11/2021)
osVersion: "2983.2.0"
version: "v1.2.4"
version: "v1.2.5"
supportedCloudProviders:
- name: "aws"
- name: "azure"
Expand Down
11 changes: 9 additions & 2 deletions deploy/osps/default/osp-rhel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
spec:
osName: "rhel"
osVersion: "8.5"
version: "v1.2.4"
version: "v1.2.5"
supportedCloudProviders:
- name: "aws"
- name: "azure"
Expand Down Expand Up @@ -84,7 +84,14 @@ spec:
curl -s -k -v --header 'Authorization: Bearer {{ .Token }}' {{ .ServerURL }}/api/v1/namespaces/cloud-init-settings/secrets/{{ .SecretName }} | jq '.data["cloud-config"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
cloud-init clean
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
CLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')
# Compare the semver values of cloud-init versions to determine the correct command to run.
# This is required because the command line arguments for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.
if [[ $(echo -e "24.0.0\n$CLOUD_INIT_VERSION" | sort -V | head -n1) = "24.0.0" ]]; then
cloud-init init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
else
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
fi
systemctl daemon-reload
Expand Down
11 changes: 9 additions & 2 deletions deploy/osps/default/osp-rockylinux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
spec:
osName: "rockylinux"
osVersion: "8.6"
version: "v1.2.4"
version: "v1.2.5"
supportedCloudProviders:
- name: "aws"
- name: "azure"
Expand Down Expand Up @@ -87,7 +87,14 @@ spec:
curl -s -k -v --header 'Authorization: Bearer {{ .Token }}' {{ .ServerURL }}/api/v1/namespaces/cloud-init-settings/secrets/{{ .SecretName }} | jq '.data["cloud-config"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
cloud-init clean
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
CLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')
# Compare the semver values of cloud-init versions to determine the correct command to run.
# This is required because the command line arguments for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.
if [[ $(echo -e "24.0.0\n$CLOUD_INIT_VERSION" | sort -V | head -n1) = "24.0.0" ]]; then
cloud-init init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
else
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
fi
systemctl daemon-reload
Expand Down
12 changes: 10 additions & 2 deletions deploy/osps/default/osp-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
spec:
osName: "ubuntu"
osVersion: "20.04"
version: "v1.2.4"
version: "v1.2.5"
supportedCloudProviders:
- name: "alibaba"
- name: "aws"
Expand Down Expand Up @@ -106,7 +106,15 @@ spec:
echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/99-custom-networking.cfg
{{- end }}
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
CLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')
# Compare the semver values of cloud-init versions to determine the correct command to run.
# This is required because the command line arguments for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.
if [[ $(echo -e "24.0.0\n$CLOUD_INIT_VERSION" | sort -V | head -n1) = "24.0.0" ]]; then
cloud-init init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
else
cloud-init --file /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg init
fi
systemctl daemon-reload
{{- if eq .CloudProviderName "digitalocean" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ spec:
&& apt install -y curl jq\ncurl -s -k -v --header 'Authorization: Bearer
top-secret'\thttps://foo.bar:6443/api/v1/namespaces/cloud-init-settings/secrets/kubelet-configuration-kube-system-provisioning-config
| jq '.data[\"cloud-config\"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/kubelet-configuration-kube-system-provisioning-config.cfg\ncloud-init
clean\n\ncloud-init --file /etc/cloud/cloud.cfg.d/kubelet-configuration-kube-system-provisioning-config.cfg
init\nsystemctl daemon-reload\n\nsystemctl daemon-reload\n\n# cloud-init
clean\n\nCLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')\n#
Compare the semver values of cloud-init versions to determine the correct
command to run.\n# This is required because the command line arguments
for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.\nif
[[ $(echo -e \"24.0.0\\n$CLOUD_INIT_VERSION\" | sort -V | head -n1) =
\"24.0.0\" ]]; then\n cloud-init init --file /etc/cloud/cloud.cfg.d/kubelet-configuration-kube-system-provisioning-config.cfg\nelse\n
\ cloud-init --file /etc/cloud/cloud.cfg.d/kubelet-configuration-kube-system-provisioning-config.cfg
init\nfi\n\nsystemctl daemon-reload\n\nsystemctl daemon-reload\n\n# cloud-init
should only run on the first boot. From this point forward we don't need
cloud-init anymore.\nsystemctl disable cloud-init\ntouch /etc/cloud/cloud-init.disabled\n#
Bootstrap phase for the machine is complete.\ntouch /etc/bootstrap-complete\nsystemctl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ spec:
curl -s -k -v --header 'Authorization: Bearer top-secret' https://foo.bar:6443/api/v1/namespaces/cloud-init-settings/secrets/osp-rhel-azure-kube-system-provisioning-config | jq '.data["cloud-config"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/osp-rhel-azure-kube-system-provisioning-config.cfg
cloud-init clean
cloud-init --file /etc/cloud/cloud.cfg.d/osp-rhel-azure-kube-system-provisioning-config.cfg init
CLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')
# Compare the semver values of cloud-init versions to determine the correct command to run.
# This is required because the command line arguments for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.
if [[ $(echo -e "24.0.0\n$CLOUD_INIT_VERSION" | sort -V | head -n1) = "24.0.0" ]]; then
cloud-init init --file /etc/cloud/cloud.cfg.d/osp-rhel-azure-kube-system-provisioning-config.cfg
else
cloud-init --file /etc/cloud/cloud.cfg.d/osp-rhel-azure-kube-system-provisioning-config.cfg init
fi
systemctl daemon-reload
Expand Down
10 changes: 8 additions & 2 deletions pkg/controllers/osc/testdata/osc-ubuntu-aws-containerd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ spec:
&& apt install -y curl jq\ncurl -s -k -v --header 'Authorization: Bearer
top-secret'\thttps://foo.bar:6443/api/v1/namespaces/cloud-init-settings/secrets/ubuntu-aws-kube-system-provisioning-config
| jq '.data[\"cloud-config\"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg\ncloud-init
clean\n\ncloud-init --file /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg
init\nsystemctl daemon-reload\n\nsystemctl daemon-reload\n\n# cloud-init
clean\n\nCLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')\n#
Compare the semver values of cloud-init versions to determine the correct
command to run.\n# This is required because the command line arguments
for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.\nif
[[ $(echo -e \"24.0.0\\n$CLOUD_INIT_VERSION\" | sort -V | head -n1) =
\"24.0.0\" ]]; then\n cloud-init init --file /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg\nelse\n
\ cloud-init --file /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg
init\nfi\n\nsystemctl daemon-reload\n\nsystemctl daemon-reload\n\n# cloud-init
should only run on the first boot. From this point forward we don't need
cloud-init anymore.\nsystemctl disable cloud-init\ntouch /etc/cloud/cloud-init.disabled\n#
Bootstrap phase for the machine is complete.\ntouch /etc/bootstrap-complete\nsystemctl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ spec:
&& apt install -y curl jq\ncurl -s -k -v --header 'Authorization: Bearer
top-secret'\thttps://foo.bar:6443/api/v1/namespaces/cloud-init-settings/secrets/ubuntu-aws-kube-system-provisioning-config
| jq '.data[\"cloud-config\"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg\ncloud-init
clean\n\ncloud-init --file /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg
init\nsystemctl daemon-reload\n\nsystemctl daemon-reload\n\n# cloud-init
clean\n\nCLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')\n#
Compare the semver values of cloud-init versions to determine the correct
command to run.\n# This is required because the command line arguments
for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.\nif
[[ $(echo -e \"24.0.0\\n$CLOUD_INIT_VERSION\" | sort -V | head -n1) =
\"24.0.0\" ]]; then\n cloud-init init --file /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg\nelse\n
\ cloud-init --file /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg
init\nfi\n\nsystemctl daemon-reload\n\nsystemctl daemon-reload\n\n# cloud-init
should only run on the first boot. From this point forward we don't need
cloud-init anymore.\nsystemctl disable cloud-init\ntouch /etc/cloud/cloud-init.disabled\n#
Bootstrap phase for the machine is complete.\ntouch /etc/bootstrap-complete\nsystemctl
Expand Down
10 changes: 8 additions & 2 deletions pkg/controllers/osc/testdata/osc-ubuntu-aws-dualstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ spec:
&& apt install -y curl jq\ncurl -s -k -v --header 'Authorization: Bearer
top-secret'\thttps://foo.bar:6443/api/v1/namespaces/cloud-init-settings/secrets/ubuntu-aws-kube-system-provisioning-config
| jq '.data[\"cloud-config\"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg\ncloud-init
clean\n\ncloud-init --file /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg
init\nsystemctl daemon-reload\n\nsystemctl daemon-reload\n\n# cloud-init
clean\n\nCLOUD_INIT_VERSION=$(cloud-init --version | awk '{print $2}')\n#
Compare the semver values of cloud-init versions to determine the correct
command to run.\n# This is required because the command line arguments
for cloud-init changed in version 24.1, for details: https://github.com/canonical/cloud-init/releases/tag/24.1.\nif
[[ $(echo -e \"24.0.0\\n$CLOUD_INIT_VERSION\" | sort -V | head -n1) =
\"24.0.0\" ]]; then\n cloud-init init --file /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg\nelse\n
\ cloud-init --file /etc/cloud/cloud.cfg.d/ubuntu-aws-kube-system-provisioning-config.cfg
init\nfi\n\nsystemctl daemon-reload\n\nsystemctl daemon-reload\n\n# cloud-init
should only run on the first boot. From this point forward we don't need
cloud-init anymore.\nsystemctl disable cloud-init\ntouch /etc/cloud/cloud-init.disabled\n#
Bootstrap phase for the machine is complete.\ntouch /etc/bootstrap-complete\nsystemctl
Expand Down
Loading

0 comments on commit a96954b

Please sign in to comment.