Skip to content

Commit

Permalink
Better variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunyiLyu committed Sep 13, 2021
1 parent 40d7656 commit 5b491ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/resource/default_user_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ func (builder *DefaultUserSecretBuilder) updatePorts(secret *corev1.Secret) {
// generateUsername returns a base64 string that has "default_user_" as prefix
// returned string has length 'l' when base64 decoded
func generateUsername(l int) (string, error) {
encodedStr, err := randomEncodedString(l)
encoded, err := randomEncodedString(l)
if err != nil {
return "", err
}

encodedStrSlice := []byte(encodedStr)
return string(append([]byte(usernamePrefix), encodedStrSlice[0:len(encodedStrSlice)-len(usernamePrefix)]...)), nil
encodedSlice := []byte(encoded)
return string(append([]byte(usernamePrefix), encodedSlice[0:len(encodedSlice)-len(usernamePrefix)]...)), nil
}

func (builder *DefaultUserSecretBuilder) pluginEnabled(plugin v1beta1.Plugin) bool {
Expand Down

0 comments on commit 5b491ca

Please sign in to comment.