From d61ff49647b6a3bfcd9631aadbbf7c718da0bab0 Mon Sep 17 00:00:00 2001 From: Shane Bryzak Date: Sat, 16 Mar 2024 09:22:51 +1000 Subject: [PATCH] Sandbox 554 (#404) * Made IdentityClaims required * minor * added DeactivationTimestamp to UserSignup.Status * slight improvement to docs * modified type * fixed --- api/v1alpha1/usersignup_types.go | 7 +++++++ api/v1alpha1/zz_generated.deepcopy.go | 1 + api/v1alpha1/zz_generated.openapi.go | 9 ++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/usersignup_types.go b/api/v1alpha1/usersignup_types.go index 60574ba7..5db5a942 100644 --- a/api/v1alpha1/usersignup_types.go +++ b/api/v1alpha1/usersignup_types.go @@ -247,6 +247,13 @@ type UserSignupStatus struct { // This is used by the proxy when no workspace context is provided. // +optional HomeSpace string `json:"homeSpace,omitempty"` + + // ScheduledDeactivationTimestamp is the calculated timestamp after which the user's account will be deactivated, typically + // after the expiry of their trial and based on the term specific by their UserTier. This property may be used as + // a convenience to determine the amount of time an account has left before deactivation, without requiring a separate + // lookup for the UserTier and subsequent calculation. It is managed by the Deactivation controller in the host operator. + // +optional + ScheduledDeactivationTimestamp metav1.Time `json:"scheduledDeactivationTimestamp,omitempty"` } //+kubebuilder:object:root=true diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 56272c8f..b5858a64 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -3728,6 +3728,7 @@ func (in *UserSignupStatus) DeepCopyInto(out *UserSignupStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + in.ScheduledDeactivationTimestamp.DeepCopyInto(&out.ScheduledDeactivationTimestamp) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSignupStatus. diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index 99d9f7a9..acc6edfa 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -5175,11 +5175,18 @@ func schema_codeready_toolchain_api_api_v1alpha1_UserSignupStatus(ref common.Ref Format: "", }, }, + "scheduledDeactivationTimestamp": { + SchemaProps: spec.SchemaProps{ + Description: "ScheduledDeactivationTimestamp is the calculated timestamp after which the user's account will be deactivated, typically after the expiry of their trial and based on the term specific by their UserTier. This property may be used as a convenience to determine the amount of time an account has left before deactivation, without requiring a separate lookup for the UserTier and subsequent calculation. It is managed by the Deactivation controller in the host operator.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/codeready-toolchain/api/api/v1alpha1.Condition"}, + "github.com/codeready-toolchain/api/api/v1alpha1.Condition", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } }