diff --git a/api/v1alpha1/docs/apiref.adoc b/api/v1alpha1/docs/apiref.adoc index 73bd3506..1120ece0 100644 --- a/api/v1alpha1/docs/apiref.adoc +++ b/api/v1alpha1/docs/apiref.adoc @@ -1333,6 +1333,7 @@ NSTemplateSetClusterResources defines the cluster-scoped resources associated wi .Appears In: **** - xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatesetspec[$$NSTemplateSetSpec$$] +- xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatesetstatus[$$NSTemplateSetStatus$$] **** [cols="20a,50a,15a,15a", options="header"] @@ -1377,6 +1378,7 @@ NSTemplateSetNamespace the namespace definition in an NSTemplateSet resource .Appears In: **** - xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatesetspec[$$NSTemplateSetSpec$$] +- xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatesetstatus[$$NSTemplateSetStatus$$] **** [cols="20a,50a,15a,15a", options="header"] @@ -1398,6 +1400,7 @@ NSTemplateSetSpaceRole the role template and the users to whom the templates sho .Appears In: **** - xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatesetspec[$$NSTemplateSetSpec$$] +- xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatesetstatus[$$NSTemplateSetStatus$$] **** [cols="20a,50a,15a,15a", options="header"] @@ -1449,6 +1452,10 @@ NSTemplateSetStatus defines the observed state of NSTemplateSet [cols="20a,50a,15a,15a", options="header"] |=== | Field | Description | Default | Validation +| *`namespaces`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatesetnamespace[$$NSTemplateSetNamespace$$] array__ | The namespace templates that were used last time to provision NSTemplateSet CR + | | +| *`clusterResources`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatesetclusterresources[$$NSTemplateSetClusterResources$$]__ | The cluster resources template (for cluster-wide quotas, etc.) that was used last time to provision the NSTemplateSet CR + | | +| *`spaceRoles`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-nstemplatesetspacerole[$$NSTemplateSetSpaceRole$$] array__ | The SpaceRole template and the users to whom the template was applied for when the NSTemplateSet CR was provisioned for the last time + | | +| *`featureToggles`* __string array__ | FeatureToggles holds the list of feature toggles/flags that were enabled when the NSTemplateSet CR was provisioned for the last time + | | | *`provisionedNamespaces`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-spacenamespace[$$SpaceNamespace$$] array__ | ProvisionedNamespaces is a list of Namespaces that were provisioned by the NSTemplateSet. + | | | *`conditions`* __xref:{anchor_prefix}-github-com-codeready-toolchain-api-api-v1alpha1-condition[$$Condition$$] array__ | Conditions is an array of current NSTemplateSet conditions + Supported condition types: ConditionReady + | | diff --git a/api/v1alpha1/nstemplateset_types.go b/api/v1alpha1/nstemplateset_types.go index 767adbe9..b5d376ac 100644 --- a/api/v1alpha1/nstemplateset_types.go +++ b/api/v1alpha1/nstemplateset_types.go @@ -86,6 +86,25 @@ type NSTemplateSetSpaceRole struct { // NSTemplateSetStatus defines the observed state of NSTemplateSet // +k8s:openapi-gen=true type NSTemplateSetStatus struct { + // The namespace templates that were used last time to provision NSTemplateSet CR + // +optional + // +listType=atomic + Namespaces []NSTemplateSetNamespace `json:"namespaces,omitempty"` + + // The cluster resources template (for cluster-wide quotas, etc.) that was used last time to provision the NSTemplateSet CR + // +optional + ClusterResources *NSTemplateSetClusterResources `json:"clusterResources,omitempty"` + + // The SpaceRole template and the users to whom the template was applied for when the NSTemplateSet CR was provisioned for the last time + // +optional + // +listType=atomic + SpaceRoles []NSTemplateSetSpaceRole `json:"spaceRoles,omitempty"` + + // FeatureToggles holds the list of feature toggles/flags that were enabled when the NSTemplateSet CR was provisioned for the last time + // +optional + // +listType=atomic + FeatureToggles []string `json:"featureToggles,omitempty"` + // ProvisionedNamespaces is a list of Namespaces that were provisioned by the NSTemplateSet. // +optional // +listType=atomic diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 953a690f..91655c33 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1355,6 +1355,28 @@ func (in *NSTemplateSetSpec) DeepCopy() *NSTemplateSetSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NSTemplateSetStatus) DeepCopyInto(out *NSTemplateSetStatus) { *out = *in + if in.Namespaces != nil { + in, out := &in.Namespaces, &out.Namespaces + *out = make([]NSTemplateSetNamespace, len(*in)) + copy(*out, *in) + } + if in.ClusterResources != nil { + in, out := &in.ClusterResources, &out.ClusterResources + *out = new(NSTemplateSetClusterResources) + **out = **in + } + if in.SpaceRoles != nil { + in, out := &in.SpaceRoles, &out.SpaceRoles + *out = make([]NSTemplateSetSpaceRole, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FeatureToggles != nil { + in, out := &in.FeatureToggles, &out.FeatureToggles + *out = make([]string, len(*in)) + copy(*out, *in) + } if in.ProvisionedNamespaces != nil { in, out := &in.ProvisionedNamespaces, &out.ProvisionedNamespaces *out = make([]SpaceNamespace, len(*in)) diff --git a/api/v1alpha1/zz_generated.openapi.go b/api/v1alpha1/zz_generated.openapi.go index f093e96c..a76577df 100644 --- a/api/v1alpha1/zz_generated.openapi.go +++ b/api/v1alpha1/zz_generated.openapi.go @@ -1929,6 +1929,70 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetStatus(ref common. Description: "NSTemplateSetStatus defines the observed state of NSTemplateSet", Type: []string{"object"}, Properties: map[string]spec.Schema{ + "namespaces": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "The namespace templates that were used last time to provision NSTemplateSet CR", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetNamespace"), + }, + }, + }, + }, + }, + "clusterResources": { + SchemaProps: spec.SchemaProps{ + Description: "The cluster resources template (for cluster-wide quotas, etc.) that was used last time to provision the NSTemplateSet CR", + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetClusterResources"), + }, + }, + "spaceRoles": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "The SpaceRole template and the users to whom the template was applied for when the NSTemplateSet CR was provisioned for the last time", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetSpaceRole"), + }, + }, + }, + }, + }, + "featureToggles": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "FeatureToggles holds the list of feature toggles/flags that were enabled when the NSTemplateSet CR was provisioned for the last time", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, "provisionedNamespaces": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -1976,7 +2040,7 @@ func schema_codeready_toolchain_api_api_v1alpha1_NSTemplateSetStatus(ref common. }, }, Dependencies: []string{ - "github.com/codeready-toolchain/api/api/v1alpha1.Condition", "github.com/codeready-toolchain/api/api/v1alpha1.SpaceNamespace"}, + "github.com/codeready-toolchain/api/api/v1alpha1.Condition", "github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetClusterResources", "github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetNamespace", "github.com/codeready-toolchain/api/api/v1alpha1.NSTemplateSetSpaceRole", "github.com/codeready-toolchain/api/api/v1alpha1.SpaceNamespace"}, } }