From 4a8a16786c897f0a7c5e9c6bd17b20d6e0ea7113 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Thu, 19 Sep 2024 13:49:48 -0800 Subject: [PATCH] Disable features (#482) Signed-off-by: Tamal Saha --- apis/ui/v1alpha1/feature_types.go | 3 + apis/ui/v1alpha1/featureset_types.go | 3 + .../v1alpha1/genericresourceservices.yaml | 117 ++++++++++++++++++ .../v1alpha1/resourceblockdefinitions.yaml | 3 +- .../v1alpha1/resourcedescriptors.yaml | 6 +- .../v1alpha1/resourcelayouts.yaml | 15 +-- .../v1alpha1/resourceoutlines.yaml | 15 +-- .../v1alpha1/resourcedashboards.yaml | 3 +- 8 files changed, 137 insertions(+), 28 deletions(-) diff --git a/apis/ui/v1alpha1/feature_types.go b/apis/ui/v1alpha1/feature_types.go index e4f6f49d2..73d38e682 100644 --- a/apis/ui/v1alpha1/feature_types.go +++ b/apis/ui/v1alpha1/feature_types.go @@ -66,6 +66,9 @@ type FeatureSpec struct { // Required specifies whether this feature is mandatory or not for enabling the respecting FeatureSet. // +optional Recommended bool `json:"recommended,omitempty"` + // Disabled specify whether this feature set is disabled. + // +optional + Disabled bool `json:"disabled,omitempty"` // Requirements specifies the requirements to enable this feature. // +optional Requirements Requirements `json:"requirements,omitempty"` diff --git a/apis/ui/v1alpha1/featureset_types.go b/apis/ui/v1alpha1/featureset_types.go index 76269e94c..737a59d32 100644 --- a/apis/ui/v1alpha1/featureset_types.go +++ b/apis/ui/v1alpha1/featureset_types.go @@ -59,6 +59,9 @@ type FeatureSetSpec struct { // Required specify whether this feature set is mandatory or not for using the UI. // +optional Recommended bool `json:"recommended,omitempty"` + // Disabled specify whether this feature set is disabled. + // +optional + Disabled bool `json:"disabled,omitempty"` // RequiredFeatures specifies list of features that are necessary to consider this feature set as ready. // +optional RequiredFeatures []string `json:"requiredFeatures,omitempty"` diff --git a/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresourceservices.yaml b/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresourceservices.yaml index b2f2ea76e..e2957c577 100644 --- a/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresourceservices.yaml +++ b/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresourceservices.yaml @@ -250,6 +250,123 @@ spec: required: - usage type: object + gateway: + properties: + hostname: + type: string + ip: + type: string + name: + type: string + namespace: + type: string + services: + description: Services is an optional configuration for services + used to expose database + items: + properties: + alias: + description: Alias represents the identifier of the service. + type: string + ports: + items: + description: GatewayPort contains information on Gateway + service's port. + properties: + backendServicePort: + description: Number of the port to access the backend + service. + format: int32 + type: integer + name: + description: The name of this port within the gateway + service. + type: string + nodePort: + description: The port on each node on which this + gateway service is exposed when type is NodePort + or LoadBalancer. + format: int32 + type: integer + port: + description: The port that will be exposed by the + gateway service. + format: int32 + type: integer + required: + - port + type: object + type: array + required: + - alias + - ports + type: object + type: array + ui: + description: UI is an optional list of database web uis + items: + properties: + alias: + description: Alias represents the identifier of the service. + This should match the db ui chart name + type: string + helmRelease: + description: HelmRelease is the name of the helm release + used to deploy this ui The name format is typically + - + properties: + name: + default: "" + description: 'Name of the referent. This field is + effectively required, but due to backwards compatibility + is allowed to be empty. Instances of this type with + an empty value here are almost certainly wrong. + TODO: Add other useful fields. apiVersion, kind, + uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Drop `kubebuilder:default` when controller-gen + doesn''t need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.' + type: string + type: object + x-kubernetes-map-type: atomic + port: + description: GatewayPort contains information on Gateway + service's port. + properties: + backendServicePort: + description: Number of the port to access the backend + service. + format: int32 + type: integer + name: + description: The name of this port within the gateway + service. + type: string + nodePort: + description: The port on each node on which this gateway + service is exposed when type is NodePort or LoadBalancer. + format: int32 + type: integer + port: + description: The port that will be exposed by the + gateway service. + format: int32 + type: integer + required: + - port + type: object + url: + description: URL of the database ui + type: string + required: + - alias + - port + - url + type: object + type: array + required: + - name + - namespace + type: object monitoring: properties: refs: diff --git a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceblockdefinitions.yaml b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceblockdefinitions.yaml index 38c59f117..143d5adb2 100644 --- a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceblockdefinitions.yaml +++ b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceblockdefinitions.yaml @@ -115,7 +115,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -132,7 +132,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into diff --git a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcedescriptors.yaml b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcedescriptors.yaml index 40ac05223..c277f2443 100644 --- a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcedescriptors.yaml +++ b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcedescriptors.yaml @@ -68,7 +68,7 @@ spec: properties: labels: items: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -85,7 +85,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into @@ -230,7 +229,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -247,7 +246,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into diff --git a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcelayouts.yaml b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcelayouts.yaml index c08487691..13caee0ae 100644 --- a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcelayouts.yaml +++ b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcelayouts.yaml @@ -116,7 +116,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -133,7 +133,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into @@ -365,7 +364,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -382,7 +381,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into @@ -631,7 +629,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -648,7 +646,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into @@ -874,7 +871,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -891,7 +888,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into @@ -1153,7 +1149,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -1170,7 +1166,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into diff --git a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceoutlines.yaml b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceoutlines.yaml index 1df82930e..c6c3f9992 100644 --- a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceoutlines.yaml +++ b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceoutlines.yaml @@ -201,7 +201,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -218,7 +218,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into @@ -452,7 +451,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -469,7 +468,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into @@ -720,7 +718,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -737,7 +735,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into @@ -965,7 +962,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -982,7 +979,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into @@ -1246,7 +1242,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -1263,7 +1259,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into diff --git a/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/resourcedashboards.yaml b/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/resourcedashboards.yaml index 01588ca79..47acd63ec 100644 --- a/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/resourcedashboards.yaml +++ b/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/resourcedashboards.yaml @@ -67,7 +67,7 @@ spec: query: properties: byLabel: - description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view) + description: ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,policy,recommended_for,restore_into,scaled_by,source,storage,view) enum: - authn - authz @@ -84,7 +84,6 @@ spec: - ocm_bind - offshoot - ops - - placed_into - policy - recommended_for - restore_into