Skip to content

Commit

Permalink
Set non-empty defaults for registry mirror secret credentials (#8049)
Browse files Browse the repository at this point in the history
Overriding vulncheck

Co-authored-by: Abhay Krishna Arunachalam <[email protected]>
  • Loading branch information
eks-distro-pr-bot and abhay-krishna authored Apr 26, 2024
1 parent 69af480 commit fa05f84
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 @@ -305,7 +307,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
if pc.registryMirror.Auth {
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 fa05f84

Please sign in to comment.