diff --git a/docs/gen2_Tutorial.md b/docs/gen2_Tutorial.md index 37afb392..a5d76716 100644 --- a/docs/gen2_Tutorial.md +++ b/docs/gen2_Tutorial.md @@ -10,6 +10,8 @@ typically contains multiple related resources that together define an arbitraril If you make subsequent changes to the base cluster, workload clusters originally created from it will automatically acquire the changes. +**NB: Base clusters only support dynamic profiles.** + ## Creating Cluster-API cluster manifest Note: The CAPA version used here is v2.0 and the manifests created here are in accordance with this version. @@ -376,7 +378,7 @@ To update the profiles of a gen2 workload cluster: # To add a new profile to the existing cluster arlon cluster ngupdate --profile # To delete an existing profile from the existing cluster -arlon cluster ngupdate --delete-profile +arlon cluster ngupdate --delete-profile ``` A gen2 cluster can be created without any profile app associated with the cluster. So, the above commands can be used to add a new profile diff --git a/pkg/cluster/ngupdate.go b/pkg/cluster/ngupdate.go index 63be43bb..d8f36e36 100644 --- a/pkg/cluster/ngupdate.go +++ b/pkg/cluster/ngupdate.go @@ -1,6 +1,7 @@ package cluster import ( + "errors" "fmt" argoapp "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" @@ -23,6 +24,9 @@ func NgUpdate( if err != nil { return nil, fmt.Errorf("failed to get profile: %s", err) } + if prof.Spec.RepoUrl == "" { + return nil, errors.New("RepoUrl empty, static profiles are unsupported") + } err = DestroyProfileApps(appIf, clusterName) if err != nil { return nil, fmt.Errorf("Failed to delete profile app: %s", err)