Skip to content

Commit

Permalink
Set non-empty defaults for registry mirror secret credentials (#7933)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna authored Apr 4, 2024
1 parent 989e06b commit 96d504b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions pkg/curatedpackages/packagecontrollerclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ import (
var secretsValueYaml string

const (
eksaDefaultRegion = "us-west-2"
valueFileName = "values.yaml"
eksaDefaultRegion = "us-west-2"
valueFileName = "values.yaml"
defaultRegistryMirrorUsername = "username"
defaultRegistryMirrorPassword = "password"
)

type PackageControllerClientOpt func(client *PackageControllerClient)
Expand Down Expand Up @@ -304,7 +306,7 @@ func (pc *PackageControllerClient) CreateHelmOverrideValuesYaml() (string, []byt

func (pc *PackageControllerClient) generateHelmOverrideValues() ([]byte, error) {
var err error
endpoint, username, password, caCertContent, insecureSkipVerify := "", "", "", "", "false"
endpoint, username, password, caCertContent, insecureSkipVerify := "", defaultRegistryMirrorUsername, defaultRegistryMirrorPassword, "", "false"
if pc.registryMirror != nil {
endpoint = pc.registryMirror.BaseRegistry
username, password, err = config.ReadCredentials()
Expand Down
4 changes: 2 additions & 2 deletions pkg/curatedpackages/testdata/values_empty.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
registryMirrorSecret:
endpoint: ""
username: ""
password: ""
username: "dXNlcm5hbWU="
password: "cGFzc3dvcmQ="
cacertcontent: ""
insecure: "ZmFsc2U="
awsSecret:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
registryMirrorSecret:
endpoint: ""
username: ""
password: ""
username: "dXNlcm5hbWU="
password: "cGFzc3dvcmQ="
cacertcontent: ""
insecure: "ZmFsc2U="
awsSecret:
Expand Down

0 comments on commit 96d504b

Please sign in to comment.