Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed Mar 18, 2024
1 parent e208e4a commit d2e9b90
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion deploy/cloud-init-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pkg/bootstrap/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions pkg/bootstrap/kubeconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}

Expand All @@ -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().
Expand All @@ -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!")
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/controllers/osc/resources/operating_system_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d2e9b90

Please sign in to comment.