Skip to content

Commit

Permalink
chore(internal|test): finish removing named returns outside of packag…
Browse files Browse the repository at this point in the history
…e and extensions

Signed-off-by: Kit Patella <kit@defenseunicorns.com>
  • Loading branch information
mkcp committed Sep 10, 2024
1 parent 6eeabf9 commit 65040e6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/internal/agent/hooks/argocd-application.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func NewApplicationMutationHook(ctx context.Context, cluster *cluster.Cluster) o
}

// mutateApplication mutates the git repository url to point to the repository URL defined in the ZarfState.
func mutateApplication(ctx context.Context, r *v1.AdmissionRequest, cluster *cluster.Cluster) (result *operations.Result, err error) {
func mutateApplication(ctx context.Context, r *v1.AdmissionRequest, cluster *cluster.Cluster) (*operations.Result, error) {
state, err := cluster.LoadZarfState(ctx)
if err != nil {
return nil, err
Expand All @@ -72,8 +72,7 @@ func mutateApplication(ctx context.Context, r *v1.AdmissionRequest, cluster *clu
return nil, fmt.Errorf(lang.ErrUnmarshal, err)
}

patches := []operations.PatchOperation{}

patches := make([]operations.PatchOperation, 0)
if app.Spec.Source != nil {
patchedURL, err := getPatchedRepoURL(app.Spec.Source.RepoURL, state.GitServer, r)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/agent/hooks/argocd-repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewRepositorySecretMutationHook(ctx context.Context, cluster *cluster.Clust
}

// mutateRepositorySecret mutates the git URL in the ArgoCD repository secret to point to the repository URL defined in the ZarfState.
func mutateRepositorySecret(ctx context.Context, r *v1.AdmissionRequest, cluster *cluster.Cluster) (result *operations.Result, err error) {
func mutateRepositorySecret(ctx context.Context, r *v1.AdmissionRequest, cluster *cluster.Cluster) (*operations.Result, error) {
isCreate := r.Operation == v1.Create
isUpdate := r.Operation == v1.Update
var isPatched bool
Expand Down
2 changes: 1 addition & 1 deletion src/internal/agent/hooks/flux-gitrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewGitRepositoryMutationHook(ctx context.Context, cluster *cluster.Cluster)
}

// mutateGitRepoCreate mutates the git repository url to point to the repository URL defined in the ZarfState.
func mutateGitRepo(ctx context.Context, r *v1.AdmissionRequest, cluster *cluster.Cluster) (result *operations.Result, err error) {
func mutateGitRepo(ctx context.Context, r *v1.AdmissionRequest, cluster *cluster.Cluster) (*operations.Result, error) {
var (
patches []operations.PatchOperation
isPatched bool
Expand Down
3 changes: 2 additions & 1 deletion src/test/e2e/28_wait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ type zarfCommandResult struct {
err error
}

func zarfCommandWStruct(t *testing.T, e2e test.ZarfE2ETest, path string) (result zarfCommandResult) {
func zarfCommandWStruct(t *testing.T, e2e test.ZarfE2ETest, path string) zarfCommandResult {
result := zarfCommandResult{}
result.stdOut, result.stdErr, result.err = e2e.Zarf(t, "package", "deploy", path, "--confirm")
return result
}
Expand Down

0 comments on commit 65040e6

Please sign in to comment.