diff --git a/Makefile b/Makefile index ec43462bc..d122c6d23 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ TALOSCTL_DEFAULT_TARGET := talosctl-$(OPERATING_SYSTEM) INTEGRATION_TEST_DEFAULT_TARGET := integration-test-$(OPERATING_SYSTEM) INTEGRATION_TEST_PROVISION_DEFAULT_TARGET := integration-test-provision-$(OPERATING_SYSTEM) KUBECTL_URL ?= https://storage.googleapis.com/kubernetes-release/release/v1.21.0-rc.0/bin/$(OPERATING_SYSTEM)/amd64/kubectl -CLUSTERCTL_VERSION ?= 0.3.14 +CLUSTERCTL_VERSION ?= 0.3.15 CLUSTERCTL_URL ?= https://github.com/kubernetes-sigs/cluster-api/releases/download/v$(CLUSTERCTL_VERSION)/clusterctl-$(OPERATING_SYSTEM)-amd64 SONOBUOY_VERSION ?= 0.50.0 SONOBUOY_URL ?= https://github.com/vmware-tanzu/sonobuoy/releases/download/v$(SONOBUOY_VERSION)/sonobuoy_$(SONOBUOY_VERSION)_$(OPERATING_SYSTEM)_amd64.tar.gz diff --git a/internal/integration/api/apply-config.go b/internal/integration/api/apply-config.go index 7a7ab649f..973d37ea6 100644 --- a/internal/integration/api/apply-config.go +++ b/internal/integration/api/apply-config.go @@ -97,9 +97,16 @@ func (suite *ApplyConfigSuite) TestApply() { provider, err := suite.readConfigFromNode(nodeCtx) suite.Assert().Nilf(err, "failed to read existing config from node %q: %w", node, err) - provider.Machine().Sysctls()[applyConfigTestSysctl] = applyConfigTestSysctlVal + cfg, ok := provider.(*v1alpha1.Config) + suite.Require().True(ok) - cfgDataOut, err := provider.Bytes() + if cfg.MachineConfig.MachineSysctls == nil { + cfg.MachineConfig.MachineSysctls = make(map[string]string) + } + + cfg.MachineConfig.MachineSysctls[applyConfigTestSysctl] = applyConfigTestSysctlVal + + cfgDataOut, err := cfg.Bytes() suite.Assert().Nilf(err, "failed to marshal updated machine config data (node %q): %w", node, err) suite.AssertRebooted(suite.ctx, node, func(nodeCtx context.Context) error { @@ -144,9 +151,16 @@ func (suite *ApplyConfigSuite) TestApplyOnReboot() { provider, err := suite.readConfigFromNode(nodeCtx) suite.Require().NoError(err, "failed to read existing config from node %q", node) - provider.Machine().Sysctls()[applyConfigNoRebootTestSysctl] = applyConfigNoRebootTestSysctlVal + cfg, ok := provider.(*v1alpha1.Config) + suite.Require().True(ok) - cfgDataOut, err := provider.Bytes() + if cfg.MachineConfig.MachineSysctls == nil { + cfg.MachineConfig.MachineSysctls = make(map[string]string) + } + + cfg.MachineConfig.MachineSysctls[applyConfigNoRebootTestSysctl] = applyConfigNoRebootTestSysctlVal + + cfgDataOut, err := cfg.Bytes() suite.Require().NoError(err, "failed to marshal updated machine config data (node %q)", node) _, err = suite.Client.ApplyConfiguration(nodeCtx, &machineapi.ApplyConfigurationRequest{ @@ -167,10 +181,13 @@ func (suite *ApplyConfigSuite) TestApplyOnReboot() { applyConfigNoRebootTestSysctlVal, ) - // revert back - delete(provider.Machine().Sysctls(), applyConfigNoRebootTestSysctl) + cfg, ok = newProvider.(*v1alpha1.Config) + suite.Require().True(ok) - cfgDataOut, err = provider.Bytes() + // revert back + delete(cfg.MachineConfig.MachineSysctls, applyConfigNoRebootTestSysctl) + + cfgDataOut, err = cfg.Bytes() suite.Require().NoError(err, "failed to marshal updated machine config data (node %q)", node) _, err = suite.Client.ApplyConfiguration(nodeCtx, &machineapi.ApplyConfigurationRequest{