Skip to content

Commit

Permalink
fix: reorder if block to check err
Browse files Browse the repository at this point in the history
Signed-off-by: Chandan-DK <chandandk468@gmail.com>
  • Loading branch information
Chandan-DK committed Aug 10, 2023
1 parent 7542f32 commit 5d7009b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/cli/kubectl-kyverno/apply/apply_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,13 @@ func (c *ApplyCommandConfig) applyCommandHelper() (*common.ResultCounts, []*unst
}

policiesFromFile, admissionPoliciesFromFile, err := common.GetPoliciesFromPaths(fs, policyPaths, isGit, "")
policies = append(policies, policiesFromFile...)
validatingAdmissionPolicies = append(validatingAdmissionPolicies, admissionPoliciesFromFile...)

if err != nil {
fmt.Printf("Error: failed to load policies\nCause: %s\n", err)
osExit(1)
}

policies = append(policies, policiesFromFile...)
validatingAdmissionPolicies = append(validatingAdmissionPolicies, admissionPoliciesFromFile...)
}

// load resources
Expand Down

0 comments on commit 5d7009b

Please sign in to comment.