Skip to content

Commit

Permalink
Fix Gen2 tutorial (#340)
Browse files Browse the repository at this point in the history
* doc fix, gen2

* validation for static profiles gen2 clusters
  • Loading branch information
Rohitrajak1807 authored Dec 2, 2022
1 parent 5245090 commit 0c067f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/gen2_Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 <clustername> --profile <profilename>
# To delete an existing profile from the existing cluster
arlon cluster ngupdate <clustername> --delete-profile <profilename>
arlon cluster ngupdate <clustername> --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
Expand Down
4 changes: 4 additions & 0 deletions pkg/cluster/ngupdate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cluster

import (
"errors"
"fmt"

argoapp "github.com/argoproj/argo-cd/v2/pkg/apiclient/application"
Expand All @@ -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)
Expand Down

0 comments on commit 0c067f8

Please sign in to comment.