diff --git a/apis/core/v1alpha1/openapi_generated.go b/apis/core/v1alpha1/openapi_generated.go index 153f448cd..55467c4e6 100644 --- a/apis/core/v1alpha1/openapi_generated.go +++ b/apis/core/v1alpha1/openapi_generated.go @@ -336,6 +336,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.If": schema_kmodulesxyz_resource_metadata_apis_shared_If(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceQuery": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref), + "kmodules.xyz/resource-metadata/apis/shared.SourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameterTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameters": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameters(ref), } @@ -15858,7 +15859,7 @@ func schema_resource_metadata_apis_core_v1alpha1_ProjectSpec(ref common.Referenc Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/meta/v1alpha1.SourceLocator"), + Ref: ref("kmodules.xyz/resource-metadata/apis/shared.SourceLocator"), }, }, }, @@ -15868,7 +15869,7 @@ func schema_resource_metadata_apis_core_v1alpha1_ProjectSpec(ref common.Referenc }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "kmodules.xyz/resource-metadata/apis/core/v1alpha1.ProjectMonitoring", "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.SourceLocator"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "kmodules.xyz/resource-metadata/apis/core/v1alpha1.ProjectMonitoring", "kmodules.xyz/resource-metadata/apis/shared.SourceLocator"}, } } @@ -16619,6 +16620,32 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref common.R } } +func schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(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{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ResourceID"), + }, + }, + "ref": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ObjectReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.ResourceID"}, + } +} + func schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/apis/core/v1alpha1/project_types.go b/apis/core/v1alpha1/project_types.go index 5418a5416..149b545ed 100644 --- a/apis/core/v1alpha1/project_types.go +++ b/apis/core/v1alpha1/project_types.go @@ -18,7 +18,7 @@ package v1alpha1 import ( kmapi "kmodules.xyz/client-go/api/v1" - "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + "kmodules.xyz/resource-metadata/apis/shared" core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -33,11 +33,11 @@ const ( // ProjectSpec defines the desired state of Project type ProjectSpec struct { // +kubebuilder:default=User - Type ProjectType `json:"type,omitempty"` - Namespaces []string `json:"namespaces,omitempty"` - NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` - Monitoring *ProjectMonitoring `json:"monitoring,omitempty"` - Presets []v1alpha1.SourceLocator `json:"presets,omitempty"` + Type ProjectType `json:"type,omitempty"` + Namespaces []string `json:"namespaces,omitempty"` + NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` + Monitoring *ProjectMonitoring `json:"monitoring,omitempty"` + Presets []shared.SourceLocator `json:"presets,omitempty"` } type ProjectMonitoring struct { diff --git a/apis/core/v1alpha1/zz_generated.deepcopy.go b/apis/core/v1alpha1/zz_generated.deepcopy.go index 797a5dcfb..524398955 100644 --- a/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -23,7 +23,7 @@ package v1alpha1 import ( apiv1 "kmodules.xyz/client-go/api/v1" - metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + shared "kmodules.xyz/resource-metadata/apis/shared" api "kmodules.xyz/resource-metrics/api" v1 "k8s.io/api/core/v1" @@ -691,7 +691,7 @@ func (in *ProjectSpec) DeepCopyInto(out *ProjectSpec) { } if in.Presets != nil { in, out := &in.Presets, &out.Presets - *out = make([]metav1alpha1.SourceLocator, len(*in)) + *out = make([]shared.SourceLocator, len(*in)) copy(*out, *in) } return diff --git a/apis/management/v1alpha1/openapi_generated.go b/apis/management/v1alpha1/openapi_generated.go index f44590c87..3830bdb70 100644 --- a/apis/management/v1alpha1/openapi_generated.go +++ b/apis/management/v1alpha1/openapi_generated.go @@ -312,6 +312,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.If": schema_kmodulesxyz_resource_metadata_apis_shared_If(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceQuery": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref), + "kmodules.xyz/resource-metadata/apis/shared.SourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameterTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameters": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameters(ref), } @@ -15170,6 +15171,32 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref common.R } } +func schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(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{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ResourceID"), + }, + }, + "ref": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ObjectReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.ResourceID"}, + } +} + func schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/apis/meta/v1alpha1/openapi_generated.go b/apis/meta/v1alpha1/openapi_generated.go index 22ba8d107..56578dd4a 100644 --- a/apis/meta/v1alpha1/openapi_generated.go +++ b/apis/meta/v1alpha1/openapi_generated.go @@ -381,7 +381,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.SortDefinition": schema_resource_metadata_apis_meta_v1alpha1_SortDefinition(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.SortHeader": schema_resource_metadata_apis_meta_v1alpha1_SortHeader(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.SourceInfo": schema_resource_metadata_apis_meta_v1alpha1_SourceInfo(ref), - "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.SourceLocator": schema_resource_metadata_apis_meta_v1alpha1_SourceLocator(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.Table": schema_resource_metadata_apis_meta_v1alpha1_Table(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.TableCell": schema_resource_metadata_apis_meta_v1alpha1_TableCell(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.TableOptions": schema_resource_metadata_apis_meta_v1alpha1_TableOptions(ref), @@ -397,6 +396,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.If": schema_kmodulesxyz_resource_metadata_apis_shared_If(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceQuery": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref), + "kmodules.xyz/resource-metadata/apis/shared.SourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameterTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameters": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameters(ref), } @@ -16265,7 +16265,7 @@ func schema_resource_metadata_apis_meta_v1alpha1_RenderDashboardRequest(ref comm }, "sourceLocator": { SchemaProps: spec.SchemaProps{ - Ref: ref("kmodules.xyz/resource-metadata/apis/meta/v1alpha1.SourceLocator"), + Ref: ref("kmodules.xyz/resource-metadata/apis/shared.SourceLocator"), }, }, "name": { @@ -16284,7 +16284,7 @@ func schema_resource_metadata_apis_meta_v1alpha1_RenderDashboardRequest(ref comm }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.RawExtension", "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.SourceLocator"}, + "k8s.io/apimachinery/pkg/runtime.RawExtension", "kmodules.xyz/resource-metadata/apis/shared.SourceLocator"}, } } @@ -18512,32 +18512,6 @@ func schema_resource_metadata_apis_meta_v1alpha1_SourceInfo(ref common.Reference } } -func schema_resource_metadata_apis_meta_v1alpha1_SourceLocator(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{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/client-go/api/v1.ResourceID"), - }, - }, - "ref": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/client-go/api/v1.ObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.ResourceID"}, - } -} - func schema_resource_metadata_apis_meta_v1alpha1_Table(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -19157,6 +19131,32 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref common.R } } +func schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(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{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ResourceID"), + }, + }, + "ref": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ObjectReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.ResourceID"}, + } +} + func schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/apis/meta/v1alpha1/renderdashboard_types.go b/apis/meta/v1alpha1/renderdashboard_types.go index d6a8eec98..ce6b1dbf6 100644 --- a/apis/meta/v1alpha1/renderdashboard_types.go +++ b/apis/meta/v1alpha1/renderdashboard_types.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha1 import ( - kmapi "kmodules.xyz/client-go/api/v1" + "kmodules.xyz/resource-metadata/apis/shared" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -53,7 +53,7 @@ type RenderDashboardRequest struct { Source *runtime.RawExtension `json:"source,omitempty"` // +optional - SourceLocator *SourceLocator `json:"sourceLocator,omitempty"` + SourceLocator *shared.SourceLocator `json:"sourceLocator,omitempty"` // +optional Name string `json:"name,omitempty"` @@ -62,13 +62,6 @@ type RenderDashboardRequest struct { EmbeddedLink bool `json:"embeddedLink,omitempty"` } -type SourceLocator struct { - // +optional - Resource kmapi.ResourceID `json:"resource"` - // +optional - Ref kmapi.ObjectReference `json:"ref"` -} - type RenderDashboardResponse struct { Dashboards []DashboardResponse `json:"dashboards"` } diff --git a/apis/meta/v1alpha1/zz_generated.deepcopy.go b/apis/meta/v1alpha1/zz_generated.deepcopy.go index 6566126ee..33ebeddbb 100644 --- a/apis/meta/v1alpha1/zz_generated.deepcopy.go +++ b/apis/meta/v1alpha1/zz_generated.deepcopy.go @@ -940,7 +940,7 @@ func (in *RenderDashboardRequest) DeepCopyInto(out *RenderDashboardRequest) { } if in.SourceLocator != nil { in, out := &in.SourceLocator, &out.SourceLocator - *out = new(SourceLocator) + *out = new(shared.SourceLocator) **out = **in } return @@ -2357,24 +2357,6 @@ func (in *SourceInfo) DeepCopy() *SourceInfo { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SourceLocator) DeepCopyInto(out *SourceLocator) { - *out = *in - out.Resource = in.Resource - out.Ref = in.Ref - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceLocator. -func (in *SourceLocator) DeepCopy() *SourceLocator { - if in == nil { - return nil - } - out := new(SourceLocator) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Table) DeepCopyInto(out *Table) { *out = *in diff --git a/apis/shared/openapi_generated.go b/apis/shared/openapi_generated.go index 33e82bf49..089be6022 100644 --- a/apis/shared/openapi_generated.go +++ b/apis/shared/openapi_generated.go @@ -41,6 +41,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.If": schema_kmodulesxyz_resource_metadata_apis_shared_If(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceQuery": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref), + "kmodules.xyz/resource-metadata/apis/shared.SourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameterTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameters": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameters(ref), } @@ -481,6 +482,32 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref common.R } } +func schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(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{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ResourceID"), + }, + }, + "ref": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ObjectReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.ResourceID"}, + } +} + func schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/apis/shared/types.go b/apis/shared/types.go index 36b46132d..5459ef4da 100644 --- a/apis/shared/types.go +++ b/apis/shared/types.go @@ -24,6 +24,13 @@ import ( helmshared "x-helm.dev/apimachinery/apis/shared" ) +type SourceLocator struct { + // +optional + Resource kmapi.ResourceID `json:"resource"` + // +optional + Ref kmapi.ObjectReference `json:"ref"` +} + type DeploymentParameters struct { ProductID string `json:"productID,omitempty"` PlanID string `json:"planID,omitempty"` diff --git a/apis/shared/zz_generated.deepcopy.go b/apis/shared/zz_generated.deepcopy.go index af7ff6acf..f7f82bd53 100644 --- a/apis/shared/zz_generated.deepcopy.go +++ b/apis/shared/zz_generated.deepcopy.go @@ -267,6 +267,24 @@ func (in *ResourceQuery) DeepCopy() *ResourceQuery { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SourceLocator) DeepCopyInto(out *SourceLocator) { + *out = *in + out.Resource = in.Resource + out.Ref = in.Ref + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceLocator. +func (in *SourceLocator) DeepCopy() *SourceLocator { + if in == nil { + return nil + } + out := new(SourceLocator) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UIParameterTemplate) DeepCopyInto(out *UIParameterTemplate) { *out = *in diff --git a/apis/ui/v1alpha1/openapi_generated.go b/apis/ui/v1alpha1/openapi_generated.go index cc13b21e6..7718a6560 100644 --- a/apis/ui/v1alpha1/openapi_generated.go +++ b/apis/ui/v1alpha1/openapi_generated.go @@ -308,6 +308,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.If": schema_kmodulesxyz_resource_metadata_apis_shared_If(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.ResourceQuery": schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref), + "kmodules.xyz/resource-metadata/apis/shared.SourceLocator": schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameterTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.UIParameters": schema_kmodulesxyz_resource_metadata_apis_shared_UIParameters(ref), "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ActionTemplate": schema_resource_metadata_apis_ui_v1alpha1_ActionTemplate(ref), @@ -15037,6 +15038,32 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_ResourceQuery(ref common.R } } +func schema_kmodulesxyz_resource_metadata_apis_shared_SourceLocator(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{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ResourceID"), + }, + }, + "ref": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ObjectReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.ResourceID"}, + } +} + func schema_kmodulesxyz_resource_metadata_apis_shared_UIParameterTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/projects.yaml b/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/projects.yaml similarity index 98% rename from hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/projects.yaml rename to hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/projects.yaml index e852a32f9..8bea42a1f 100644 --- a/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/projects.yaml +++ b/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/projects.yaml @@ -3,14 +3,14 @@ kind: ResourceDescriptor metadata: creationTimestamp: null labels: - k8s.io/group: meta.k8s.appscode.com + k8s.io/group: core.k8s.appscode.com k8s.io/kind: Project k8s.io/resource: projects k8s.io/version: v1alpha1 - name: meta.k8s.appscode.com-v1alpha1-projects + name: core.k8s.appscode.com-v1alpha1-projects spec: resource: - group: meta.k8s.appscode.com + group: core.k8s.appscode.com kind: Project name: projects scope: Cluster diff --git a/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/resourcecalculators.yaml b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml similarity index 94% rename from hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/resourcecalculators.yaml rename to hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml index 090c151bf..93bf27eca 100644 --- a/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/resourcecalculators.yaml +++ b/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml @@ -3,14 +3,14 @@ kind: ResourceDescriptor metadata: creationTimestamp: null labels: - k8s.io/group: core.k8s.appscode.com + k8s.io/group: meta.k8s.appscode.com k8s.io/kind: ResourceCalculator k8s.io/resource: resourcecalculators k8s.io/version: v1alpha1 - name: core.k8s.appscode.com-v1alpha1-resourcecalculators + name: meta.k8s.appscode.com-v1alpha1-resourcecalculators spec: resource: - group: core.k8s.appscode.com + group: meta.k8s.appscode.com kind: ResourceCalculator name: resourcecalculators scope: Namespaced @@ -91,6 +91,20 @@ spec: type: object mode: type: string + quota: + properties: + decision: + enum: + - Allow + - Deny + type: string + violations: + items: + type: string + type: array + required: + - decision + type: object replicas: format: int64 type: integer @@ -147,5 +161,6 @@ spec: type: string required: - apiType + - quota type: object type: object diff --git a/hub/resourceeditors/core.k8s.appscode.com/v1alpha1/projects.yaml b/hub/resourceeditors/core.k8s.appscode.com/v1alpha1/projects.yaml new file mode 100644 index 000000000..67f31b30d --- /dev/null +++ b/hub/resourceeditors/core.k8s.appscode.com/v1alpha1/projects.yaml @@ -0,0 +1,17 @@ +apiVersion: ui.k8s.appscode.com/v1alpha1 +kind: ResourceEditor +metadata: + creationTimestamp: null + labels: + k8s.io/group: core.k8s.appscode.com + k8s.io/kind: Project + k8s.io/resource: projects + k8s.io/version: v1alpha1 + name: core.k8s.appscode.com-v1alpha1-projects +spec: + resource: + group: core.k8s.appscode.com + kind: Project + name: projects + scope: Cluster + version: v1alpha1 diff --git a/hub/resourceeditors/core.k8s.appscode.com/v1alpha1/resourcecalculators.yaml b/hub/resourceeditors/core.k8s.appscode.com/v1alpha1/resourcecalculators.yaml deleted file mode 100644 index b5c6cdfc9..000000000 --- a/hub/resourceeditors/core.k8s.appscode.com/v1alpha1/resourcecalculators.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: ui.k8s.appscode.com/v1alpha1 -kind: ResourceEditor -metadata: - creationTimestamp: null - labels: - k8s.io/group: core.k8s.appscode.com - k8s.io/kind: ResourceCalculator - k8s.io/resource: resourcecalculators - k8s.io/version: v1alpha1 - name: core.k8s.appscode.com-v1alpha1-resourcecalculators -spec: - resource: - group: core.k8s.appscode.com - kind: ResourceCalculator - name: resourcecalculators - scope: Namespaced - version: v1alpha1 - ui: - editor: - name: corek8sappscodecom-resourcecalculator-editor - sourceRef: - apiGroup: source.toolkit.fluxcd.io - kind: HelmRepository - name: bytebuilders-ui - version: v0.4.18 diff --git a/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/projects.yaml b/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/projects.yaml deleted file mode 100644 index ffafb0afe..000000000 --- a/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/projects.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: ui.k8s.appscode.com/v1alpha1 -kind: ResourceEditor -metadata: - creationTimestamp: null - labels: - k8s.io/group: meta.k8s.appscode.com - k8s.io/kind: Project - k8s.io/resource: projects - k8s.io/version: v1alpha1 - name: meta.k8s.appscode.com-v1alpha1-projects -spec: - resource: - group: meta.k8s.appscode.com - kind: Project - name: projects - scope: Cluster - version: v1alpha1 - ui: - editor: - name: metak8sappscodecom-project-editor - sourceRef: - apiGroup: source.toolkit.fluxcd.io - kind: HelmRepository - name: bytebuilders-ui - version: v0.4.18 diff --git a/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml b/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml new file mode 100644 index 000000000..49272aed7 --- /dev/null +++ b/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/resourcecalculators.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: ResourceCalculator + k8s.io/resource: resourcecalculators + k8s.io/version: v1alpha1 + name: meta.k8s.appscode.com-v1alpha1-resourcecalculators +spec: + resource: + group: meta.k8s.appscode.com + kind: ResourceCalculator + name: resourcecalculators + scope: Namespaced + version: v1alpha1 diff --git a/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/projects.yaml b/hub/resourcetabledefinitions/core.k8s.appscode.com/v1alpha1/projects.yaml similarity index 72% rename from hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/projects.yaml rename to hub/resourcetabledefinitions/core.k8s.appscode.com/v1alpha1/projects.yaml index 209fb8648..5676b6d5b 100644 --- a/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/projects.yaml +++ b/hub/resourcetabledefinitions/core.k8s.appscode.com/v1alpha1/projects.yaml @@ -3,15 +3,15 @@ kind: ResourceTableDefinition metadata: creationTimestamp: null labels: - k8s.io/group: meta.k8s.appscode.com + k8s.io/group: core.k8s.appscode.com k8s.io/kind: Project k8s.io/resource: projects k8s.io/version: v1alpha1 - name: meta.k8s.appscode.com-v1alpha1-projects + name: core.k8s.appscode.com-v1alpha1-projects spec: defaultView: true resource: - group: meta.k8s.appscode.com + group: core.k8s.appscode.com kind: Project name: projects scope: Cluster diff --git a/hub/resourcetabledefinitions/core.k8s.appscode.com/v1alpha1/resourcecalculators.yaml b/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml similarity index 73% rename from hub/resourcetabledefinitions/core.k8s.appscode.com/v1alpha1/resourcecalculators.yaml rename to hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml index be4f60beb..c57506dc9 100644 --- a/hub/resourcetabledefinitions/core.k8s.appscode.com/v1alpha1/resourcecalculators.yaml +++ b/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/resourcecalculators.yaml @@ -3,15 +3,15 @@ kind: ResourceTableDefinition metadata: creationTimestamp: null labels: - k8s.io/group: core.k8s.appscode.com + k8s.io/group: meta.k8s.appscode.com k8s.io/kind: ResourceCalculator k8s.io/resource: resourcecalculators k8s.io/version: v1alpha1 - name: core.k8s.appscode.com-v1alpha1-resourcecalculators + name: meta.k8s.appscode.com-v1alpha1-resourcecalculators spec: defaultView: true resource: - group: core.k8s.appscode.com + group: meta.k8s.appscode.com kind: ResourceCalculator name: resourcecalculators scope: Namespaced