diff --git a/go.mod b/go.mod index 40d438206c..57389158cb 100644 --- a/go.mod +++ b/go.mod @@ -45,12 +45,12 @@ require ( k8s.io/kube-state-metrics/v2 v2.12.0 kmodules.xyz/apiversion v0.2.0 kmodules.xyz/authorizer v0.29.1 - kmodules.xyz/client-go v0.30.26 + kmodules.xyz/client-go v0.30.27 kmodules.xyz/custom-resources v0.30.0 kmodules.xyz/go-containerregistry v0.0.12 kmodules.xyz/monitoring-agent-api v0.30.2-0.20241001043315-b98120efea48 kmodules.xyz/offshoot-api v0.30.1 - kmodules.xyz/resource-metadata v0.19.1-0.20241009104424-86c39a298ab6 + kmodules.xyz/resource-metadata v0.19.1-0.20241016073336-1307639922b4 kmodules.xyz/resource-metrics v0.30.4 kmodules.xyz/resource-metrics/utils v0.30.4 kmodules.xyz/sets v0.29.0 diff --git a/go.sum b/go.sum index 739c32ecac..1f35833aff 100644 --- a/go.sum +++ b/go.sum @@ -922,8 +922,8 @@ kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk= kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80= kmodules.xyz/authorizer v0.29.1 h1:uByGGoryKbZcfiEAhjcK/Y345I9mygNQP7DVpkMbNQQ= kmodules.xyz/authorizer v0.29.1/go.mod h1:kZRhclL8twzyt2bQuJQJbpYww2sc+qFr8I5PPoq/sWY= -kmodules.xyz/client-go v0.30.26 h1:cPoNid/Eq38EwznsZ27gu2AEXOjqcshn+/7kjlaaQNQ= -kmodules.xyz/client-go v0.30.26/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM= +kmodules.xyz/client-go v0.30.27 h1:pmM11k/XNVGTFp22qRsXBnGRnFeLNGX2lB9I0Gu+JWY= +kmodules.xyz/client-go v0.30.27/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM= kmodules.xyz/crd-schema-fuzz v0.29.1 h1:zJTlWYOrT5dsVVHW8HGcnR/vaWfxQfNh11QwTtkYpcs= kmodules.xyz/crd-schema-fuzz v0.29.1/go.mod h1:n708z9YQqLMP2KNLQVgBcRJw1QpSWLvpNCEi+KJDOYE= kmodules.xyz/custom-resources v0.30.0 h1:vR3CbseHMLwR4GvtcJJuRuwIV8voKqFqNii27rMcm1o= @@ -934,8 +934,8 @@ kmodules.xyz/monitoring-agent-api v0.30.2-0.20241001043315-b98120efea48 h1:kJdO7 kmodules.xyz/monitoring-agent-api v0.30.2-0.20241001043315-b98120efea48/go.mod h1:oR3tk5O4koYar4cD9N3AjbBFr9XTwBU3sw9qD2NdNQc= kmodules.xyz/offshoot-api v0.30.1 h1:TrulAYO+oBsXe9sZZGTmNWIuI8qD2izMpgcTSPvgAmI= kmodules.xyz/offshoot-api v0.30.1/go.mod h1:T3mpjR6fui0QzOcmQvIuANytW48fe9ytmy/1cgx6D4g= -kmodules.xyz/resource-metadata v0.19.1-0.20241009104424-86c39a298ab6 h1:Q9agV+WnOrF6SVBHLEq8EKvZzSE86yqLv3GQM6Mmw+c= -kmodules.xyz/resource-metadata v0.19.1-0.20241009104424-86c39a298ab6/go.mod h1:tDBwzcPFSiJpVFjOndSbCxliSI0kkg+5ingh5lLAxOU= +kmodules.xyz/resource-metadata v0.19.1-0.20241016073336-1307639922b4 h1:k8JQX4XDUU/ULvscjx5ENBb4qNJdWFMcf2V79c+LIcI= +kmodules.xyz/resource-metadata v0.19.1-0.20241016073336-1307639922b4/go.mod h1:ZVjgAj622Fp+8bdmAgHv6PNQHkXXqhR6aQpJg3lO8Bo= kmodules.xyz/resource-metrics v0.30.4 h1:8HBPtYmo9ETY91gsc55JE8Z986+3ZuRq57M0wZ9npqI= kmodules.xyz/resource-metrics v0.30.4/go.mod h1:w9+rz7/s/kGP1GWzYSuRdCn+l7EwpesmESSEHkLBnIQ= kmodules.xyz/resource-metrics/utils v0.30.4 h1:bJS/x0Qr7N1FFdxugFbzZ/Es6HVs4ptsFlhkmgj3jac= diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index 631c864c40..37bdf1c0b2 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -328,7 +328,7 @@ func (c completedConfig) New(ctx context.Context) (*UIServer, error) { v1alpha1storage[rsapi.ResourceResourceGraphs] = resourcegraph.NewStorage(ctrlClient) v1alpha1storage[rsapi.ResourceResourceLayouts] = resourcelayout.NewStorage(ctrlClient) v1alpha1storage[rsapi.ResourceResourceOutlines] = resourceoutline.NewStorage() - v1alpha1storage[rsapi.ResourceClusterProfiles] = clusterprofilestorage.NewStorage() + v1alpha1storage[uiapi.ResourceClusterProfiles] = clusterprofilestorage.NewStorage(ctrlClient) v1alpha1storage[uiapi.ResourceResourceEditors] = resourceeditor.NewStorage(ctrlClient) v1alpha1storage[rsapi.ResourceResourceQueries] = resourcequery.NewStorage(ctrlClient, rbacAuthorizer) v1alpha1storage[rsapi.ResourceResourceTableDefinitions] = resourcetabledefinition.NewStorage() diff --git a/pkg/cmds/server/start.go b/pkg/cmds/server/start.go index 79b78ddbda..0941c1e81f 100644 --- a/pkg/cmds/server/start.go +++ b/pkg/cmds/server/start.go @@ -142,7 +142,7 @@ func (o *UIServerOptions) Config() (*apiserver.Config, error) { fmt.Sprintf("/apis/%s/%s", rsapi.SchemeGroupVersion, "usermenus"), fmt.Sprintf("/apis/%s/%s", rsapi.SchemeGroupVersion, rsapi.ResourceChartPresetQueries), - fmt.Sprintf("/apis/%s/%s", rsapi.SchemeGroupVersion, rsapi.ResourceClusterProfiles), + fmt.Sprintf("/apis/%s/%s", rsapi.SchemeGroupVersion, uiapi.ResourceClusterProfiles), fmt.Sprintf("/apis/%s/%s", rsapi.SchemeGroupVersion, rsapi.ResourceClusterStatuses), fmt.Sprintf("/apis/%s/%s", rsapi.SchemeGroupVersion, rsapi.ResourceMenus), fmt.Sprintf("/apis/%s/%s", rsapi.SchemeGroupVersion, rsapi.ResourceRenderDashboards), diff --git a/pkg/registry/meta/clusterprofile/storage.go b/pkg/registry/meta/clusterprofile/storage.go index 385bce1234..232d5151b6 100644 --- a/pkg/registry/meta/clusterprofile/storage.go +++ b/pkg/registry/meta/clusterprofile/storage.go @@ -30,11 +30,13 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/registry/rest" "kmodules.xyz/resource-metadata/apis/meta" - rsapi "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + uiapi "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" "kmodules.xyz/resource-metadata/hub/clusterprofiles" + "sigs.k8s.io/controller-runtime/pkg/client" ) type Storage struct { + kc client.Reader convertor rest.TableConvertor } @@ -47,17 +49,18 @@ var ( _ rest.SingularNameProvider = &Storage{} ) -func NewStorage() *Storage { +func NewStorage(kc client.Reader) *Storage { return &Storage{ + kc: kc, convertor: rest.NewDefaultTableConvertor(schema.GroupResource{ - Group: rsapi.SchemeGroupVersion.Group, - Resource: rsapi.ResourceClusterProfiles, + Group: uiapi.SchemeGroupVersion.Group, + Resource: uiapi.ResourceClusterProfiles, }), } } func (r *Storage) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind { - return rsapi.SchemeGroupVersion.WithKind(rsapi.ResourceKindClusterProfile) + return uiapi.SchemeGroupVersion.WithKind(uiapi.ResourceKindClusterProfile) } func (r *Storage) NamespaceScoped() bool { @@ -65,27 +68,27 @@ func (r *Storage) NamespaceScoped() bool { } func (r *Storage) GetSingularName() string { - return strings.ToLower(rsapi.ResourceKindClusterProfile) + return strings.ToLower(uiapi.ResourceKindClusterProfile) } // Getter func (r *Storage) New() runtime.Object { - return &rsapi.ClusterProfile{} + return &uiapi.ClusterProfile{} } func (r *Storage) Destroy() {} func (r *Storage) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) { - obj, err := clusterprofiles.LoadByName(name) + obj, err := clusterprofiles.LoadByName(r.kc, name) if err != nil { - return nil, kerr.NewNotFound(schema.GroupResource{Group: meta.GroupName, Resource: rsapi.ResourceKindClusterProfile}, name) + return nil, kerr.NewNotFound(schema.GroupResource{Group: meta.GroupName, Resource: uiapi.ResourceKindClusterProfile}, name) } return obj, err } // Lister func (r *Storage) NewList() runtime.Object { - return &rsapi.ClusterProfileList{} + return &uiapi.ClusterProfileList{} } func (r *Storage) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error) { @@ -93,8 +96,10 @@ func (r *Storage) List(ctx context.Context, options *metainternalversion.ListOpt return nil, kerr.NewBadRequest("fieldSelector is not a supported") } - objs := clusterprofiles.List() - + objs, err := clusterprofiles.List(r.kc) + if err != nil { + return nil, err + } if options.Continue != "" { start, err := strconv.Atoi(options.Continue) if err != nil { @@ -109,7 +114,7 @@ func (r *Storage) List(ctx context.Context, options *metainternalversion.ListOpt objs = objs[:options.Limit] } - items := make([]rsapi.ClusterProfile, 0, len(objs)) + items := make([]uiapi.ClusterProfile, 0, len(objs)) for _, obj := range objs { if options.LabelSelector != nil && !options.LabelSelector.Matches(labels.Set(obj.GetLabels())) { continue @@ -117,7 +122,7 @@ func (r *Storage) List(ctx context.Context, options *metainternalversion.ListOpt items = append(items, obj) } - return &rsapi.ClusterProfileList{Items: items}, nil + return &uiapi.ClusterProfileList{Items: items}, nil } func (r *Storage) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { diff --git a/vendor/kmodules.xyz/client-go/cluster/ace.go b/vendor/kmodules.xyz/client-go/cluster/ace.go index 678847fc93..a1a149f112 100644 --- a/vendor/kmodules.xyz/client-go/cluster/ace.go +++ b/vendor/kmodules.xyz/client-go/cluster/ace.go @@ -24,7 +24,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ) -func IsACEManaged(kc client.Client) bool { +func IsACEManaged(kc client.Reader) bool { var list unstructured.UnstructuredList list.SetAPIVersion("apps/v1") list.SetKind("Deployment") diff --git a/vendor/kmodules.xyz/client-go/cluster/lib.go b/vendor/kmodules.xyz/client-go/cluster/lib.go index a5dc69c142..94d4695a84 100644 --- a/vendor/kmodules.xyz/client-go/cluster/lib.go +++ b/vendor/kmodules.xyz/client-go/cluster/lib.go @@ -157,7 +157,7 @@ func UpsertClusterMetadata(kc client.Client, md *kmapi.ClusterMetadata) error { return err } -func DetectCAPICluster(kc client.Client) (*kmapi.CAPIClusterInfo, error) { +func DetectCAPICluster(kc client.Reader) (*kmapi.CAPIClusterInfo, error) { var list unstructured.UnstructuredList list.SetGroupVersionKind(schema.GroupVersionKind{ Group: "cluster.x-k8s.io", diff --git a/vendor/kmodules.xyz/client-go/cluster/ocm.go b/vendor/kmodules.xyz/client-go/cluster/ocm.go index ff86a3ecc6..808eaabe79 100644 --- a/vendor/kmodules.xyz/client-go/cluster/ocm.go +++ b/vendor/kmodules.xyz/client-go/cluster/ocm.go @@ -35,7 +35,7 @@ func IsOpenClusterHub(mapper meta.RESTMapper) bool { return false } -func IsOpenClusterSpoke(kc client.Client) bool { +func IsOpenClusterSpoke(kc client.Reader) bool { var list unstructured.UnstructuredList list.SetAPIVersion("operator.open-cluster-management.io/v1") list.SetKind("Klusterlet") diff --git a/vendor/kmodules.xyz/client-go/cluster/rancher.go b/vendor/kmodules.xyz/client-go/cluster/rancher.go index 40a1355562..bea95e1fa8 100644 --- a/vendor/kmodules.xyz/client-go/cluster/rancher.go +++ b/vendor/kmodules.xyz/client-go/cluster/rancher.go @@ -129,15 +129,15 @@ func isInProject(kc client.Client, nsName, seedNS string) (bool, error) { return projectId == seedProjectId, nil } -func GetDefaultProjectId(kc client.Client) (string, bool, error) { +func GetDefaultProjectId(kc client.Reader) (string, bool, error) { return GetProjectId(kc, metav1.NamespaceDefault) } -func GetSystemProjectId(kc client.Client) (string, bool, error) { +func GetSystemProjectId(kc client.Reader) (string, bool, error) { return GetProjectId(kc, metav1.NamespaceSystem) } -func GetProjectId(kc client.Client, nsName string) (string, bool, error) { +func GetProjectId(kc client.Reader, nsName string) (string, bool, error) { var ns core.Namespace err := kc.Get(context.TODO(), client.ObjectKey{Name: nsName}, &ns) if err != nil { diff --git a/vendor/kmodules.xyz/client-go/cluster/vcluster.go b/vendor/kmodules.xyz/client-go/cluster/vcluster.go index 0e13240325..1348eff3b5 100644 --- a/vendor/kmodules.xyz/client-go/cluster/vcluster.go +++ b/vendor/kmodules.xyz/client-go/cluster/vcluster.go @@ -24,7 +24,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ) -func IsVirtualCluster(kc client.Client) (bool, error) { +func IsVirtualCluster(kc client.Reader) (bool, error) { var list core.NodeList err := kc.List(context.TODO(), &list) if err != nil { @@ -44,7 +44,7 @@ func IsVirtualCluster(kc client.Client) (bool, error) { return false, nil } -func MustIsVirtualCluster(kc client.Client) bool { +func MustIsVirtualCluster(kc client.Reader) bool { ok, _ := IsVirtualCluster(kc) return ok } diff --git a/vendor/kmodules.xyz/resource-metadata/apis/core/v1alpha1/openapi_generated.go b/vendor/kmodules.xyz/resource-metadata/apis/core/v1alpha1/openapi_generated.go index dd5f52ca86..d01dfd2bbe 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/core/v1alpha1/openapi_generated.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/core/v1alpha1/openapi_generated.go @@ -16236,7 +16236,7 @@ func schema_kmodulesxyz_client_go_api_v1_CertificateSpec(ref common.ReferenceCal }, "renewBefore": { SchemaProps: spec.SchemaProps{ - Description: "Certificate renew before expiration duration", + Description: "Certificate renew before expiration duration\n\nDeprecated use `ReconfigureTLS` type OpsRequest instead.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), }, }, @@ -16352,8 +16352,7 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterInfo(ref common.ReferenceCallbac }, "capi": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), + Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), }, }, }, diff --git a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/openapi_generated.go b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/openapi_generated.go index a7b3ea27e1..0d2588d2cf 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/openapi_generated.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/openapi_generated.go @@ -16227,7 +16227,7 @@ func schema_kmodulesxyz_client_go_api_v1_CertificateSpec(ref common.ReferenceCal }, "renewBefore": { SchemaProps: spec.SchemaProps{ - Description: "Certificate renew before expiration duration", + Description: "Certificate renew before expiration duration\n\nDeprecated use `ReconfigureTLS` type OpsRequest instead.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), }, }, @@ -16343,8 +16343,7 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterInfo(ref common.ReferenceCallbac }, "capi": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), + Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), }, }, }, diff --git a/vendor/kmodules.xyz/resource-metadata/apis/management/v1alpha1/openapi_generated.go b/vendor/kmodules.xyz/resource-metadata/apis/management/v1alpha1/openapi_generated.go index 4c5d8f3d78..50cf19dbcb 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/management/v1alpha1/openapi_generated.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/management/v1alpha1/openapi_generated.go @@ -16216,7 +16216,7 @@ func schema_kmodulesxyz_client_go_api_v1_CertificateSpec(ref common.ReferenceCal }, "renewBefore": { SchemaProps: spec.SchemaProps{ - Description: "Certificate renew before expiration duration", + Description: "Certificate renew before expiration duration\n\nDeprecated use `ReconfigureTLS` type OpsRequest instead.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), }, }, @@ -16332,8 +16332,7 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterInfo(ref common.ReferenceCallbac }, "capi": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), + Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), }, }, }, diff --git a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/openapi_generated.go b/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/openapi_generated.go index 00643b0e37..ab31320688 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/openapi_generated.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/openapi_generated.go @@ -357,9 +357,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/offshoot-api/api/v1.VolumeSource": schema_kmodulesxyz_offshoot_api_api_v1_VolumeSource(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.AttributeDefinition": schema_resource_metadata_apis_meta_v1alpha1_AttributeDefinition(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ChartPresetQuery": schema_resource_metadata_apis_meta_v1alpha1_ChartPresetQuery(ref), - "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ClusterProfile": schema_resource_metadata_apis_meta_v1alpha1_ClusterProfile(ref), - "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ClusterProfileList": schema_resource_metadata_apis_meta_v1alpha1_ClusterProfileList(ref), - "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ClusterProfileSpec": schema_resource_metadata_apis_meta_v1alpha1_ClusterProfileSpec(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ClusterStatus": schema_resource_metadata_apis_meta_v1alpha1_ClusterStatus(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ClusterStatusResponse": schema_resource_metadata_apis_meta_v1alpha1_ClusterStatusResponse(ref), "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ColorDefinition": schema_resource_metadata_apis_meta_v1alpha1_ColorDefinition(ref), @@ -16306,7 +16303,7 @@ func schema_kmodulesxyz_client_go_api_v1_CertificateSpec(ref common.ReferenceCal }, "renewBefore": { SchemaProps: spec.SchemaProps{ - Description: "Certificate renew before expiration duration", + Description: "Certificate renew before expiration duration\n\nDeprecated use `ReconfigureTLS` type OpsRequest instead.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), }, }, @@ -16422,8 +16419,7 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterInfo(ref common.ReferenceCallbac }, "capi": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), + Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), }, }, }, @@ -18891,151 +18887,6 @@ func schema_resource_metadata_apis_meta_v1alpha1_ChartPresetQuery(ref common.Ref } } -func schema_resource_metadata_apis_meta_v1alpha1_ClusterProfile(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - 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{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - 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{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ClusterProfileSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ClusterProfileSpec"}, - } -} - -func schema_resource_metadata_apis_meta_v1alpha1_ClusterProfileList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClusterProfileList contains a list of ClusterProfile", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - 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{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - 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{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ClusterProfile"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kmodules.xyz/resource-metadata/apis/meta/v1alpha1.ClusterProfile"}, - } -} - -func schema_resource_metadata_apis_meta_v1alpha1_ClusterProfileSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClusterProfileSpec defines the desired state of ClusterProfile", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "title": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "provider": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "requiredFeatureSets": { - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - }, - Required: []string{"title", "description"}, - }, - }, - } -} - func schema_resource_metadata_apis_meta_v1alpha1_ClusterStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/register.go b/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/register.go index 30a8cb7acb..1141f71e28 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/register.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/register.go @@ -50,8 +50,6 @@ func Resource(resource string) schema.GroupResource { func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &ChartPresetQuery{}, - &ClusterProfile{}, - &ClusterProfileList{}, &ClusterStatus{}, &ResourceCalculator{}, &ResourceDescriptor{}, diff --git a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/zz_generated.deepcopy.go b/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/zz_generated.deepcopy.go index 61c6504a86..25268f1600 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/zz_generated.deepcopy.go @@ -89,97 +89,6 @@ func (in *ChartPresetQuery) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterProfile) DeepCopyInto(out *ClusterProfile) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfile. -func (in *ClusterProfile) DeepCopy() *ClusterProfile { - if in == nil { - return nil - } - out := new(ClusterProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterProfile) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterProfileList) DeepCopyInto(out *ClusterProfileList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterProfile, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfileList. -func (in *ClusterProfileList) DeepCopy() *ClusterProfileList { - if in == nil { - return nil - } - out := new(ClusterProfileList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterProfileList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterProfileSpec) DeepCopyInto(out *ClusterProfileSpec) { - *out = *in - if in.RequiredFeatureSets != nil { - in, out := &in.RequiredFeatureSets, &out.RequiredFeatureSets - *out = make(map[string]FeatureList, len(*in)) - for key, val := range *in { - var outVal []string - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = make(FeatureList, len(*in)) - copy(*out, *in) - } - (*out)[key] = outVal - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfileSpec. -func (in *ClusterProfileSpec) DeepCopy() *ClusterProfileSpec { - if in == nil { - return nil - } - out := new(ClusterProfileSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { *out = *in diff --git a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/clusterprofile_types.go b/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/clusterprofile_types.go similarity index 86% rename from vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/clusterprofile_types.go rename to vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/clusterprofile_types.go index c2796ef5d0..a687c7b8c4 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/clusterprofile_types.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/clusterprofile_types.go @@ -28,12 +28,14 @@ const ( // ClusterProfileSpec defines the desired state of ClusterProfile type ClusterProfileSpec struct { - Title string `json:"title"` - Description string `json:"description"` - Provider string `json:"provider,omitempty"` - RequiredFeatureSets map[string]FeatureList `json:"requiredFeatureSets,omitempty"` + Title string `json:"title"` + Description string `json:"description"` + Provider string `json:"provider,omitempty"` + RequiredFeatureSets map[string]Features `json:"requiredFeatureSets,omitempty"` } +type Features []string + // ClusterProfile is the Schema for the clusterprofiles API // +genclient diff --git a/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/openapi_generated.go b/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/openapi_generated.go index f927d1af84..d1ebb30d04 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/openapi_generated.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/openapi_generated.go @@ -379,6 +379,9 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ActionTemplate": schema_resource_metadata_apis_ui_v1alpha1_ActionTemplate(ref), "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ActionTemplateGroup": schema_resource_metadata_apis_ui_v1alpha1_ActionTemplateGroup(ref), "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ChartInfo": schema_resource_metadata_apis_ui_v1alpha1_ChartInfo(ref), + "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ClusterProfile": schema_resource_metadata_apis_ui_v1alpha1_ClusterProfile(ref), + "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ClusterProfileList": schema_resource_metadata_apis_ui_v1alpha1_ClusterProfileList(ref), + "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ClusterProfileSpec": schema_resource_metadata_apis_ui_v1alpha1_ClusterProfileSpec(ref), "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ComponentStatus": schema_resource_metadata_apis_ui_v1alpha1_ComponentStatus(ref), "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.Dashboard": schema_resource_metadata_apis_ui_v1alpha1_Dashboard(ref), "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.DependentFeatureSet": schema_resource_metadata_apis_ui_v1alpha1_DependentFeatureSet(ref), @@ -16238,7 +16241,7 @@ func schema_kmodulesxyz_client_go_api_v1_CertificateSpec(ref common.ReferenceCal }, "renewBefore": { SchemaProps: spec.SchemaProps{ - Description: "Certificate renew before expiration duration", + Description: "Certificate renew before expiration duration\n\nDeprecated use `ReconfigureTLS` type OpsRequest instead.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), }, }, @@ -16354,8 +16357,7 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterInfo(ref common.ReferenceCallbac }, "capi": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), + Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), }, }, }, @@ -19834,6 +19836,151 @@ func schema_resource_metadata_apis_ui_v1alpha1_ChartInfo(ref common.ReferenceCal } } +func schema_resource_metadata_apis_ui_v1alpha1_ClusterProfile(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ClusterProfileSpec"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ClusterProfileSpec"}, + } +} + +func schema_resource_metadata_apis_ui_v1alpha1_ClusterProfileList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterProfileList contains a list of ClusterProfile", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ClusterProfile"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kmodules.xyz/resource-metadata/apis/ui/v1alpha1.ClusterProfile"}, + } +} + +func schema_resource_metadata_apis_ui_v1alpha1_ClusterProfileSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterProfileSpec defines the desired state of ClusterProfile", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "title": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "description": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "provider": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "requiredFeatureSets": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + }, + Required: []string{"title", "description"}, + }, + }, + } +} + func schema_resource_metadata_apis_ui_v1alpha1_ComponentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/register.go b/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/register.go index 8c42fe15ac..1b25f7db96 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/register.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/register.go @@ -49,14 +49,16 @@ func Resource(resource string) schema.GroupResource { // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &ResourceEditor{}, - &ResourceEditorList{}, - &ResourceDashboard{}, - &ResourceDashboardList{}, + &ClusterProfile{}, + &ClusterProfileList{}, &Feature{}, &FeatureList{}, - &FeatureSet{}, &FeatureSetList{}, + &FeatureSet{}, + &ResourceDashboard{}, + &ResourceDashboardList{}, + &ResourceEditor{}, + &ResourceEditorList{}, ) scheme.AddKnownTypes(SchemeGroupVersion, diff --git a/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/zz_generated.deepcopy.go b/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/zz_generated.deepcopy.go index dcbc370882..d00920bd5b 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/ui/v1alpha1/zz_generated.deepcopy.go @@ -104,6 +104,97 @@ func (in *ChartInfo) DeepCopy() *ChartInfo { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterProfile) DeepCopyInto(out *ClusterProfile) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfile. +func (in *ClusterProfile) DeepCopy() *ClusterProfile { + if in == nil { + return nil + } + out := new(ClusterProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterProfile) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterProfileList) DeepCopyInto(out *ClusterProfileList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterProfile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfileList. +func (in *ClusterProfileList) DeepCopy() *ClusterProfileList { + if in == nil { + return nil + } + out := new(ClusterProfileList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterProfileList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterProfileSpec) DeepCopyInto(out *ClusterProfileSpec) { + *out = *in + if in.RequiredFeatureSets != nil { + in, out := &in.RequiredFeatureSets, &out.RequiredFeatureSets + *out = make(map[string]Features, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make(Features, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProfileSpec. +func (in *ClusterProfileSpec) DeepCopy() *ClusterProfileSpec { + if in == nil { + return nil + } + out := new(ClusterProfileSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ComponentStatus) DeepCopyInto(out *ComponentStatus) { *out = *in @@ -458,6 +549,26 @@ func (in *FeatureStatus) DeepCopy() *FeatureStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Features) DeepCopyInto(out *Features) { + { + in := &in + *out = make(Features, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Features. +func (in Features) DeepCopy() Features { + if in == nil { + return nil + } + out := new(Features) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PanelLinkRequest) DeepCopyInto(out *PanelLinkRequest) { *out = *in diff --git a/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresources.yaml b/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresources.yaml index 9e66496cf3..42224dcfc3 100644 --- a/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresources.yaml +++ b/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresources.yaml @@ -119,18 +119,17 @@ spec: type: string provider: enum: - - Aws - - Azure + - AKS - DigitalOcean - - GoogleCloud + - EKS + - Exoscale + - Generic + - GKE - Linode - Packet + - Rancher - Scaleway - Vultr - - BareMetal - - KIND - - Generic - - Private type: string uid: type: string diff --git a/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresourceservices.yaml b/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresourceservices.yaml index 70c8746e5c..47a77c5925 100644 --- a/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresourceservices.yaml +++ b/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresourceservices.yaml @@ -71,18 +71,17 @@ spec: type: string provider: enum: - - Aws - - Azure + - AKS - DigitalOcean - - GoogleCloud + - EKS + - Exoscale + - Generic + - GKE - Linode - Packet + - Rancher - Scaleway - Vultr - - BareMetal - - KIND - - Generic - - Private type: string uid: type: string diff --git a/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_resourcesummaries.yaml b/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_resourcesummaries.yaml index e9b5b7317e..6bd8b36aba 100644 --- a/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_resourcesummaries.yaml +++ b/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_resourcesummaries.yaml @@ -119,18 +119,17 @@ spec: type: string provider: enum: - - Aws - - Azure + - AKS - DigitalOcean - - GoogleCloud + - EKS + - Exoscale + - Generic + - GKE - Linode - Packet + - Rancher - Scaleway - Vultr - - BareMetal - - KIND - - Generic - - Private type: string uid: type: string diff --git a/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_clusteridentitys.yaml b/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_clusteridentitys.yaml index 8315c19e59..c591f0c41e 100644 --- a/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_clusteridentitys.yaml +++ b/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_clusteridentitys.yaml @@ -53,18 +53,17 @@ spec: type: string provider: enum: - - Aws - - Azure + - AKS - DigitalOcean - - GoogleCloud + - EKS + - Exoscale + - Generic + - GKE - Linode - Packet + - Rancher - Scaleway - Vultr - - BareMetal - - KIND - - Generic - - Private type: string uid: type: string diff --git a/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_siteinfos.yaml b/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_siteinfos.yaml index 5415cf5b86..80f1faa45b 100644 --- a/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_siteinfos.yaml +++ b/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_siteinfos.yaml @@ -50,18 +50,17 @@ spec: type: string provider: enum: - - Aws - - Azure + - AKS - DigitalOcean - - GoogleCloud + - EKS + - Exoscale + - Generic + - GKE - Linode - Packet + - Rancher - Scaleway - Vultr - - BareMetal - - KIND - - Generic - - Private type: string uid: type: string diff --git a/vendor/kmodules.xyz/resource-metadata/crds/meta.k8s.appscode.com_clusterprofiles.yaml b/vendor/kmodules.xyz/resource-metadata/crds/ui.k8s.appscode.com_clusterprofiles.yaml similarity index 96% rename from vendor/kmodules.xyz/resource-metadata/crds/meta.k8s.appscode.com_clusterprofiles.yaml rename to vendor/kmodules.xyz/resource-metadata/crds/ui.k8s.appscode.com_clusterprofiles.yaml index ce427e85c2..aee0a38ec1 100644 --- a/vendor/kmodules.xyz/resource-metadata/crds/meta.k8s.appscode.com_clusterprofiles.yaml +++ b/vendor/kmodules.xyz/resource-metadata/crds/ui.k8s.appscode.com_clusterprofiles.yaml @@ -4,9 +4,9 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null - name: clusterprofiles.meta.k8s.appscode.com + name: clusterprofiles.ui.k8s.appscode.com spec: - group: meta.k8s.appscode.com + group: ui.k8s.appscode.com names: kind: ClusterProfile listKind: ClusterProfileList diff --git a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-aks.yaml b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-aks.yaml index 70c0553c9e..43f14e37b2 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-aks.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-aks.yaml @@ -1,4 +1,4 @@ -apiVersion: meta.k8s.appscode.com/v1alpha1 +apiVersion: ui.k8s.appscode.com/v1alpha1 kind: ClusterProfile metadata: creationTimestamp: null diff --git a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-eks.yaml b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-eks.yaml index e72cfdd904..8b48aff5e6 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-eks.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-eks.yaml @@ -1,4 +1,4 @@ -apiVersion: meta.k8s.appscode.com/v1alpha1 +apiVersion: ui.k8s.appscode.com/v1alpha1 kind: ClusterProfile metadata: creationTimestamp: null @@ -8,7 +8,6 @@ spec: provider: eks requiredFeatureSets: capi-capa: - - capa-vpc-peering-operator - cluster-autoscaler capi-core: - cluster-presets diff --git a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-generic.yaml b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-generic.yaml index d8b63ca685..e644f0f403 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-generic.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-generic.yaml @@ -1,4 +1,4 @@ -apiVersion: meta.k8s.appscode.com/v1alpha1 +apiVersion: ui.k8s.appscode.com/v1alpha1 kind: ClusterProfile metadata: creationTimestamp: null diff --git a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-gke.yaml b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-gke.yaml index 41f1c86805..3f3b3f3056 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-gke.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/dbaas-gke.yaml @@ -1,4 +1,4 @@ -apiVersion: meta.k8s.appscode.com/v1alpha1 +apiVersion: ui.k8s.appscode.com/v1alpha1 kind: ClusterProfile metadata: creationTimestamp: null diff --git a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/generic.yaml b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/generic.yaml index 94a6090674..f2873fe7f7 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/generic.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/ace/generic.yaml @@ -1,4 +1,4 @@ -apiVersion: meta.k8s.appscode.com/v1alpha1 +apiVersion: ui.k8s.appscode.com/v1alpha1 kind: ClusterProfile metadata: creationTimestamp: null diff --git a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/lib.go b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/lib.go index 9b4099831d..4915399448 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/lib.go +++ b/vendor/kmodules.xyz/resource-metadata/hub/clusterprofiles/lib.go @@ -17,6 +17,7 @@ limitations under the License. package clusterprofiles import ( + "context" "embed" iofs "io/fs" "path/filepath" @@ -24,11 +25,13 @@ import ( "sort" "sync" - "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" "github.com/pkg/errors" ioutilx "gomodules.xyz/x/ioutil" apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" ) @@ -37,13 +40,13 @@ var ( fs embed.FS m sync.Mutex - moMap map[string]*v1alpha1.ClusterProfile + cpMap map[string]*v1alpha1.ClusterProfile loader = ioutilx.NewReloader( filepath.Join("/tmp", "hub", "clusterprofiles"), fs, func(fsys iofs.FS) { - moMap = map[string]*v1alpha1.ClusterProfile{} + cpMap = map[string]*v1alpha1.ClusterProfile{} if err := iofs.WalkDir(fsys, ".", func(path string, d iofs.DirEntry, err error) error { if d.IsDir() || err != nil { @@ -63,7 +66,7 @@ var ( if err != nil { return errors.Wrap(err, path) } - moMap[obj.Name] = &obj + cpMap[obj.Name] = &obj return nil }); err != nil { panic(errors.Wrapf(err, "failed to load %s", reflect.TypeOf(v1alpha1.ClusterProfile{}))) @@ -80,41 +83,66 @@ func EmbeddedFS() iofs.FS { return fs } -func LoadByName(name string) (*v1alpha1.ClusterProfile, error) { +func LoadInternalByName(name string) (*v1alpha1.ClusterProfile, error) { m.Lock() defer m.Unlock() loader.ReloadIfTriggered() - if obj, ok := moMap[name]; ok { + if obj, ok := cpMap[name]; ok { return obj, nil } return nil, apierrors.NewNotFound(v1alpha1.Resource(v1alpha1.ResourceKindClusterProfile), name) } -func List() []v1alpha1.ClusterProfile { +func LoadByName(kc client.Reader, name string) (*v1alpha1.ClusterProfile, error) { + var ed v1alpha1.ClusterProfile + err := kc.Get(context.TODO(), client.ObjectKey{Name: name}, &ed) + if meta.IsNoMatchError(err) || apierrors.IsNotFound(err) { + return LoadInternalByName(name) + } else if err != nil { + return nil, err + } + return &ed, nil +} + +func List(kc client.Reader) ([]v1alpha1.ClusterProfile, error) { m.Lock() defer m.Unlock() loader.ReloadIfTriggered() - out := make([]v1alpha1.ClusterProfile, 0, len(moMap)) - for _, rl := range moMap { - out = append(out, *rl) + var list v1alpha1.ClusterProfileList + err := kc.List(context.TODO(), &list) + if err != nil && !(meta.IsNoMatchError(err) || apierrors.IsNotFound(err)) { + return nil, err + } + + profiles := map[string]v1alpha1.ClusterProfile{} + for name, cp := range cpMap { + profiles[name] = *cp + } + for _, obj := range list.Items { + profiles[obj.Name] = obj + } + + out := make([]v1alpha1.ClusterProfile, 0, len(profiles)) + for _, cp := range profiles { + out = append(out, cp) } sort.Slice(out, func(i, j int) bool { return out[i].Name < out[j].Name }) - return out + return out, nil } -func Names() []string { - m.Lock() - defer m.Unlock() - loader.ReloadIfTriggered() +func Names(kc client.Reader) ([]string, error) { + list, err := List(kc) + if err != nil { + return nil, err + } - out := make([]string, 0, len(moMap)) - for name := range moMap { - out = append(out, name) + out := make([]string, 0, len(list)) + for _, obj := range list { + out = append(out, obj.Name) } - sort.Strings(out) - return out + return out, nil } diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresources.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresources.yaml index cf9f96f20c..b391a1edb0 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresources.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresources.yaml @@ -148,18 +148,17 @@ spec: type: string provider: enum: - - Aws - - Azure + - AKS - DigitalOcean - - GoogleCloud + - EKS + - Exoscale + - Generic + - GKE - Linode - Packet + - Rancher - Scaleway - Vultr - - BareMetal - - KIND - - Generic - - Private type: string uid: type: string diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresourceservices.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresourceservices.yaml index e2957c577c..577b1d080b 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresourceservices.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/genericresourceservices.yaml @@ -102,18 +102,17 @@ spec: type: string provider: enum: - - Aws - - Azure + - AKS - DigitalOcean - - GoogleCloud + - EKS + - Exoscale + - Generic + - GKE - Linode - Packet + - Rancher - Scaleway - Vultr - - BareMetal - - KIND - - Generic - - Private type: string uid: type: string diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/resourcesummaries.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/resourcesummaries.yaml index eefab8db56..e4c5da0017 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/resourcesummaries.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/core.k8s.appscode.com/v1alpha1/resourcesummaries.yaml @@ -148,18 +148,17 @@ spec: type: string provider: enum: - - Aws - - Azure + - AKS - DigitalOcean - - GoogleCloud + - EKS + - Exoscale + - Generic + - GKE - Linode - Packet + - Rancher - Scaleway - Vultr - - BareMetal - - KIND - - Generic - - Private type: string uid: type: string diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/identity.k8s.appscode.com/v1alpha1/siteinfos.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/identity.k8s.appscode.com/v1alpha1/siteinfos.yaml index d91b103a9e..b9282b0f1a 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/identity.k8s.appscode.com/v1alpha1/siteinfos.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/identity.k8s.appscode.com/v1alpha1/siteinfos.yaml @@ -46,18 +46,17 @@ spec: type: string provider: enum: - - Aws - - Azure + - AKS - DigitalOcean - - GoogleCloud + - EKS + - Exoscale + - Generic + - GKE - Linode - Packet + - Rancher - Scaleway - Vultr - - BareMetal - - KIND - - Generic - - Private type: string uid: type: string diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/clusterprofiles.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/clusterprofiles.yaml similarity index 96% rename from vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/clusterprofiles.yaml rename to vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/clusterprofiles.yaml index dd12d7dd8f..7cebe6ff1f 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/meta.k8s.appscode.com/v1alpha1/clusterprofiles.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourcedescriptors/ui.k8s.appscode.com/v1alpha1/clusterprofiles.yaml @@ -3,14 +3,14 @@ kind: ResourceDescriptor metadata: creationTimestamp: null labels: - k8s.io/group: meta.k8s.appscode.com + k8s.io/group: ui.k8s.appscode.com k8s.io/kind: ClusterProfile k8s.io/resource: clusterprofiles k8s.io/version: v1alpha1 - name: meta.k8s.appscode.com-v1alpha1-clusterprofiles + name: ui.k8s.appscode.com-v1alpha1-clusterprofiles spec: resource: - group: meta.k8s.appscode.com + group: ui.k8s.appscode.com kind: ClusterProfile name: clusterprofiles scope: Cluster diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/clusterprofiles.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/clusterprofiles.yaml deleted file mode 100644 index ab2ca89faa..0000000000 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourceeditors/meta.k8s.appscode.com/v1alpha1/clusterprofiles.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: ui.k8s.appscode.com/v1alpha1 -kind: ResourceEditor -metadata: - creationTimestamp: null - labels: - k8s.io/group: meta.k8s.appscode.com - k8s.io/kind: ClusterProfile - k8s.io/resource: clusterprofiles - k8s.io/version: v1alpha1 - name: meta.k8s.appscode.com-v1alpha1-clusterprofiles -spec: - resource: - group: meta.k8s.appscode.com - kind: ClusterProfile - name: clusterprofiles - scope: Cluster - version: v1alpha1 - ui: - editor: - name: metak8sappscodecom-clusterprofile-editor - sourceRef: - apiGroup: source.toolkit.fluxcd.io - kind: HelmRepository - name: appscode-charts-oci - version: v0.7.0 - enforceQuota: false diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourceeditors/ui.k8s.appscode.com/v1alpha1/clusterprofiles.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourceeditors/ui.k8s.appscode.com/v1alpha1/clusterprofiles.yaml new file mode 100644 index 0000000000..c4d9348c85 --- /dev/null +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourceeditors/ui.k8s.appscode.com/v1alpha1/clusterprofiles.yaml @@ -0,0 +1,17 @@ +apiVersion: ui.k8s.appscode.com/v1alpha1 +kind: ResourceEditor +metadata: + creationTimestamp: null + labels: + k8s.io/group: ui.k8s.appscode.com + k8s.io/kind: ClusterProfile + k8s.io/resource: clusterprofiles + k8s.io/version: v1alpha1 + name: ui.k8s.appscode.com-v1alpha1-clusterprofiles +spec: + resource: + group: ui.k8s.appscode.com + kind: ClusterProfile + name: clusterprofiles + scope: Cluster + version: v1alpha1 diff --git a/vendor/kmodules.xyz/resource-metadata/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/clusterprofiles.yaml b/vendor/kmodules.xyz/resource-metadata/hub/resourcetabledefinitions/ui.k8s.appscode.com/v1alpha1/clusterprofiles.yaml similarity index 73% rename from vendor/kmodules.xyz/resource-metadata/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/clusterprofiles.yaml rename to vendor/kmodules.xyz/resource-metadata/hub/resourcetabledefinitions/ui.k8s.appscode.com/v1alpha1/clusterprofiles.yaml index ab40d6e1c1..fa36811ce8 100644 --- a/vendor/kmodules.xyz/resource-metadata/hub/resourcetabledefinitions/meta.k8s.appscode.com/v1alpha1/clusterprofiles.yaml +++ b/vendor/kmodules.xyz/resource-metadata/hub/resourcetabledefinitions/ui.k8s.appscode.com/v1alpha1/clusterprofiles.yaml @@ -3,15 +3,15 @@ kind: ResourceTableDefinition metadata: creationTimestamp: null labels: - k8s.io/group: meta.k8s.appscode.com + k8s.io/group: ui.k8s.appscode.com k8s.io/kind: ClusterProfile k8s.io/resource: clusterprofiles k8s.io/version: v1alpha1 - name: meta.k8s.appscode.com-v1alpha1-clusterprofiles + name: ui.k8s.appscode.com-v1alpha1-clusterprofiles spec: defaultView: true resource: - group: meta.k8s.appscode.com + group: ui.k8s.appscode.com kind: ClusterProfile name: clusterprofiles scope: Cluster diff --git a/vendor/modules.txt b/vendor/modules.txt index e625334eb3..7557d3aa9a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2006,7 +2006,7 @@ kmodules.xyz/authorizer/apiserver kmodules.xyz/authorizer/rbac kmodules.xyz/authorizer/rbac/helpers kmodules.xyz/authorizer/rbac/validation -# kmodules.xyz/client-go v0.30.26 +# kmodules.xyz/client-go v0.30.27 ## explicit; go 1.22.0 kmodules.xyz/client-go kmodules.xyz/client-go/api/v1 @@ -2041,7 +2041,7 @@ kmodules.xyz/monitoring-agent-api/client ## explicit; go 1.22.0 kmodules.xyz/offshoot-api/api/v1 kmodules.xyz/offshoot-api/api/v2 -# kmodules.xyz/resource-metadata v0.19.1-0.20241009104424-86c39a298ab6 +# kmodules.xyz/resource-metadata v0.19.1-0.20241016073336-1307639922b4 ## explicit; go 1.22.1 kmodules.xyz/resource-metadata/apis/core/install kmodules.xyz/resource-metadata/apis/core/v1alpha1