Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sequential numbering for naming the Update object #722

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deploy/crds/auto.pulumi.com_updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions deploy/helm/pulumi-operator/crds/auto.pulumi.com_updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions operator/api/auto/v1alpha1/update_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 4 additions & 0 deletions operator/config/crd/bases/auto.pulumi.com_updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions operator/internal/controller/pulumi/stack_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
Loading