From d2e9b9011e513b7173e231fcb5cfd4232fd6345a Mon Sep 17 00:00:00 2001 From: Christoph Mewes Date: Mon, 18 Mar 2024 10:43:34 +0100 Subject: [PATCH] fix typos --- deploy/cloud-init-settings.yaml | 2 +- pkg/bootstrap/kubeconfig.go | 2 +- pkg/bootstrap/kubeconfig_test.go | 22 +++++++++---------- .../osc/resources/operating_system_config.go | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/deploy/cloud-init-settings.yaml b/deploy/cloud-init-settings.yaml index 9826c2c0..b2b59680 100644 --- a/deploy/cloud-init-settings.yaml +++ b/deploy/cloud-init-settings.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# cloud-init-settings is a dedicated namespace for storing provisioing configurations for machines. That are later consumed by machine-controller +# cloud-init-settings is a dedicated namespace for storing provisioning configurations for machines. That are later consumed by machine-controller # The dedicated and restricted service-account, cloud-init-getter is then used in order to reach, authenticate and be autorized by the API server to fetch those # provisioning configurations for the machines diff --git a/pkg/bootstrap/kubeconfig.go b/pkg/bootstrap/kubeconfig.go index bdb5276c..dbfbd97a 100644 --- a/pkg/bootstrap/kubeconfig.go +++ b/pkg/bootstrap/kubeconfig.go @@ -219,7 +219,7 @@ func (b *Bootstrap) createBootstrapToken(ctx context.Context, name string) (stri if existingSecret != nil { token, err := b.updateSecretExpirationAndGetToken(ctx, existingSecret) if err != nil { - return "", false, fmt.Errorf("failed to updte bootstrap token: %w", err) + return "", false, fmt.Errorf("failed to update bootstrap token: %w", err) } return token, true, nil diff --git a/pkg/bootstrap/kubeconfig_test.go b/pkg/bootstrap/kubeconfig_test.go index 0ce68f61..c35fcbc4 100644 --- a/pkg/bootstrap/kubeconfig_test.go +++ b/pkg/bootstrap/kubeconfig_test.go @@ -31,20 +31,20 @@ import ( func TestUpdateSecretExpirationAndGetToken(t *testing.T) { tests := []struct { - initialExperirationTime time.Time - shouldRenew bool + initialExpirationTime time.Time + shouldRenew bool }{ { - initialExperirationTime: time.Now().Add(1 * time.Hour), - shouldRenew: false, + initialExpirationTime: time.Now().Add(1 * time.Hour), + shouldRenew: false, }, { - initialExperirationTime: time.Now().Add(25 * time.Minute), - shouldRenew: true, + initialExpirationTime: time.Now().Add(25 * time.Minute), + shouldRenew: true, }, { - initialExperirationTime: time.Now().Add(-25 * time.Minute), - shouldRenew: true, + initialExpirationTime: time.Now().Add(-25 * time.Minute), + shouldRenew: true, }, } @@ -58,7 +58,7 @@ func TestUpdateSecretExpirationAndGetToken(t *testing.T) { data := map[string][]byte{} data[tokenSecretKey] = []byte("tokenSecret") data[tokenIDKey] = []byte("tokenID") - data[expirationKey] = []byte(testCase.initialExperirationTime.Format(time.RFC3339)) + data[expirationKey] = []byte(testCase.initialExpirationTime.Format(time.RFC3339)) secret.Data = data b.client = ctrlruntimefake. NewClientBuilder(). @@ -79,12 +79,12 @@ func TestUpdateSecretExpirationAndGetToken(t *testing.T) { } if testCase.shouldRenew && - bytes.Equal(updatedSecret.Data[expirationKey], []byte(testCase.initialExperirationTime.Format(time.RFC3339))) { + bytes.Equal(updatedSecret.Data[expirationKey], []byte(testCase.initialExpirationTime.Format(time.RFC3339))) { t.Errorf("Error, token secret did not update but was expected to!") } if !testCase.shouldRenew && - !bytes.Equal(updatedSecret.Data[expirationKey], []byte(testCase.initialExperirationTime.Format(time.RFC3339))) { + !bytes.Equal(updatedSecret.Data[expirationKey], []byte(testCase.initialExpirationTime.Format(time.RFC3339))) { t.Errorf("Error, token secret was expected to get updated, but did not happen!") } diff --git a/pkg/controllers/osc/resources/operating_system_config.go b/pkg/controllers/osc/resources/operating_system_config.go index 39da9c59..705bac50 100644 --- a/pkg/controllers/osc/resources/operating_system_config.go +++ b/pkg/controllers/osc/resources/operating_system_config.go @@ -500,10 +500,10 @@ func getKubeletConfigs(annotations map[string]string) (kubeletConfig, error) { return cfg, nil } -func getKeyValueMap(value string, kvDelimeter string) *map[string]string { +func getKeyValueMap(value string, kvDelimiter string) *map[string]string { res := make(map[string]string) for _, pair := range strings.Split(value, ",") { - kvPair := strings.SplitN(pair, kvDelimeter, 2) + kvPair := strings.SplitN(pair, kvDelimiter, 2) if len(kvPair) != 2 { continue }