Skip to content

Commit

Permalink
chore: cleanup some if err logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad-ibra committed Sep 5, 2024
1 parent 482a04d commit 4302cb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions pkg/services/validator/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ func configureOciRegistryRules(c *components.OCIPluginConfig, ruleNames, authSec
}

func readOciRegistryRule(c *components.OCIPluginConfig, r *plug.OciRegistryRule, idx int, ruleNames, authSecretNames, sigSecretNames *[]string, kClient kubernetes.Interface, direct bool) error {
err := initRule(r, "OCI", "", ruleNames)
if err != nil {
if err := initRule(r, "OCI", "", ruleNames); err != nil {
return err
}

Expand Down Expand Up @@ -318,13 +317,11 @@ func readOciRegistryRule(c *components.OCIPluginConfig, r *plug.OciRegistryRule,
}
if shouldConfigureSigVerification {
if direct {
err := configureSigVerification(r)
if err != nil {
if err := configureSigVerification(r); err != nil {
return err
}
} else {
err := configureSigVerificationSecrets(c, r, kClient, sigSecretNames)
if err != nil {
if err := configureSigVerificationSecrets(c, r, kClient, sigSecretNames); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/_validator/testcases/test_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (t *ValidatorTest) awsPluginInstallValues(ctx *test.TestContext, vals []str
"y", // enable AWS plugin
"n", // use implicit auth
"aws-creds", // AWS secret name
"secretkey", // AWS Secret Key ID
"secretkey", // AWS Access Key ID
"secretaccesskey", // AWS Secret Access Key
"", // AWS Session Token
"y", // Configure STS
Expand Down

0 comments on commit 4302cb2

Please sign in to comment.