From 92416e30f4fe9f480b825939b161b8704b27e4af Mon Sep 17 00:00:00 2001 From: Eron Wright Date: Wed, 27 Nov 2024 17:48:31 -0700 Subject: [PATCH] Register the API resources into the "pulumi" kubectl category (#765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Proposed changes Adds the PKO API resources to a "pulumi" category for convenience: ``` ❯ kubectl get pulumi NAME WORKSPACE PROGRESSING FAILED COMPLETE URL update.auto.pulumi.com/kubernetes-py-guestbook-1936f1e00d3 kubernetes-py-guestbook False False True https://app.pulumi.com/eron-pulumi-corp/kubernetes-py-guestbook/kubernetes-py-guestbook/updates/118 update.auto.pulumi.com/kubernetes-py-guestbook-1936f31172a kubernetes-py-guestbook False False True https://app.pulumi.com/eron-pulumi-corp/kubernetes-py-guestbook/kubernetes-py-guestbook/updates/119 update.auto.pulumi.com/kubernetes-py-guestbook-1936fefd0de kubernetes-py-guestbook False False True https://app.pulumi.com/eron-pulumi-corp/kubernetes-py-guestbook/kubernetes-py-guestbook/updates/120 NAME IMAGE READY ADDRESS workspace.auto.pulumi.com/kubernetes-py-guestbook pulumi/pulumi:3.134.1-nonroot True kubernetes-py-guestbook-workspace.default:50051 NAME AGE URL program.pulumi.com/random-yaml 70m http://pulumi-kubernetes-operator.pulumi-kubernetes-operator:80/programs/default/random-yaml NAME LAST UPDATE AGE READY RECONCILING STALLED PERMALINK stack.pulumi.com/kubernetes-py-guestbook succeeded 75m True https://app.pulumi.com/eron-pulumi-corp/kubernetes-py-guestbook/kubernetes-py-guestbook/updates/120 ``` ### Related issues (optional) Closes #758 --- CHANGELOG.md | 1 + deploy/crds/auto.pulumi.com_updates.yaml | 2 ++ deploy/crds/auto.pulumi.com_workspaces.yaml | 2 ++ deploy/crds/pulumi.com_programs.yaml | 2 ++ deploy/crds/pulumi.com_stacks.yaml | 2 ++ .../pulumi-operator/crds/auto.pulumi.com_updates.yaml | 2 ++ .../pulumi-operator/crds/auto.pulumi.com_workspaces.yaml | 2 ++ deploy/helm/pulumi-operator/crds/pulumi.com_programs.yaml | 2 ++ deploy/helm/pulumi-operator/crds/pulumi.com_stacks.yaml | 2 ++ deploy/yaml/install.yaml | 8 ++++++++ operator/api/auto/v1alpha1/update_types.go | 1 + operator/api/auto/v1alpha1/workspace_types.go | 1 + operator/api/pulumi/v1/program_types.go | 1 + operator/api/pulumi/v1/stack_types.go | 1 + operator/api/pulumi/v1alpha1/stack_types.go | 1 + operator/config/crd/bases/auto.pulumi.com_updates.yaml | 2 ++ operator/config/crd/bases/auto.pulumi.com_workspaces.yaml | 2 ++ operator/config/crd/bases/pulumi.com_programs.yaml | 2 ++ operator/config/crd/bases/pulumi.com_stacks.yaml | 2 ++ 19 files changed, 38 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d4c604a..ea2b712e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ CHANGELOG - Stack Controller: watch for delete events. [#756](https://github.com/pulumi/pulumi-kubernetes-operator/pull/756) - Stack Controller: fix an issue where new commits weren't detected when using git sources. https://github.com/pulumi/pulumi-kubernetes-operator/issues/762 - Ensure cleanup of Stack in foreground deletion. [#760](https://github.com/pulumi/pulumi-kubernetes-operator/pull/760) +- Register API resources into the "pulumi" category [#765](https://github.com/pulumi/pulumi-kubernetes-operator/pull/765) ## 2.0.0-beta.2 (2024-11-11) diff --git a/deploy/crds/auto.pulumi.com_updates.yaml b/deploy/crds/auto.pulumi.com_updates.yaml index 8107aff2..0535f5fc 100644 --- a/deploy/crds/auto.pulumi.com_updates.yaml +++ b/deploy/crds/auto.pulumi.com_updates.yaml @@ -8,6 +8,8 @@ metadata: spec: group: auto.pulumi.com names: + categories: + - pulumi kind: Update listKind: UpdateList plural: updates diff --git a/deploy/crds/auto.pulumi.com_workspaces.yaml b/deploy/crds/auto.pulumi.com_workspaces.yaml index 51a8f5c2..30db5e87 100644 --- a/deploy/crds/auto.pulumi.com_workspaces.yaml +++ b/deploy/crds/auto.pulumi.com_workspaces.yaml @@ -8,6 +8,8 @@ metadata: spec: group: auto.pulumi.com names: + categories: + - pulumi kind: Workspace listKind: WorkspaceList plural: workspaces diff --git a/deploy/crds/pulumi.com_programs.yaml b/deploy/crds/pulumi.com_programs.yaml index a1237fce..26bde761 100644 --- a/deploy/crds/pulumi.com_programs.yaml +++ b/deploy/crds/pulumi.com_programs.yaml @@ -8,6 +8,8 @@ metadata: spec: group: pulumi.com names: + categories: + - pulumi kind: Program listKind: ProgramList plural: programs diff --git a/deploy/crds/pulumi.com_stacks.yaml b/deploy/crds/pulumi.com_stacks.yaml index 9d6be642..71df4d7e 100644 --- a/deploy/crds/pulumi.com_stacks.yaml +++ b/deploy/crds/pulumi.com_stacks.yaml @@ -8,6 +8,8 @@ metadata: spec: group: pulumi.com names: + categories: + - pulumi kind: Stack listKind: StackList plural: stacks diff --git a/deploy/helm/pulumi-operator/crds/auto.pulumi.com_updates.yaml b/deploy/helm/pulumi-operator/crds/auto.pulumi.com_updates.yaml index 8107aff2..0535f5fc 100644 --- a/deploy/helm/pulumi-operator/crds/auto.pulumi.com_updates.yaml +++ b/deploy/helm/pulumi-operator/crds/auto.pulumi.com_updates.yaml @@ -8,6 +8,8 @@ metadata: spec: group: auto.pulumi.com names: + categories: + - pulumi kind: Update listKind: UpdateList plural: updates diff --git a/deploy/helm/pulumi-operator/crds/auto.pulumi.com_workspaces.yaml b/deploy/helm/pulumi-operator/crds/auto.pulumi.com_workspaces.yaml index 51a8f5c2..30db5e87 100644 --- a/deploy/helm/pulumi-operator/crds/auto.pulumi.com_workspaces.yaml +++ b/deploy/helm/pulumi-operator/crds/auto.pulumi.com_workspaces.yaml @@ -8,6 +8,8 @@ metadata: spec: group: auto.pulumi.com names: + categories: + - pulumi kind: Workspace listKind: WorkspaceList plural: workspaces diff --git a/deploy/helm/pulumi-operator/crds/pulumi.com_programs.yaml b/deploy/helm/pulumi-operator/crds/pulumi.com_programs.yaml index a1237fce..26bde761 100644 --- a/deploy/helm/pulumi-operator/crds/pulumi.com_programs.yaml +++ b/deploy/helm/pulumi-operator/crds/pulumi.com_programs.yaml @@ -8,6 +8,8 @@ metadata: spec: group: pulumi.com names: + categories: + - pulumi kind: Program listKind: ProgramList plural: programs diff --git a/deploy/helm/pulumi-operator/crds/pulumi.com_stacks.yaml b/deploy/helm/pulumi-operator/crds/pulumi.com_stacks.yaml index 9d6be642..71df4d7e 100644 --- a/deploy/helm/pulumi-operator/crds/pulumi.com_stacks.yaml +++ b/deploy/helm/pulumi-operator/crds/pulumi.com_stacks.yaml @@ -8,6 +8,8 @@ metadata: spec: group: pulumi.com names: + categories: + - pulumi kind: Stack listKind: StackList plural: stacks diff --git a/deploy/yaml/install.yaml b/deploy/yaml/install.yaml index db5a11ce..4d71958f 100644 --- a/deploy/yaml/install.yaml +++ b/deploy/yaml/install.yaml @@ -16,6 +16,8 @@ metadata: spec: group: pulumi.com names: + categories: + - pulumi kind: Program listKind: ProgramList plural: programs @@ -243,6 +245,8 @@ metadata: spec: group: pulumi.com names: + categories: + - pulumi kind: Stack listKind: StackList plural: stacks @@ -19330,6 +19334,8 @@ metadata: spec: group: auto.pulumi.com names: + categories: + - pulumi kind: Update listKind: UpdateList plural: updates @@ -19555,6 +19561,8 @@ metadata: spec: group: auto.pulumi.com names: + categories: + - pulumi kind: Workspace listKind: WorkspaceList plural: workspaces diff --git a/operator/api/auto/v1alpha1/update_types.go b/operator/api/auto/v1alpha1/update_types.go index 706bec52..f05a21e7 100644 --- a/operator/api/auto/v1alpha1/update_types.go +++ b/operator/api/auto/v1alpha1/update_types.go @@ -111,6 +111,7 @@ type UpdateStatus struct { } //+kubebuilder:object:root=true +//+kubebuilder:resource:categories=pulumi //+kubebuilder:subresource:status //+kubebuilder:printcolumn:name="Workspace",type=string,JSONPath=`.spec.workspaceName` //+kubebuilder:printcolumn:name="Type",type=string,priority=10,JSONPath=`.spec.type` diff --git a/operator/api/auto/v1alpha1/workspace_types.go b/operator/api/auto/v1alpha1/workspace_types.go index 39e2beee..18c80d3c 100644 --- a/operator/api/auto/v1alpha1/workspace_types.go +++ b/operator/api/auto/v1alpha1/workspace_types.go @@ -271,6 +271,7 @@ type WorkspaceStatus struct { //+genclient //+kubebuilder:object:root=true +//+kubebuilder:resource:categories=pulumi //+kubebuilder:subresource:status //+kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.spec.image` //+kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` diff --git a/operator/api/pulumi/v1/program_types.go b/operator/api/pulumi/v1/program_types.go index 55e31c27..da7d2c03 100644 --- a/operator/api/pulumi/v1/program_types.go +++ b/operator/api/pulumi/v1/program_types.go @@ -174,6 +174,7 @@ type ProgramStatus struct { // +kubebuilder:object:root=true // +kubebuilder:storageversion +// +kubebuilder:resource:categories=pulumi // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:printcolumn:name="URL",type="string",JSONPath=".status.artifact.url" diff --git a/operator/api/pulumi/v1/stack_types.go b/operator/api/pulumi/v1/stack_types.go index e95708d2..3fd9a358 100644 --- a/operator/api/pulumi/v1/stack_types.go +++ b/operator/api/pulumi/v1/stack_types.go @@ -145,6 +145,7 @@ func (s *StackStatus) MarkReadyCondition() { } // +kubebuilder:object:root=true +// +kubebuilder:resource:categories=pulumi // +kubebuilder:subresource:status // +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Stack",priority=10,type="string",JSONPath=".spec.stack" diff --git a/operator/api/pulumi/v1alpha1/stack_types.go b/operator/api/pulumi/v1alpha1/stack_types.go index 80ef6ba0..dec02f73 100644 --- a/operator/api/pulumi/v1alpha1/stack_types.go +++ b/operator/api/pulumi/v1alpha1/stack_types.go @@ -22,6 +22,7 @@ import ( ) //+kubebuilder:object:root=true +//+kubebuilder:resource:categories=pulumi //+kubebuilder:subresource:status // Stack is the Schema for the stacks API. diff --git a/operator/config/crd/bases/auto.pulumi.com_updates.yaml b/operator/config/crd/bases/auto.pulumi.com_updates.yaml index 8107aff2..0535f5fc 100644 --- a/operator/config/crd/bases/auto.pulumi.com_updates.yaml +++ b/operator/config/crd/bases/auto.pulumi.com_updates.yaml @@ -8,6 +8,8 @@ metadata: spec: group: auto.pulumi.com names: + categories: + - pulumi kind: Update listKind: UpdateList plural: updates diff --git a/operator/config/crd/bases/auto.pulumi.com_workspaces.yaml b/operator/config/crd/bases/auto.pulumi.com_workspaces.yaml index 51a8f5c2..30db5e87 100644 --- a/operator/config/crd/bases/auto.pulumi.com_workspaces.yaml +++ b/operator/config/crd/bases/auto.pulumi.com_workspaces.yaml @@ -8,6 +8,8 @@ metadata: spec: group: auto.pulumi.com names: + categories: + - pulumi kind: Workspace listKind: WorkspaceList plural: workspaces diff --git a/operator/config/crd/bases/pulumi.com_programs.yaml b/operator/config/crd/bases/pulumi.com_programs.yaml index a1237fce..26bde761 100644 --- a/operator/config/crd/bases/pulumi.com_programs.yaml +++ b/operator/config/crd/bases/pulumi.com_programs.yaml @@ -8,6 +8,8 @@ metadata: spec: group: pulumi.com names: + categories: + - pulumi kind: Program listKind: ProgramList plural: programs diff --git a/operator/config/crd/bases/pulumi.com_stacks.yaml b/operator/config/crd/bases/pulumi.com_stacks.yaml index 9d6be642..71df4d7e 100644 --- a/operator/config/crd/bases/pulumi.com_stacks.yaml +++ b/operator/config/crd/bases/pulumi.com_stacks.yaml @@ -8,6 +8,8 @@ metadata: spec: group: pulumi.com names: + categories: + - pulumi kind: Stack listKind: StackList plural: stacks