From d01705186b8cada440d7fd5b082d2ca180a6f9cb Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Tue, 11 Jun 2024 01:27:48 -0700 Subject: [PATCH] Fix build Signed-off-by: Tamal Saha --- go.mod | 2 +- go.sum | 4 ++-- pkg/apiserver/apiserver.go | 4 ++-- pkg/b3/client.go | 3 +-- pkg/cmds/server/start.go | 12 ++++++------ pkg/registry/identity/clusteridentity/storage.go | 4 ++-- pkg/registry/identity/inboxtokenrequest/storage.go | 4 ++-- .../selfsubjectnamespaceaccessreview/storage.go | 5 ++--- .../apis/identity/v1alpha1/groupversion_info.go | 6 +++--- vendor/modules.txt | 2 +- 10 files changed, 22 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 28f844aa61..a407433175 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( kmodules.xyz/custom-resources v0.29.1 kmodules.xyz/go-containerregistry v0.0.12 kmodules.xyz/monitoring-agent-api v0.29.0 - kmodules.xyz/resource-metadata v0.18.7-0.20240611075122-490ab7bad5db + kmodules.xyz/resource-metadata v0.18.7-0.20240611082433-09fbe76307ab kmodules.xyz/resource-metrics v0.30.1 kmodules.xyz/resource-metrics/utils v0.30.1 kmodules.xyz/sets v0.29.0 diff --git a/go.sum b/go.sum index bed3eb1d2a..b63336502f 100644 --- a/go.sum +++ b/go.sum @@ -914,8 +914,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.4 h1:WQV2BIUIoVKKiqZNmZ4gAy367jEdwBhEl3dFCLZM1qA= kmodules.xyz/offshoot-api v0.29.4/go.mod h1:e+NQ0s4gW/YTPWBWEfdISZcmk+tlTq8IjvP5SLdqvko= -kmodules.xyz/resource-metadata v0.18.7-0.20240611075122-490ab7bad5db h1:7LnANNqnxlS0tnFHw1fpR0plXHnaMIT3Bof3joGq1NA= -kmodules.xyz/resource-metadata v0.18.7-0.20240611075122-490ab7bad5db/go.mod h1:WKwJXM00EFKeDXDF+fjEMwxyZnKs/1SXMj9nt0VbDHs= +kmodules.xyz/resource-metadata v0.18.7-0.20240611082433-09fbe76307ab h1:YnJ8gzmFalCr2DcZPZF275Fod9I8yvsgdx0yjhFixx8= +kmodules.xyz/resource-metadata v0.18.7-0.20240611082433-09fbe76307ab/go.mod h1:WKwJXM00EFKeDXDF+fjEMwxyZnKs/1SXMj9nt0VbDHs= kmodules.xyz/resource-metrics v0.30.1 h1:o7mVY8ZwSe5iEILy1eMG4EPZCli7mXZCkgQONjoY9uU= kmodules.xyz/resource-metrics v0.30.1/go.mod h1:UYcQQLN+3o8rNPQJwJa2D9bt5ihJCeo5bCDuQ4O3MPY= kmodules.xyz/resource-metrics/utils v0.30.1 h1:iRnAKNMMdAi7QYjMQrK9W3vNMhSC21RWNx9yS3qlpTA= diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index a951f225a3..e956fdd37c 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -28,8 +28,6 @@ import ( scannerscheme "kubeops.dev/scanner/client/clientset/versioned/scheme" costinstall "kubeops.dev/ui-server/apis/cost/install" costapi "kubeops.dev/ui-server/apis/cost/v1alpha1" - identityinstall "kmodules.xyz/resource-metadata/apis/identity/install" - identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" licenseinstall "kubeops.dev/ui-server/apis/offline/install" licenseapi "kubeops.dev/ui-server/apis/offline/v1alpha1" policyinstall "kubeops.dev/ui-server/apis/policy/install" @@ -99,6 +97,8 @@ import ( promclient "kmodules.xyz/monitoring-agent-api/client" rscoreinstall "kmodules.xyz/resource-metadata/apis/core/install" rscoreapi "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + identityinstall "kmodules.xyz/resource-metadata/apis/identity/install" + identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" mgmtinstall "kmodules.xyz/resource-metadata/apis/management/install" rsinstall "kmodules.xyz/resource-metadata/apis/meta/install" rsapi "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" diff --git a/pkg/b3/client.go b/pkg/b3/client.go index 871b2f1f78..edf2614f4d 100644 --- a/pkg/b3/client.go +++ b/pkg/b3/client.go @@ -23,12 +23,11 @@ import ( "net/http" "path" - identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" - "go.bytebuilders.dev/license-verifier/info" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/json" + identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" ) type Client struct { diff --git a/pkg/cmds/server/start.go b/pkg/cmds/server/start.go index 3ce86fd0e9..889cd3c388 100644 --- a/pkg/cmds/server/start.go +++ b/pkg/cmds/server/start.go @@ -26,7 +26,6 @@ import ( reportsapi "kubeops.dev/scanner/apis/reports/v1alpha1" costapi "kubeops.dev/ui-server/apis/cost/v1alpha1" - identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" licenseapi "kubeops.dev/ui-server/apis/offline/v1alpha1" policyapi "kubeops.dev/ui-server/apis/policy/v1alpha1" "kubeops.dev/ui-server/pkg/apiserver" @@ -51,6 +50,7 @@ import ( "kmodules.xyz/client-go/tools/clientcmd" promclient "kmodules.xyz/monitoring-agent-api/client" rscoreapi "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" rsapi "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" ui "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" uiapi "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" @@ -78,7 +78,7 @@ func NewUIServerOptions(out, errOut io.Writer) *UIServerOptions { defaultEtcdPathPrefix, apiserver.Codecs.LegacyCodec( rsapi.SchemeGroupVersion, - identityapi.GroupVersion, + identityapi.SchemeGroupVersion, rscoreapi.SchemeGroupVersion, ), ), @@ -163,10 +163,10 @@ func (o *UIServerOptions) Config() (*apiserver.Config, error) { fmt.Sprintf("/apis/%s/%s", licenseapi.SchemeGroupVersion, licenseapi.ResourceAddOfflineLicenses), fmt.Sprintf("/apis/%s/%s", licenseapi.SchemeGroupVersion, licenseapi.ResourceOfflineLicenses), - fmt.Sprintf("/apis/%s", identityapi.GroupVersion), - fmt.Sprintf("/apis/%s/%s", identityapi.GroupVersion, identityapi.ResourceClusterIdentities), - fmt.Sprintf("/apis/%s/%s", identityapi.GroupVersion, identityapi.ResourceInboxTokenRequests), - fmt.Sprintf("/apis/%s/%s", identityapi.GroupVersion, identityapi.ResourceSelfSubjectNamespaceAccessReviews), + fmt.Sprintf("/apis/%s", identityapi.SchemeGroupVersion), + fmt.Sprintf("/apis/%s/%s", identityapi.SchemeGroupVersion, identityapi.ResourceClusterIdentities), + fmt.Sprintf("/apis/%s/%s", identityapi.SchemeGroupVersion, identityapi.ResourceInboxTokenRequests), + fmt.Sprintf("/apis/%s/%s", identityapi.SchemeGroupVersion, identityapi.ResourceSelfSubjectNamespaceAccessReviews), } serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig( diff --git a/pkg/registry/identity/clusteridentity/storage.go b/pkg/registry/identity/clusteridentity/storage.go index 74879f35d5..a5914e12ae 100644 --- a/pkg/registry/identity/clusteridentity/storage.go +++ b/pkg/registry/identity/clusteridentity/storage.go @@ -20,7 +20,6 @@ import ( "context" "strings" - identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" "kubeops.dev/ui-server/pkg/b3" "gomodules.xyz/sync" @@ -31,6 +30,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/registry/rest" + identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -68,7 +68,7 @@ func NewStorage(kc client.Client, bc *b3.Client, clusterUID string) *Storage { } func (r *Storage) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind { - return identityapi.GroupVersion.WithKind(identityapi.ResourceKindClusterIdentity) + return identityapi.SchemeGroupVersion.WithKind(identityapi.ResourceKindClusterIdentity) } func (r *Storage) NamespaceScoped() bool { diff --git a/pkg/registry/identity/inboxtokenrequest/storage.go b/pkg/registry/identity/inboxtokenrequest/storage.go index 934ca2e7f9..d5ab2b093a 100644 --- a/pkg/registry/identity/inboxtokenrequest/storage.go +++ b/pkg/registry/identity/inboxtokenrequest/storage.go @@ -20,13 +20,13 @@ import ( "context" "strings" - identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" "kubeops.dev/ui-server/pkg/b3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/registry/rest" + identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -53,7 +53,7 @@ func NewStorage(kc client.Client, bc *b3.Client, clusterUID string) *Storage { } func (r *Storage) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind { - return identityapi.GroupVersion.WithKind(identityapi.ResourceKindInboxTokenRequest) + return identityapi.SchemeGroupVersion.WithKind(identityapi.ResourceKindInboxTokenRequest) } func (r *Storage) NamespaceScoped() bool { diff --git a/pkg/registry/identity/selfsubjectnamespaceaccessreview/storage.go b/pkg/registry/identity/selfsubjectnamespaceaccessreview/storage.go index 82a4204667..1d217f64f6 100644 --- a/pkg/registry/identity/selfsubjectnamespaceaccessreview/storage.go +++ b/pkg/registry/identity/selfsubjectnamespaceaccessreview/storage.go @@ -20,8 +20,6 @@ import ( "context" "sort" - identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" - authorization "k8s.io/api/authorization/v1" core "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -32,6 +30,7 @@ import ( "k8s.io/apiserver/pkg/registry/rest" "k8s.io/client-go/kubernetes" clustermeta "kmodules.xyz/client-go/cluster" + identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -56,7 +55,7 @@ func NewStorage(kc kubernetes.Interface, rtc client.Client) *Storage { } func (r *Storage) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind { - return identityapi.GroupVersion.WithKind(identityapi.ResourceKindSelfSubjectNamespaceAccessReview) + return identityapi.SchemeGroupVersion.WithKind(identityapi.ResourceKindSelfSubjectNamespaceAccessReview) } func (r *Storage) NamespaceScoped() bool { diff --git a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/groupversion_info.go b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/groupversion_info.go index cbe10272cd..92a6e0a839 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/groupversion_info.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/groupversion_info.go @@ -24,11 +24,11 @@ import ( const GroupName = "identity.k8s.appscode.com" var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme diff --git a/vendor/modules.txt b/vendor/modules.txt index e3a03b1987..8091a456de 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1955,7 +1955,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.18.7-0.20240611075122-490ab7bad5db +# kmodules.xyz/resource-metadata v0.18.7-0.20240611082433-09fbe76307ab ## explicit; go 1.22.0 kmodules.xyz/resource-metadata/apis/core/install kmodules.xyz/resource-metadata/apis/core/v1alpha1