diff --git a/apis/meta/v1alpha1/openapi_generated.go b/apis/meta/v1alpha1/openapi_generated.go index ef8712248..19ab7a1c1 100644 --- a/apis/meta/v1alpha1/openapi_generated.go +++ b/apis/meta/v1alpha1/openapi_generated.go @@ -349,6 +349,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceBlockDefinitionList": schema_resource_metadata_apis_meta_v1alpha1_ResourceBlockDefinitionList(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceBlockDefinitionSpec": schema_resource_metadata_apis_meta_v1alpha1_ResourceBlockDefinitionSpec(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceCalculator": schema_resource_metadata_apis_meta_v1alpha1_ResourceCalculator(ref), + "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceCalculatorRequest": schema_resource_metadata_apis_meta_v1alpha1_ResourceCalculatorRequest(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceCalculatorResponse": schema_resource_metadata_apis_meta_v1alpha1_ResourceCalculatorResponse(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceColumn": schema_resource_metadata_apis_meta_v1alpha1_ResourceColumn(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceColumnDefinition": schema_resource_metadata_apis_meta_v1alpha1_ResourceColumnDefinition(ref), @@ -16825,7 +16826,7 @@ func schema_resource_metadata_apis_meta_v1alpha1_ResourceCalculator(ref common.R }, "request": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + Ref: ref("kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceCalculatorRequest"), }, }, "response": { @@ -16837,7 +16838,32 @@ func schema_resource_metadata_apis_meta_v1alpha1_ResourceCalculator(ref common.R }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension", "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceCalculatorResponse"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceCalculatorRequest", "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ResourceCalculatorResponse"}, + } +} + +func schema_resource_metadata_apis_meta_v1alpha1_ResourceCalculatorRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "resource": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + "edit": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } diff --git a/apis/meta/v1alpha1/resourcecalculator_types.go b/apis/meta/v1alpha1/resourcecalculator_types.go index 71d83901a..1016d0fcb 100644 --- a/apis/meta/v1alpha1/resourcecalculator_types.go +++ b/apis/meta/v1alpha1/resourcecalculator_types.go @@ -42,11 +42,16 @@ type ResourceCalculator struct { metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:pruning:PreserveUnknownFields - Request *runtime.RawExtension `json:"request,omitempty"` + Request *ResourceCalculatorRequest `json:"request,omitempty"` // +optional Response *ResourceCalculatorResponse `json:"response,omitempty"` } +type ResourceCalculatorRequest struct { + Resource *runtime.RawExtension `json:"resource,omitempty"` + Edit bool `json:"edit,omitempty"` +} + type ResourceCalculatorResponse struct { APIType kmapi.ResourceID `json:"apiType"` // +optional diff --git a/apis/meta/v1alpha1/zz_generated.deepcopy.go b/apis/meta/v1alpha1/zz_generated.deepcopy.go index 18bbd6505..ea118ddc0 100644 --- a/apis/meta/v1alpha1/zz_generated.deepcopy.go +++ b/apis/meta/v1alpha1/zz_generated.deepcopy.go @@ -1332,7 +1332,7 @@ func (in *ResourceCalculator) DeepCopyInto(out *ResourceCalculator) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) if in.Request != nil { in, out := &in.Request, &out.Request - *out = new(runtime.RawExtension) + *out = new(ResourceCalculatorRequest) (*in).DeepCopyInto(*out) } if in.Response != nil { @@ -1361,6 +1361,27 @@ func (in *ResourceCalculator) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceCalculatorRequest) DeepCopyInto(out *ResourceCalculatorRequest) { + *out = *in + if in.Resource != nil { + in, out := &in.Resource, &out.Resource + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceCalculatorRequest. +func (in *ResourceCalculatorRequest) DeepCopy() *ResourceCalculatorRequest { + if in == nil { + return nil + } + out := new(ResourceCalculatorRequest) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceCalculatorResponse) DeepCopyInto(out *ResourceCalculatorResponse) { *out = *in diff --git a/crds/meta.k8s.appscode.com_resourcecalculators.yaml b/crds/meta.k8s.appscode.com_resourcecalculators.yaml index 2a796bd9f..a6d14ba8b 100644 --- a/crds/meta.k8s.appscode.com_resourcecalculators.yaml +++ b/crds/meta.k8s.appscode.com_resourcecalculators.yaml @@ -31,6 +31,12 @@ spec: metadata: type: object request: + properties: + edit: + type: boolean + resource: + type: object + x-kubernetes-preserve-unknown-fields: true type: object x-kubernetes-preserve-unknown-fields: true response: diff --git a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/clusterstatuses.yaml b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/clusterstatuses.yaml new file mode 100644 index 000000000..7cde9c868 --- /dev/null +++ b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/clusterstatuses.yaml @@ -0,0 +1,72 @@ +apiVersion: meta.k8s.appscode.com/v1alpha1 +kind: ResourceDescriptor +metadata: + creationTimestamp: null + labels: + k8s.io/group: meta.k8s.appscode.com + k8s.io/kind: ClusterStatus + k8s.io/resource: clusterstatuses + k8s.io/version: v1alpha1 + name: meta.k8s.appscode.com-v1alpha1-clusterstatuses +spec: + resource: + group: meta.k8s.appscode.com + kind: ClusterStatus + name: clusterstatuses + scope: Namespaced + version: v1alpha1 + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + properties: + name: + description: 'Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + type: object + response: + properties: + clusterAPI: + description: ClusterAPI contains capi cluster information if the cluster is created by cluster-api + properties: + clusterName: + type: string + namespace: + type: string + provider: + type: string + type: object + clusterManagers: + items: + type: string + type: array + message: + description: Message specifies additional information regarding the possible actions for the user + type: string + phase: + description: Phase represents current status of the cluster + type: string + reason: + description: Reason explains the reason behind the cluster current phase + type: string + type: object + type: object diff --git a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml index 93bf27eca..babfd2c95 100644 --- a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml +++ b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml @@ -44,6 +44,12 @@ spec: type: object type: object request: + properties: + edit: + type: boolean + resource: + type: object + x-kubernetes-preserve-unknown-fields: true type: object x-kubernetes-preserve-unknown-fields: true response: diff --git a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcelayouts.yaml b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcelayouts.yaml index 695b27786..62eaff782 100644 --- a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcelayouts.yaml +++ b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcelayouts.yaml @@ -1113,6 +1113,8 @@ spec: - sourceRef - version type: object + enforceQuota: + type: boolean flow: type: string icons: @@ -1137,6 +1139,7 @@ spec: operationId: type: string required: + - enforceQuota - flow - operationId type: object @@ -1175,6 +1178,8 @@ spec: - sourceRef - version type: object + enforceQuota: + type: boolean instanceLabelPaths: description: app.kubernetes.io/instance label must be updated at these paths when refilling metadata items: @@ -1208,6 +1213,8 @@ spec: - sourceRef - version type: object + required: + - enforceQuota type: object required: - defaultLayout diff --git a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceoutlines.yaml b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceoutlines.yaml index 1cb23ec5d..52426bed8 100644 --- a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceoutlines.yaml +++ b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourceoutlines.yaml @@ -85,6 +85,8 @@ spec: - sourceRef - version type: object + enforceQuota: + type: boolean flow: type: string icons: @@ -109,6 +111,7 @@ spec: operationId: type: string required: + - enforceQuota - flow - operationId type: object diff --git a/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/resourceeditors.yaml b/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/resourceeditors.yaml index 9b2abe992..40b9450f5 100644 --- a/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/resourceeditors.yaml +++ b/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/resourceeditors.yaml @@ -156,6 +156,8 @@ spec: - sourceRef - version type: object + enforceQuota: + type: boolean flow: type: string icons: @@ -180,6 +182,7 @@ spec: operationId: type: string required: + - enforceQuota - flow - operationId type: object @@ -218,6 +221,8 @@ spec: - sourceRef - version type: object + enforceQuota: + type: boolean instanceLabelPaths: description: app.kubernetes.io/instance label must be updated at these paths when refilling metadata items: @@ -251,6 +256,8 @@ spec: - sourceRef - version type: object + required: + - enforceQuota type: object variants: description: Kind == VendorChartPreset | ClusterChartPreset diff --git a/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/clusterstatuses.yaml b/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/clusterstatuses.yaml new file mode 100644 index 000000000..87f122bc6 --- /dev/null +++ b/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/clusterstatuses.yaml @@ -0,0 +1,17 @@ +apiVersion: ui.k8s.appscode.com/v1alpha1 +kind: ResourceEditor +metadata: + creationTimestamp: null + labels: + k8s.io/group: meta.k8s.appscode.com + k8s.io/kind: ClusterStatus + k8s.io/resource: clusterstatuses + k8s.io/version: v1alpha1 + name: meta.k8s.appscode.com-v1alpha1-clusterstatuses +spec: + resource: + group: meta.k8s.appscode.com + kind: ClusterStatus + name: clusterstatuses + scope: Namespaced + version: v1alpha1 diff --git a/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/clusterstatuses.yaml b/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/clusterstatuses.yaml new file mode 100644 index 000000000..78722bb9f --- /dev/null +++ b/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/clusterstatuses.yaml @@ -0,0 +1,18 @@ +apiVersion: meta.k8s.appscode.com/v1alpha1 +kind: ResourceTableDefinition +metadata: + creationTimestamp: null + labels: + k8s.io/group: meta.k8s.appscode.com + k8s.io/kind: ClusterStatus + k8s.io/resource: clusterstatuses + k8s.io/version: v1alpha1 + name: meta.k8s.appscode.com-v1alpha1-clusterstatuses +spec: + defaultView: true + resource: + group: meta.k8s.appscode.com + kind: ClusterStatus + name: clusterstatuses + scope: Namespaced + version: v1alpha1