@@ -47,7 +47,6 @@ import (
47
47
apcmd "github.com/argoproj-labs/argocd-autopilot/cmd/commands"
48
48
"github.com/argoproj-labs/argocd-autopilot/pkg/application"
49
49
"github.com/argoproj-labs/argocd-autopilot/pkg/fs"
50
- "github.com/argoproj-labs/argocd-autopilot/pkg/git"
51
50
apgit "github.com/argoproj-labs/argocd-autopilot/pkg/git"
52
51
"github.com/argoproj-labs/argocd-autopilot/pkg/kube"
53
52
apstore "github.com/argoproj-labs/argocd-autopilot/pkg/store"
@@ -694,7 +693,7 @@ func runRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
694
693
return util .DecorateErrorWithDocsLink (fmt .Errorf ("failed to bootstrap repository: %w" , err ))
695
694
}
696
695
697
- err = patchClusterResourcesAppSet (ctx , opts .InsCloneOpts )
696
+ err = patchRuntimeRepo (ctx , opts .InsCloneOpts , "patch cluster-resources ApplicationSet" , patchClusterResourcesAppSet )
698
697
if err != nil {
699
698
return util .DecorateErrorWithDocsLink (fmt .Errorf ("failed to patch cluster-resources ApplicationSet: %w" , err ))
700
699
}
@@ -2153,12 +2152,7 @@ func getRuntimeDef(runtimeDef, version string) string {
2153
2152
return strings .Replace (runtimeDef , "stable" , version , 1 )
2154
2153
}
2155
2154
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 {
2162
2156
appSet := & argocdv1alpha1.ApplicationSet {}
2163
2157
name := store .Get ().ClusterResourcesPath
2164
2158
if err := fs .ReadYamls (name , appSet ); err != nil {
@@ -2170,9 +2164,5 @@ func patchClusterResourcesAppSet(ctx context.Context, cloneOpts *git.CloneOption
2170
2164
}
2171
2165
2172
2166
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 )
2178
2168
}
0 commit comments