diff --git a/deploy/crds/auto.pulumi.com_updates.yaml b/deploy/crds/auto.pulumi.com_updates.yaml index 2fde0f6b..8107aff2 100644 --- a/deploy/crds/auto.pulumi.com_updates.yaml +++ b/deploy/crds/auto.pulumi.com_updates.yaml @@ -18,6 +18,10 @@ spec: - jsonPath: .spec.workspaceName name: Workspace type: string + - jsonPath: .spec.type + name: Type + priority: 10 + type: string - jsonPath: .status.startTime name: Start Time priority: 10 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 2fde0f6b..8107aff2 100644 --- a/deploy/helm/pulumi-operator/crds/auto.pulumi.com_updates.yaml +++ b/deploy/helm/pulumi-operator/crds/auto.pulumi.com_updates.yaml @@ -18,6 +18,10 @@ spec: - jsonPath: .spec.workspaceName name: Workspace type: string + - jsonPath: .spec.type + name: Type + priority: 10 + type: string - jsonPath: .status.startTime name: Start Time priority: 10 diff --git a/operator/api/auto/v1alpha1/update_types.go b/operator/api/auto/v1alpha1/update_types.go index a0bafcc7..706bec52 100644 --- a/operator/api/auto/v1alpha1/update_types.go +++ b/operator/api/auto/v1alpha1/update_types.go @@ -113,6 +113,7 @@ type UpdateStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status //+kubebuilder:printcolumn:name="Workspace",type=string,JSONPath=`.spec.workspaceName` +//+kubebuilder:printcolumn:name="Type",type=string,priority=10,JSONPath=`.spec.type` //+kubebuilder:printcolumn:name="Start Time",type=date,priority=10,JSONPath=`.status.startTime` //+kubebuilder:printcolumn:name="End Time",type=date,priority=10,JSONPath=`.status.endTime` //+kubebuilder:printcolumn:name="Progressing",type=string,JSONPath=`.status.conditions[?(@.type=="Progressing")].status` diff --git a/operator/config/crd/bases/auto.pulumi.com_updates.yaml b/operator/config/crd/bases/auto.pulumi.com_updates.yaml index 2fde0f6b..8107aff2 100644 --- a/operator/config/crd/bases/auto.pulumi.com_updates.yaml +++ b/operator/config/crd/bases/auto.pulumi.com_updates.yaml @@ -18,6 +18,10 @@ spec: - jsonPath: .spec.workspaceName name: Workspace type: string + - jsonPath: .spec.type + name: Type + priority: 10 + type: string - jsonPath: .status.startTime name: Start Time priority: 10 diff --git a/operator/internal/controller/pulumi/stack_controller.go b/operator/internal/controller/pulumi/stack_controller.go index cf4b8131..e24eb856 100644 --- a/operator/internal/controller/pulumi/stack_controller.go +++ b/operator/internal/controller/pulumi/stack_controller.go @@ -46,7 +46,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - utilrand "k8s.io/apimachinery/pkg/util/rand" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" @@ -1419,7 +1418,7 @@ func (sess *stackReconcilerSession) newDestroy(ctx context.Context, o *pulumiv1. } func makeUpdateName(o *pulumiv1.Stack) string { - return fmt.Sprintf("%s-%s", o.Name, utilrand.String(8)) + return fmt.Sprintf("%s-%x", o.Name, time.Now().UnixMilli()) } func (sess *stackReconcilerSession) readCurrentUpdate(ctx context.Context, name types.NamespacedName) error {