diff --git a/go.mod b/go.mod index cc6a542f8..d2713e063 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( kmodules.xyz/custom-resources v0.29.0 kmodules.xyz/go-containerregistry v0.0.12 kmodules.xyz/monitoring-agent-api v0.29.0 - kmodules.xyz/resource-metadata v0.18.2-0.20240118082955-d3f44ca9bc03 + kmodules.xyz/resource-metadata v0.18.2-0.20240118143554-f415526b8139 kmodules.xyz/resource-metrics v0.29.0 kmodules.xyz/sets v0.29.0 kubeops.dev/scanner v0.0.16 diff --git a/go.sum b/go.sum index 52061eaa6..9013bf0dc 100644 --- a/go.sum +++ b/go.sum @@ -3456,8 +3456,8 @@ kmodules.xyz/monitoring-agent-api v0.29.0 h1:gpFl6OZrlMLb/ySMHdREI9EwGtnJ91oZBn9 kmodules.xyz/monitoring-agent-api v0.29.0/go.mod h1:iNbvaMTgVFOI5q2LJtGK91j4Dmjv4ZRiRdasGmWLKQI= kmodules.xyz/offshoot-api v0.29.0 h1:GHLhxxT9jU1N8+FvOCCeJNyU5g0duYS46UGrs6AHNLY= kmodules.xyz/offshoot-api v0.29.0/go.mod h1:5NxhBblXoDHWStx9HCDJR2KFTwYjEZ7i1Id3jelIunw= -kmodules.xyz/resource-metadata v0.18.2-0.20240118082955-d3f44ca9bc03 h1:fnVoqjoufs9zq0pbNb/fGBLwbTfaUIQOnGdWawD7MrY= -kmodules.xyz/resource-metadata v0.18.2-0.20240118082955-d3f44ca9bc03/go.mod h1:I9HeSgkshwzwUy0IDhp4yIfRFbFQJ21syeSf4NsB04o= +kmodules.xyz/resource-metadata v0.18.2-0.20240118143554-f415526b8139 h1:5aMsW8E+Cgvp5jgec/a7j8pQ2zfD00TyiZTuLu+Vw+0= +kmodules.xyz/resource-metadata v0.18.2-0.20240118143554-f415526b8139/go.mod h1:I9HeSgkshwzwUy0IDhp4yIfRFbFQJ21syeSf4NsB04o= kmodules.xyz/resource-metrics v0.29.0 h1:YBSVCbGdAugUqZK4igHu3fPhxvpYar4xejE6njryNM4= kmodules.xyz/resource-metrics v0.29.0/go.mod h1:OuG/QobZ7o8GFHl/u3lqaUR0fDZDegxtV8Vdh+MNBD4= kmodules.xyz/sets v0.29.0 h1:ZX/qOECzUob95JhhRtngJElHSlJ1UNNdwK4hTEy+nl0= diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index 64c9630d9..fc8873771 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -118,7 +118,6 @@ func init() { policyinstall.Install(Scheme) costinstall.Install(Scheme) rsinstall.Install(Scheme) - Scheme.AddKnownTypes(rsapi.SchemeGroupVersion, &uiapi.ResourceEditorList{}, &uiapi.ResourceEditor{}) uiinstall.Install(Scheme) rscoreinstall.Install(Scheme) mgmtinstall.Install(Scheme) diff --git a/pkg/registry/meta/resourceeditor/storage.go b/pkg/registry/meta/resourceeditor/storage.go index 24d553b9a..0f0029f09 100644 --- a/pkg/registry/meta/resourceeditor/storage.go +++ b/pkg/registry/meta/resourceeditor/storage.go @@ -72,7 +72,7 @@ func (r *Storage) GetSingularName() string { // Getter func (r *Storage) New() runtime.Object { - return &uiapi.ResourceEditor{} + return &rsapi.ResourceEditor{} } func (r *Storage) Destroy() {} @@ -87,7 +87,7 @@ func (r *Storage) Get(ctx context.Context, name string, options *metav1.GetOptio // Lister func (r *Storage) NewList() runtime.Object { - return &uiapi.ResourceEditorList{} + return &rsapi.ResourceEditorList{} } func (r *Storage) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error) { @@ -111,7 +111,7 @@ func (r *Storage) List(ctx context.Context, options *metainternalversion.ListOpt objs = objs[:options.Limit] } - items := make([]uiapi.ResourceEditor, 0, len(objs)) + items := make([]rsapi.ResourceEditor, 0, len(objs)) for _, obj := range objs { if options.LabelSelector != nil && !options.LabelSelector.Matches(labels.Set(obj.GetLabels())) { continue @@ -119,12 +119,12 @@ func (r *Storage) List(ctx context.Context, options *metainternalversion.ListOpt items = append(items, *complete(obj.DeepCopy())) } - return &uiapi.ResourceEditorList{Items: items}, nil + return &rsapi.ResourceEditorList{Items: items}, nil } var podNamespace = meta_util.PodNamespace() -func complete(obj *uiapi.ResourceEditor) *uiapi.ResourceEditor { +func complete(obj *rsapi.ResourceEditor) *rsapi.ResourceEditor { if obj.Spec.UI == nil { return obj } 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 456e6ccd2..1141f71e2 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/register.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/register.go @@ -58,6 +58,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ResourceTableDefinitionList{}, &ResourceBlockDefinition{}, &ResourceBlockDefinitionList{}, + &ResourceEditor{}, + &ResourceEditorList{}, &ResourceOutline{}, &ResourceOutlineList{}, &ResourceLayout{}, diff --git a/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/resourceeditor_types.go b/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/resourceeditor_types.go new file mode 100644 index 000000000..64e0d58c2 --- /dev/null +++ b/vendor/kmodules.xyz/resource-metadata/apis/meta/v1alpha1/resourceeditor_types.go @@ -0,0 +1,24 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import uiapi "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + +type ( + ResourceEditor = uiapi.ResourceEditor + ResourceEditorList = uiapi.ResourceEditorList +) diff --git a/vendor/modules.txt b/vendor/modules.txt index d04196c7a..c8f8919bc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1952,7 +1952,7 @@ kmodules.xyz/monitoring-agent-api/client # kmodules.xyz/offshoot-api v0.29.0 ## explicit; go 1.21.5 kmodules.xyz/offshoot-api/api/v1 -# kmodules.xyz/resource-metadata v0.18.2-0.20240118082955-d3f44ca9bc03 +# kmodules.xyz/resource-metadata v0.18.2-0.20240118143554-f415526b8139 ## explicit; go 1.21.5 kmodules.xyz/resource-metadata/apis/core/install kmodules.xyz/resource-metadata/apis/core/v1alpha1