Skip to content

Commit 5e498d9

Browse files
authored
cmd/kperf/virtualcluster: hide lifecycle CRD and definition when listing node pools (#174)
Since the lifecycle CRD and definition have been installed in **virtualnodeReleaseNamespace** namespace, it will show up when listing node pools. ```shell NAME NODES CPU MEMORY (GiB) MAX PODS STATUS lifecycle-crd ? / <nil> <nil> <nil> <nil> deployed lifecycle-def ? / <nil> <nil> <nil> <nil> deployed ``` These should be ignored, as they are not actual virtual node pools.
1 parent 06acf19 commit 5e498d9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

virtualcluster/nodes_common.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ const (
5757
//
5858
// NOTE: Please check the details in ./nodes_create.go.
5959
reservedNodepoolSuffixName = "-controller"
60+
61+
// reservedLifecyclePrefixName is the prefix of lifecycle CRD and definition.
62+
reservedLifecyclePrefixName = "lifecycle-"
6063
)
6164

6265
type nodepoolConfig struct {

virtualcluster/nodes_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func ListNodepools(_ context.Context, kubeconfigPath string) ([]*release.Release
2929
res := make([]*release.Release, 0, len(releases)/2)
3030
for idx := range releases {
3131
r := releases[idx]
32-
if strings.HasSuffix(r.Name, reservedNodepoolSuffixName) {
32+
if strings.HasSuffix(r.Name, reservedNodepoolSuffixName) || strings.HasPrefix(r.Name, reservedLifecyclePrefixName) {
3333
continue
3434
}
3535
res = append(res, r)

0 commit comments

Comments
 (0)