From b35ad755fcd3599154e2c821107b5693103d486d Mon Sep 17 00:00:00 2001 From: Rahul Ganesh <31204974+rahulbabu95@users.noreply.github.com> Date: Fri, 20 Dec 2024 12:17:02 -0800 Subject: [PATCH] Add bootOptions to cp/md tinkerbellmachine template, fix unit-tests (#9094) Signed-off-by: Rahul Ganesh Co-authored-by: EKS Distro PR Bot --- pkg/providers/tinkerbell/config/template-cp.yaml | 2 ++ pkg/providers/tinkerbell/config/template-md.yaml | 2 ++ pkg/providers/tinkerbell/stack/stack.go | 3 +-- pkg/providers/tinkerbell/stack/stack_test.go | 1 - pkg/providers/tinkerbell/testdata/expected_kct.yaml | 2 ++ .../expected_results_bottlerocket_cert_bundles_config_md.yaml | 2 ++ .../expected_results_bottlerocket_kernel_config_md.yaml | 2 ++ .../testdata/expected_results_bottlerocket_ntp_config_md.yaml | 2 ++ .../expected_results_bottlerocket_settings_config_md.yaml | 2 ++ .../expected_results_cluster_tinkerbell_autoscaler_md.yaml | 2 ++ ...er_tinkerbell_bottlerocket_md_minimal_registry_mirror.yaml | 2 ++ ..._tinkerbell_bottlerocket_md_registry_mirror_with_auth.yaml | 2 ++ ..._tinkerbell_bottlerocket_md_registry_mirror_with_cert.yaml | 2 ++ .../testdata/expected_results_cluster_tinkerbell_md.yaml | 2 ++ ...results_cluster_tinkerbell_md_minimal_registry_mirror.yaml | 2 ++ .../expected_results_cluster_tinkerbell_md_node_labels.yaml | 2 ++ .../expected_results_cluster_tinkerbell_md_node_taints.yaml | 2 ++ ...ted_results_cluster_tinkerbell_md_node_worker_version.yaml | 4 ++++ .../expected_results_cluster_tinkerbell_md_proxy.yaml | 2 ++ ...sults_cluster_tinkerbell_md_registry_mirror_with_auth.yaml | 2 ++ ...sults_cluster_tinkerbell_md_registry_mirror_with_cert.yaml | 2 ++ .../tinkerbell/testdata/expected_results_md_template.yaml | 2 ++ .../expected_results_tinkerbell_md_multiple_node_groups.yaml | 4 ++++ .../testdata/expected_results_ubuntu_ntp_config_md.yaml | 2 ++ 24 files changed, 49 insertions(+), 3 deletions(-) diff --git a/pkg/providers/tinkerbell/config/template-cp.yaml b/pkg/providers/tinkerbell/config/template-cp.yaml index 5711bba483c4..a99bb6cfa047 100644 --- a/pkg/providers/tinkerbell/config/template-cp.yaml +++ b/pkg/providers/tinkerbell/config/template-cp.yaml @@ -535,6 +535,8 @@ spec: matchLabels: {{ range $key, $value := .etcdHardwareSelector}} {{ $key }}: {{ $value}} {{- end }} + bootOptions: + bootMode: netboot templateOverride: | {{.etcdTemplateOverride | indent 8}} {{- end }} diff --git a/pkg/providers/tinkerbell/config/template-md.yaml b/pkg/providers/tinkerbell/config/template-md.yaml index d451aa25ad6e..212fb37a7d6e 100644 --- a/pkg/providers/tinkerbell/config/template-md.yaml +++ b/pkg/providers/tinkerbell/config/template-md.yaml @@ -61,6 +61,8 @@ spec: matchLabels: {{ range $key, $value := .hardwareSelector}} {{ $key }}: {{ $value}} {{- end }} + bootOptions: + bootMode: netboot templateOverride: | {{.workertemplateOverride | indent 8}} {{- end}} diff --git a/pkg/providers/tinkerbell/stack/stack.go b/pkg/providers/tinkerbell/stack/stack.go index 27d2b02fe528..68fd52c98159 100644 --- a/pkg/providers/tinkerbell/stack/stack.go +++ b/pkg/providers/tinkerbell/stack/stack.go @@ -241,8 +241,7 @@ func (s *Installer) installBootsOnDocker(ctx context.Context, bundle releasev1al "-e", fmt.Sprintf("SMEE_DHCP_TFTP_IP=%s", tinkServerIP), "-e", fmt.Sprintf("SMEE_DHCP_HTTP_IPXE_BINARY_HOST=%s", tinkServerIP), "-e", fmt.Sprintf("SMEE_DHCP_HTTP_IPXE_SCRIPT_HOST=%s", tinkServerIP), - "-e", fmt.Sprintf("PUBLIC_SYSLOG_IP=%s", tinkServerIP), - "-e", fmt.Sprintf("BOOTS_KUBE_NAMESPACE=%v", s.namespace), + "-e", fmt.Sprintf("SMEE_BACKEND_KUBE_NAMESPACE=%v", s.namespace), } extraKernelArgList := s.getSmeeKernelArgs(bundle) diff --git a/pkg/providers/tinkerbell/stack/stack_test.go b/pkg/providers/tinkerbell/stack/stack_test.go index 1f71a1f08e29..d023b4622c5b 100644 --- a/pkg/providers/tinkerbell/stack/stack_test.go +++ b/pkg/providers/tinkerbell/stack/stack_test.go @@ -239,7 +239,6 @@ func TestTinkerbellStackInstallWithDifferentOptions(t *testing.T) { "-e", gomock.Any(), "-e", gomock.Any(), "-e", gomock.Any(), - "-e", gomock.Any(), ) } diff --git a/pkg/providers/tinkerbell/testdata/expected_kct.yaml b/pkg/providers/tinkerbell/testdata/expected_kct.yaml index efdf61bb8b60..35e311a0a2c2 100644 --- a/pkg/providers/tinkerbell/testdata/expected_kct.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_kct.yaml @@ -41,6 +41,8 @@ spec: required: - labelSelector: matchLabels: + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_cert_bundles_config_md.yaml b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_cert_bundles_config_md.yaml index 8d8c07749ab9..7428f9207a58 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_cert_bundles_config_md.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_cert_bundles_config_md.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_kernel_config_md.yaml b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_kernel_config_md.yaml index 1622d422b1b9..2daccdae083c 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_kernel_config_md.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_kernel_config_md.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_ntp_config_md.yaml b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_ntp_config_md.yaml index abfe950c55e6..d900402de5fd 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_ntp_config_md.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_ntp_config_md.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_settings_config_md.yaml b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_settings_config_md.yaml index 200d2721e81f..e54732d13ae7 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_settings_config_md.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_settings_config_md.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_autoscaler_md.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_autoscaler_md.yaml index eab49bb2312b..167c329a1513 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_autoscaler_md.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_autoscaler_md.yaml @@ -48,6 +48,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_minimal_registry_mirror.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_minimal_registry_mirror.yaml index d235f4ede0e3..f3790096fd5d 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_minimal_registry_mirror.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_minimal_registry_mirror.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_registry_mirror_with_auth.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_registry_mirror_with_auth.yaml index 8930768bf90e..3d3afb437411 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_registry_mirror_with_auth.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_registry_mirror_with_auth.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_registry_mirror_with_cert.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_registry_mirror_with_cert.yaml index 33dab1f0d92a..45a693a2301c 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_registry_mirror_with_cert.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_md_registry_mirror_with_cert.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md.yaml index 690ae342c914..68671b928fe2 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_minimal_registry_mirror.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_minimal_registry_mirror.yaml index 66bccfe7f346..a3967a96abcd 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_minimal_registry_mirror.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_minimal_registry_mirror.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_labels.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_labels.yaml index 60cc765b3e0c..e5969ac36671 100755 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_labels.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_labels.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_taints.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_taints.yaml index 420f92db251f..73252bf863ca 100755 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_taints.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_taints.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_worker_version.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_worker_version.yaml index 09cc688b8d8d..b8f636237d30 100755 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_worker_version.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_node_worker_version.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" @@ -217,6 +219,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_proxy.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_proxy.yaml index 37525dbe8e54..39746d2f2dcc 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_proxy.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_proxy.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_registry_mirror_with_auth.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_registry_mirror_with_auth.yaml index a11921cb6ede..10fe5278099d 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_registry_mirror_with_auth.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_registry_mirror_with_auth.yaml @@ -42,6 +42,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_registry_mirror_with_cert.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_registry_mirror_with_cert.yaml index 4910cb31e22c..c9159997bac1 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_registry_mirror_with_cert.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_md_registry_mirror_with_cert.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_md_template.yaml b/pkg/providers/tinkerbell/testdata/expected_results_md_template.yaml index 2ec4c95afe68..650955cbc0dc 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_md_template.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_md_template.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_tinkerbell_md_multiple_node_groups.yaml b/pkg/providers/tinkerbell/testdata/expected_results_tinkerbell_md_multiple_node_groups.yaml index 32b089d42544..9cd6d8bca786 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_tinkerbell_md_multiple_node_groups.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_tinkerbell_md_multiple_node_groups.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" @@ -216,6 +218,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: "" diff --git a/pkg/providers/tinkerbell/testdata/expected_results_ubuntu_ntp_config_md.yaml b/pkg/providers/tinkerbell/testdata/expected_results_ubuntu_ntp_config_md.yaml index 83264af71eca..cfba9d4ff805 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_ubuntu_ntp_config_md.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_ubuntu_ntp_config_md.yaml @@ -46,6 +46,8 @@ spec: - labelSelector: matchLabels: type: worker + bootOptions: + bootMode: netboot templateOverride: | global_timeout: 6000 id: ""