Skip to content

Commit

Permalink
Staticcheck fixes
Browse files Browse the repository at this point in the history
Signed-off-by: John Collier <[email protected]>
  • Loading branch information
johnmcollier committed Aug 9, 2023
1 parent 78ac7c0 commit 88f87f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (

"github.com/go-logr/logr"
appstudiov1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1"
"github.com/redhat-appstudio/application-service/gitops-generator/pkg/generate"
github "github.com/redhat-appstudio/application-service/pkg/github"
logutil "github.com/redhat-appstudio/application-service/pkg/log"
"github.com/redhat-appstudio/application-service/pkg/util/ioutils"
Expand Down Expand Up @@ -154,16 +153,14 @@ func (r *SnapshotEnvironmentBindingReconciler) Reconcile(ctx context.Context, re
localGitopsGen := (!r.DoGitOpsJob) || (r.AllowLocalGitopsGen && appSnapshotEnvBinding.Annotations["allowLocalGitopsGen"] == "true")

if localGitopsGen {
err = gitopsjoblib.GenerateGitopsOverlays(context.Background(), log, r.Client, appSnapshotEnvBinding, ioutils.NewFilesystem(), generate.GitOpsGenParams{
err = gitopsjoblib.GenerateGitopsOverlays(context.Background(), log, r.Client, appSnapshotEnvBinding, ioutils.NewFilesystem(), gitopsjoblib.GitOpsGenParams{
Generator: r.Generator,
Token: ghClient.Token,
})
if err != nil {
r.SetConditionAndUpdateCR(ctx, req, &appSnapshotEnvBinding, err)
return ctrl.Result{}, err
}
} else {
// ToDo: Add support for GitOps job
}

r.SetConditionAndUpdateCR(ctx, req, &appSnapshotEnvBinding, nil)
Expand Down
5 changes: 1 addition & 4 deletions controllers/component_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (

"github.com/prometheus/client_golang/prometheus"
cdqanalysis "github.com/redhat-appstudio/application-service/cdq-analysis/pkg"
"github.com/redhat-appstudio/application-service/gitops-generator/pkg/generate"
gitopsjoblib "github.com/redhat-appstudio/application-service/gitops-generator/pkg/generate"
"github.com/redhat-appstudio/application-service/pkg/metrics"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -562,7 +561,7 @@ func (r *ComponentReconciler) generateGitops(ctx context.Context, ghClient *gith
localGitopsGen := (!r.DoGitOpsJob) || (r.AllowLocalGitopsGen && component.Annotations["allowLocalGitopsGen"] == "true")

if localGitopsGen {
err = gitopsjoblib.GenerateGitopsBase(context.Background(), log, r.Client, *component, ioutils.NewFilesystem(), generate.GitOpsGenParams{
err = gitopsjoblib.GenerateGitopsBase(context.Background(), log, r.Client, *component, ioutils.NewFilesystem(), gitopsjoblib.GitOpsGenParams{
Generator: r.Generator,
Token: ghClient.Token,
RemoteURL: gitOpsURL,
Expand All @@ -572,8 +571,6 @@ func (r *ComponentReconciler) generateGitops(ctx context.Context, ghClient *gith
if err != nil {
return err
}
} else {
// ToDo: Implement GitOps generation in Kubernetes jobs
}

return nil
Expand Down

0 comments on commit 88f87f5

Please sign in to comment.