@@ -47,7 +47,6 @@ import (
4747 apcmd "github.com/argoproj-labs/argocd-autopilot/cmd/commands"
4848 "github.com/argoproj-labs/argocd-autopilot/pkg/application"
4949 "github.com/argoproj-labs/argocd-autopilot/pkg/fs"
50- "github.com/argoproj-labs/argocd-autopilot/pkg/git"
5150 apgit "github.com/argoproj-labs/argocd-autopilot/pkg/git"
5251 "github.com/argoproj-labs/argocd-autopilot/pkg/kube"
5352 apstore "github.com/argoproj-labs/argocd-autopilot/pkg/store"
@@ -694,7 +693,7 @@ func runRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
694693 return util .DecorateErrorWithDocsLink (fmt .Errorf ("failed to bootstrap repository: %w" , err ))
695694 }
696695
697- err = patchClusterResourcesAppSet (ctx , opts .InsCloneOpts )
696+ err = patchRuntimeRepo (ctx , opts .InsCloneOpts , "patch cluster-resources ApplicationSet" , patchClusterResourcesAppSet )
698697 if err != nil {
699698 return util .DecorateErrorWithDocsLink (fmt .Errorf ("failed to patch cluster-resources ApplicationSet: %w" , err ))
700699 }
@@ -2153,12 +2152,7 @@ func getRuntimeDef(runtimeDef, version string) string {
21532152 return strings .Replace (runtimeDef , "stable" , version , 1 )
21542153}
21552154
2156- func patchClusterResourcesAppSet (ctx context.Context , cloneOpts * git.CloneOptions ) error {
2157- r , fs , err := cloneOpts .GetRepo (ctx )
2158- if err != nil {
2159- return err
2160- }
2161-
2155+ func patchClusterResourcesAppSet (fs fs.FS ) error {
21622156 appSet := & argocdv1alpha1.ApplicationSet {}
21632157 name := store .Get ().ClusterResourcesPath
21642158 if err := fs .ReadYamls (name , appSet ); err != nil {
@@ -2170,9 +2164,5 @@ func patchClusterResourcesAppSet(ctx context.Context, cloneOpts *git.CloneOption
21702164 }
21712165
21722166 appSet .ObjectMeta .Labels [store .Get ().LabelKeyCFInternal ] = "true"
2173- if err = fs .WriteYamls (name , appSet ); err != nil {
2174- return err
2175- }
2176-
2177- return apu .PushWithMessage (ctx , r , "patch cluster-resources ApplicationSet" )
2167+ return fs .WriteYamls (name , appSet )
21782168}
0 commit comments