diff --git a/api/go.mod b/api/go.mod index e245f99c9..b369bc31d 100644 --- a/api/go.mod +++ b/api/go.mod @@ -9,13 +9,13 @@ require ( github.com/prometheus/alertmanager v0.32.0 github.com/stretchr/testify v1.11.1 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.35.4 - k8s.io/apiextensions-apiserver v0.35.4 - k8s.io/apimachinery v0.35.4 + k8s.io/api v0.36.0 + k8s.io/apiextensions-apiserver v0.36.0 + k8s.io/apimachinery v0.36.0 k8s.io/autoscaler/vertical-pod-autoscaler v1.6.0 - k8s.io/client-go v0.35.4 + k8s.io/client-go v0.36.0 k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 - sigs.k8s.io/controller-runtime v0.23.3 + sigs.k8s.io/controller-runtime v0.24.0 sigs.k8s.io/gateway-api v1.5.1 ) @@ -65,7 +65,6 @@ require ( github.com/go-openapi/swag/yamlutils v0.25.5 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/google/gnostic-models v0.7.1 // indirect - github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect @@ -112,7 +111,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 // indirect google.golang.org/grpc v1.80.0 // indirect - google.golang.org/protobuf v1.36.11 // indirect + google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/api/go.sum b/api/go.sum index 9e4770fc9..9929ec211 100644 --- a/api/go.sum +++ b/api/go.sum @@ -243,8 +243,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= +google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -256,24 +256,24 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.35.4 h1:P7nFYKl5vo9AGUp1Z+Pmd3p2tA7bX2wbFWCvDeRv988= -k8s.io/api v0.35.4/go.mod h1:yl4lqySWOgYJJf9RERXKUwE9g2y+CkuwG+xmcOK8wXU= -k8s.io/apiextensions-apiserver v0.35.4 h1:HeP+Upp7ItdvnyGmub0yoix+2z5+ev4M5cE5TCgtOUU= -k8s.io/apiextensions-apiserver v0.35.4/go.mod h1:ogQlk+stIE8mnoRthSYCwlOS12fVqgWFiErMwPaXA7c= -k8s.io/apimachinery v0.35.4 h1:xtdom9RG7e+yDp71uoXoJDWEE2eOiHgeO4GdBzwWpds= -k8s.io/apimachinery v0.35.4/go.mod h1:NNi1taPOpep0jOj+oRha3mBJPqvi0hGdaV8TCqGQ+cc= +k8s.io/api v0.36.0 h1:SgqDhZzHdOtMk40xVSvCXkP9ME0H05hPM3p9AB1kL80= +k8s.io/api v0.36.0/go.mod h1:m1LVrGPNYax5NBHdO+QuAedXyuzTt4RryI/qnmNvs34= +k8s.io/apiextensions-apiserver v0.36.0 h1:Wt7E8J+VBCbj4FjiBfDTK/neXDDjyJVJc7xfuOHImZ0= +k8s.io/apiextensions-apiserver v0.36.0/go.mod h1:kGDjH0msuiIB3tgsYRV0kS9GqpMYMUsQ3GHv7TApyug= +k8s.io/apimachinery v0.36.0 h1:jZyPzhd5Z+3h9vJLt0z9XdzW9VzNzWAUw+P1xZ9PXtQ= +k8s.io/apimachinery v0.36.0/go.mod h1:FklypaRJt6n5wUIwWXIP6GJlIpUizTgfo1T/As+Tyxc= k8s.io/autoscaler/vertical-pod-autoscaler v1.6.0 h1:JC2YsVS6njOY8+a2mr8YX2FwZCpWfe7oVzjk98YPKZg= k8s.io/autoscaler/vertical-pod-autoscaler v1.6.0/go.mod h1:w7pOVKXZAZsct/dXWsGJflrGOTkMpBxI75KyQjUYg7Y= -k8s.io/client-go v0.35.4 h1:DN6fyaGuzK64UvnKO5fOA6ymSjvfGAnCAHAR0C66kD8= -k8s.io/client-go v0.35.4/go.mod h1:2Pg9WpsS4NeOpoYTfHHfMxBG8zFMSAUi4O/qoiJC3nY= +k8s.io/client-go v0.36.0 h1:pOYi7C4RHChYjMiHpZSpSbIM6ZxVbRXBy7CuiIwqA3c= +k8s.io/client-go v0.36.0/go.mod h1:ZKKcpwF0aLYfkHFCjillCKaTK/yBkEDHTDXCFY6AS9Y= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= k8s.io/kube-openapi v0.0.0-20260414162039-ec9c827d403f h1:4Qiq0YAoQATdgmHALJWz9rJ4fj20pB3xebpB4CFNhYM= k8s.io/kube-openapi v0.0.0-20260414162039-ec9c827d403f/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0= k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 h1:kBawHLSnx/mYHmRnNUf9d4CpjREbeZuxoSGOX/J+aYM= k8s.io/utils v0.0.0-20260319190234-28399d86e0b5/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= -sigs.k8s.io/controller-runtime v0.23.3 h1:VjB/vhoPoA9l1kEKZHBMnQF33tdCLQKJtydy4iqwZ80= -sigs.k8s.io/controller-runtime v0.23.3/go.mod h1:B6COOxKptp+YaUT5q4l6LqUJTRpizbgf9KSRNdQGns0= +sigs.k8s.io/controller-runtime v0.24.0 h1:Ck6N2LdS8Lovy1o25BB4r1xjvLEKUl1s2o9kU+KWDE4= +sigs.k8s.io/controller-runtime v0.24.0/go.mod h1:vFkfY5fGt5xAC/sKb8IBFKgWPNKG9OUG29dR8Y2wImw= sigs.k8s.io/gateway-api v1.5.1 h1:RqVRIlkhLhUO8wOHKTLnTJA6o/1un4po4/6M1nRzdd0= sigs.k8s.io/gateway-api v1.5.1/go.mod h1:GvCETiaMAlLym5CovLxGjS0NysqFk3+Yuq3/rh6QL2o= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= diff --git a/api/operator/v1/groupversion_info.go b/api/operator/v1/groupversion_info.go index 35cb56597..abb1154fd 100644 --- a/api/operator/v1/groupversion_info.go +++ b/api/operator/v1/groupversion_info.go @@ -20,24 +20,36 @@ limitations under the License. package v1 import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" ) var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "operator.victoriametrics.com", Version: "v1"} + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: "operator.victoriametrics.com", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme - - // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: "operator.victoriametrics.com", Version: "v1"} ) +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &VLAgent{}, &VLAgentList{}, + &VLSingle{}, &VLSingleList{}, + &VTSingle{}, &VTSingleList{}, + &VLCluster{}, &VLClusterList{}, + &VTCluster{}, &VTClusterList{}, + &VMAnomaly{}, &VMAnomalyList{}, + &VMAnomalyConfig{}, &VMAnomalyConfigList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} + // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() diff --git a/api/operator/v1/vlagent_types.go b/api/operator/v1/vlagent_types.go index 3c8762515..1d834b115 100644 --- a/api/operator/v1/vlagent_types.go +++ b/api/operator/v1/vlagent_types.go @@ -492,7 +492,3 @@ func (cr *VLAgent) Paused() bool { func (cr *VLAgent) GetAdditionalService() *vmv1beta1.AdditionalServiceSpec { return cr.Spec.ServiceSpec } - -func init() { - SchemeBuilder.Register(&VLAgent{}, &VLAgentList{}) -} diff --git a/api/operator/v1/vlcluster_types.go b/api/operator/v1/vlcluster_types.go index dda9f93a4..d3e7161ce 100644 --- a/api/operator/v1/vlcluster_types.go +++ b/api/operator/v1/vlcluster_types.go @@ -887,7 +887,3 @@ type VLClusterList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []VLCluster `json:"items"` } - -func init() { - SchemeBuilder.Register(&VLCluster{}, &VLClusterList{}) -} diff --git a/api/operator/v1/vlsingle_types.go b/api/operator/v1/vlsingle_types.go index 9666ff994..1434fe58c 100644 --- a/api/operator/v1/vlsingle_types.go +++ b/api/operator/v1/vlsingle_types.go @@ -331,7 +331,3 @@ func (cr *VLSingle) Paused() bool { func (cr *VLSingle) GetAdditionalService() *vmv1beta1.AdditionalServiceSpec { return cr.Spec.ServiceSpec } - -func init() { - SchemeBuilder.Register(&VLSingle{}, &VLSingleList{}) -} diff --git a/api/operator/v1/vmanomaly_types.go b/api/operator/v1/vmanomaly_types.go index 2c0783fa2..9962ea257 100644 --- a/api/operator/v1/vmanomaly_types.go +++ b/api/operator/v1/vmanomaly_types.go @@ -503,7 +503,3 @@ type VMAnomalyList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []VMAnomaly `json:"items"` } - -func init() { - SchemeBuilder.Register(&VMAnomaly{}, &VMAnomalyList{}) -} diff --git a/api/operator/v1/vmanomalyconfig_types.go b/api/operator/v1/vmanomalyconfig_types.go index 95563e164..7ff584cb9 100644 --- a/api/operator/v1/vmanomalyconfig_types.go +++ b/api/operator/v1/vmanomalyconfig_types.go @@ -66,7 +66,3 @@ type VMAnomalyConfigList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []VMAnomalyConfig `json:"items"` } - -func init() { - SchemeBuilder.Register(&VMAnomalyConfig{}, &VMAnomalyConfigList{}) -} diff --git a/api/operator/v1/vtcluster_types.go b/api/operator/v1/vtcluster_types.go index ac2c9dc05..5d3cdc38f 100644 --- a/api/operator/v1/vtcluster_types.go +++ b/api/operator/v1/vtcluster_types.go @@ -798,7 +798,3 @@ type VTClusterList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []VTCluster `json:"items"` } - -func init() { - SchemeBuilder.Register(&VTCluster{}, &VTClusterList{}) -} diff --git a/api/operator/v1/vtsingle_types.go b/api/operator/v1/vtsingle_types.go index 866629ea2..30a7b6067 100644 --- a/api/operator/v1/vtsingle_types.go +++ b/api/operator/v1/vtsingle_types.go @@ -332,7 +332,3 @@ func (cr *VTSingle) Paused() bool { func (cr *VTSingle) GetAdditionalService() *vmv1beta1.AdditionalServiceSpec { return cr.Spec.ServiceSpec } - -func init() { - SchemeBuilder.Register(&VTSingle{}, &VTSingleList{}) -} diff --git a/api/operator/v1alpha1/groupversion_info.go b/api/operator/v1alpha1/groupversion_info.go index c26200d15..62597d139 100644 --- a/api/operator/v1alpha1/groupversion_info.go +++ b/api/operator/v1alpha1/groupversion_info.go @@ -20,16 +20,14 @@ limitations under the License. package v1alpha1 import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" ) var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "operator.victoriametrics.com", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme @@ -42,3 +40,11 @@ var ( func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } + +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &VMDistributed{}, &VMDistributedList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/api/operator/v1alpha1/vmdistributed_types.go b/api/operator/v1alpha1/vmdistributed_types.go index e6669b2e8..ffa834b0a 100644 --- a/api/operator/v1alpha1/vmdistributed_types.go +++ b/api/operator/v1alpha1/vmdistributed_types.go @@ -392,10 +392,6 @@ type VMDistributedList struct { Items []VMDistributed `json:"items"` } -func init() { - SchemeBuilder.Register(&VMDistributed{}, &VMDistributedList{}) -} - // GetStatus implements reconcile.ObjectWithDeepCopyAndStatus interface func (cr *VMDistributed) GetStatus() *VMDistributedStatus { return &cr.Status diff --git a/api/operator/v1alpha1/vmdistributed_types_test.go b/api/operator/v1alpha1/vmdistributed_types_test.go index 0bdb0b85d..57387b046 100644 --- a/api/operator/v1alpha1/vmdistributed_types_test.go +++ b/api/operator/v1alpha1/vmdistributed_types_test.go @@ -90,7 +90,7 @@ func TestValidateVMDistributed(t *testing.T) { func TestEnsureNoVMOwners(t *testing.T) { cr := &VMDistributed{ TypeMeta: metav1.TypeMeta{ - APIVersion: GroupVersion.String(), + APIVersion: SchemeGroupVersion.String(), Kind: "VMDistributed", }, ObjectMeta: metav1.ObjectMeta{ @@ -101,7 +101,7 @@ func TestEnsureNoVMOwners(t *testing.T) { } otherCR := &VMDistributed{ TypeMeta: metav1.TypeMeta{ - APIVersion: GroupVersion.String(), + APIVersion: SchemeGroupVersion.String(), Kind: "VMDistributed", }, ObjectMeta: metav1.ObjectMeta{ diff --git a/api/operator/v1alpha1/zz_generated.deepcopy.go b/api/operator/v1alpha1/zz_generated.deepcopy.go index 7ebae5446..ae776663b 100644 --- a/api/operator/v1alpha1/zz_generated.deepcopy.go +++ b/api/operator/v1alpha1/zz_generated.deepcopy.go @@ -25,7 +25,7 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/api/operator/v1beta1/groupversion_info.go b/api/operator/v1beta1/groupversion_info.go index 7140722a4..40e34bead 100644 --- a/api/operator/v1beta1/groupversion_info.go +++ b/api/operator/v1beta1/groupversion_info.go @@ -20,21 +20,45 @@ limitations under the License. package v1beta1 import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" ) var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "operator.victoriametrics.com", Version: "v1beta1"} + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: "operator.victoriametrics.com", Version: "v1beta1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme ) +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &VMAgent{}, &VMAgentList{}, + &VMSingle{}, &VMSingleList{}, + &VMAlert{}, &VMAlertList{}, + &VMAlertmanager{}, &VMAlertmanagerList{}, + &VMAlertmanagerConfig{}, &VMAlertmanagerConfigList{}, + &VMAuth{}, &VMAuthList{}, + &VMUser{}, &VMUserList{}, + &VMCluster{}, &VMClusterList{}, + &VMNodeScrape{}, &VMNodeScrapeList{}, + &VMPodScrape{}, &VMPodScrapeList{}, + &VMProbe{}, &VMProbeList{}, + &VMRule{}, &VMRuleList{}, + &VMScrapeConfig{}, &VMScrapeConfigList{}, + &VMServiceScrape{}, &VMServiceScrapeList{}, + &VMStaticScrape{}, &VMStaticScrapeList{}, + &VLogs{}, &VLogsList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} + // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() diff --git a/api/operator/v1beta1/vlogs_types.go b/api/operator/v1beta1/vlogs_types.go index 7c5a7f2a7..ef868b079 100644 --- a/api/operator/v1beta1/vlogs_types.go +++ b/api/operator/v1beta1/vlogs_types.go @@ -310,7 +310,3 @@ func (cr *VLogs) Paused() bool { func (cr *VLogs) GetAdditionalService() *AdditionalServiceSpec { return cr.Spec.ServiceSpec } - -func init() { - SchemeBuilder.Register(&VLogs{}, &VLogsList{}) -} diff --git a/api/operator/v1beta1/vmagent_types.go b/api/operator/v1beta1/vmagent_types.go index d20c85b73..d98827eb8 100644 --- a/api/operator/v1beta1/vmagent_types.go +++ b/api/operator/v1beta1/vmagent_types.go @@ -701,7 +701,3 @@ type APIServerConfig struct { // +optional Authorization *Authorization `json:"authorization,omitempty"` } - -func init() { - SchemeBuilder.Register(&VMAgent{}, &VMAgentList{}) -} diff --git a/api/operator/v1beta1/vmalert_types.go b/api/operator/v1beta1/vmalert_types.go index bd0a6517e..732b8f917 100644 --- a/api/operator/v1beta1/vmalert_types.go +++ b/api/operator/v1beta1/vmalert_types.go @@ -503,7 +503,3 @@ func (cr *VMAlert) Paused() bool { func (cr *VMAlert) GetAdditionalService() *AdditionalServiceSpec { return cr.Spec.ServiceSpec } - -func init() { - SchemeBuilder.Register(&VMAlert{}, &VMAlertList{}) -} diff --git a/api/operator/v1beta1/vmalertmanager_types.go b/api/operator/v1beta1/vmalertmanager_types.go index bf474cf8d..23dbe5df6 100644 --- a/api/operator/v1beta1/vmalertmanager_types.go +++ b/api/operator/v1beta1/vmalertmanager_types.go @@ -644,7 +644,3 @@ type VMAlertmanagerHTTPConfig struct { func (cr *VMAlertmanager) GetAdditionalService() *AdditionalServiceSpec { return cr.Spec.ServiceSpec } - -func init() { - SchemeBuilder.Register(&VMAlertmanager{}, &VMAlertmanagerList{}) -} diff --git a/api/operator/v1beta1/vmalertmanagerconfig_types.go b/api/operator/v1beta1/vmalertmanagerconfig_types.go index fb5860187..414e40162 100644 --- a/api/operator/v1beta1/vmalertmanagerconfig_types.go +++ b/api/operator/v1beta1/vmalertmanagerconfig_types.go @@ -2238,7 +2238,6 @@ func validateReceiver(recv Receiver) error { func init() { compat.InitFromFlags(slog.New(&amNoopLogger{}), &alertmanagerFlags{}) - SchemeBuilder.Register(&VMAlertmanagerConfig{}, &VMAlertmanagerConfigList{}) } type alertmanagerFlags struct{} diff --git a/api/operator/v1beta1/vmauth_types.go b/api/operator/v1beta1/vmauth_types.go index 4ebf4b242..8acdf1e95 100644 --- a/api/operator/v1beta1/vmauth_types.go +++ b/api/operator/v1beta1/vmauth_types.go @@ -761,7 +761,3 @@ func (cr *VMAuth) Paused() bool { func (cr *VMAuth) GetAdditionalService() *AdditionalServiceSpec { return cr.Spec.ServiceSpec } - -func init() { - SchemeBuilder.Register(&VMAuth{}, &VMAuthList{}) -} diff --git a/api/operator/v1beta1/vmcluster_types.go b/api/operator/v1beta1/vmcluster_types.go index 922d19a33..7c844556f 100644 --- a/api/operator/v1beta1/vmcluster_types.go +++ b/api/operator/v1beta1/vmcluster_types.go @@ -253,10 +253,6 @@ type VMClusterList struct { Items []VMCluster `json:"items"` } -func init() { - SchemeBuilder.Register(&VMCluster{}, &VMClusterList{}) -} - // VMSelect defines configuration section for vmselect components of the victoria-metrics cluster type VMSelect struct { // ComponentVersion defines default images tag for this component. diff --git a/api/operator/v1beta1/vmextra_types.go b/api/operator/v1beta1/vmextra_types.go index a7313d967..b3118eae4 100644 --- a/api/operator/v1beta1/vmextra_types.go +++ b/api/operator/v1beta1/vmextra_types.go @@ -17,7 +17,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/intstr" vpav1 "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -116,9 +115,6 @@ const ( ConditionDomainTypeAppliedSuffix = ".victoriametrics.com/Applied" ) -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: "operator.victoriametrics.com", Version: "v1beta1"} - // skip validation, if object has annotation. func MustSkipCRValidation(cr client.Object) bool { return cr.GetAnnotations()[SkipValidationAnnotation] == SkipValidationValue diff --git a/api/operator/v1beta1/vmnodescrape_types.go b/api/operator/v1beta1/vmnodescrape_types.go index 1b5404ab7..bbde03565 100644 --- a/api/operator/v1beta1/vmnodescrape_types.go +++ b/api/operator/v1beta1/vmnodescrape_types.go @@ -98,7 +98,3 @@ func (cr *VMNodeScrape) DefaultStatusFields(vs *ScrapeObjectStatus) {} func (cr *VMNodeScrape) AsKey(_ bool) string { return cr.Namespace + "/" + cr.Name } - -func init() { - SchemeBuilder.Register(&VMNodeScrape{}, &VMNodeScrapeList{}) -} diff --git a/api/operator/v1beta1/vmpodscrape_types.go b/api/operator/v1beta1/vmpodscrape_types.go index 1d6820ebd..675ac6c89 100644 --- a/api/operator/v1beta1/vmpodscrape_types.go +++ b/api/operator/v1beta1/vmpodscrape_types.go @@ -158,7 +158,3 @@ func (cr *VMPodScrape) GetStatus() *ScrapeObjectStatus { // DefaultStatusFields implements reconcile.ObjectWithDeepCopyAndStatus interface func (cr *VMPodScrape) DefaultStatusFields(vs *ScrapeObjectStatus) {} - -func init() { - SchemeBuilder.Register(&VMPodScrape{}, &VMPodScrapeList{}) -} diff --git a/api/operator/v1beta1/vmprobe_types.go b/api/operator/v1beta1/vmprobe_types.go index f822556c0..a0e0829e1 100644 --- a/api/operator/v1beta1/vmprobe_types.go +++ b/api/operator/v1beta1/vmprobe_types.go @@ -210,7 +210,3 @@ func (cr *VMProbe) Validate() error { } return cr.Spec.Targets.Ingress.validate("spec.targets.ingress") } - -func init() { - SchemeBuilder.Register(&VMProbe{}, &VMProbeList{}) -} diff --git a/api/operator/v1beta1/vmrule_types.go b/api/operator/v1beta1/vmrule_types.go index e708905fb..dd338bdc6 100644 --- a/api/operator/v1beta1/vmrule_types.go +++ b/api/operator/v1beta1/vmrule_types.go @@ -262,7 +262,3 @@ type VMRuleList struct { // Items list of VMRule Items []VMRule `json:"items"` } - -func init() { - SchemeBuilder.Register(&VMRule{}, &VMRuleList{}) -} diff --git a/api/operator/v1beta1/vmscrapeconfig_types.go b/api/operator/v1beta1/vmscrapeconfig_types.go index 58af4efcc..63109fc2d 100644 --- a/api/operator/v1beta1/vmscrapeconfig_types.go +++ b/api/operator/v1beta1/vmscrapeconfig_types.go @@ -659,7 +659,3 @@ func (cr *VMScrapeConfig) GetStatus() *ScrapeObjectStatus { // DefaultStatusFields implements reconcile.ObjectWithDeepCopyAndStatus interface func (cr *VMScrapeConfig) DefaultStatusFields(vs *ScrapeObjectStatus) {} - -func init() { - SchemeBuilder.Register(&VMScrapeConfig{}, &VMScrapeConfigList{}) -} diff --git a/api/operator/v1beta1/vmservicescrape_types.go b/api/operator/v1beta1/vmservicescrape_types.go index 35a2bbd49..1263b5ed2 100644 --- a/api/operator/v1beta1/vmservicescrape_types.go +++ b/api/operator/v1beta1/vmservicescrape_types.go @@ -180,7 +180,3 @@ func (cr *VMServiceScrape) GetStatus() *ScrapeObjectStatus { // DefaultStatusFields implements reconcile.ObjectWithDeepCopyAndStatus interface func (cr *VMServiceScrape) DefaultStatusFields(vs *ScrapeObjectStatus) {} - -func init() { - SchemeBuilder.Register(&VMServiceScrape{}, &VMServiceScrapeList{}) -} diff --git a/api/operator/v1beta1/vmsingle_types.go b/api/operator/v1beta1/vmsingle_types.go index ae6bb7454..fa099230f 100644 --- a/api/operator/v1beta1/vmsingle_types.go +++ b/api/operator/v1beta1/vmsingle_types.go @@ -438,7 +438,3 @@ func (cr *VMSingle) GetStatusMetadata() *StatusMetadata { func (cr *VMSingle) GetAdditionalService() *AdditionalServiceSpec { return cr.Spec.ServiceSpec } - -func init() { - SchemeBuilder.Register(&VMSingle{}, &VMSingleList{}) -} diff --git a/api/operator/v1beta1/vmstaticscrape_types.go b/api/operator/v1beta1/vmstaticscrape_types.go index 990d2d9ae..4f2676ebc 100644 --- a/api/operator/v1beta1/vmstaticscrape_types.go +++ b/api/operator/v1beta1/vmstaticscrape_types.go @@ -104,7 +104,3 @@ func (cr *VMStaticScrape) DefaultStatusFields(vs *ScrapeObjectStatus) {} func (cr *VMStaticScrape) AsKey(_ bool) string { return cr.Namespace + "/" + cr.Name } - -func init() { - SchemeBuilder.Register(&VMStaticScrape{}, &VMStaticScrapeList{}) -} diff --git a/api/operator/v1beta1/vmuser_types.go b/api/operator/v1beta1/vmuser_types.go index 7b68cb776..420c98b26 100644 --- a/api/operator/v1beta1/vmuser_types.go +++ b/api/operator/v1beta1/vmuser_types.go @@ -428,7 +428,3 @@ func (cr *VMUser) Validate() error { } return nil } - -func init() { - SchemeBuilder.Register(&VMUser{}, &VMUserList{}) -} diff --git a/config/crd/overlay/crd.yaml b/config/crd/overlay/crd.yaml index d20af526f..b6a283774 100644 --- a/config/crd/overlay/crd.yaml +++ b/config/crd/overlay/crd.yaml @@ -36982,7 +36982,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -40273,7 +40272,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -45202,7 +45200,7 @@ spec: A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. - The volume will be mounted read-only (ro) and non-executable files (noexec). + The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. properties: @@ -45374,8 +45372,7 @@ spec: description: |- portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - is on. + are redirected to the pxd.portworx.com CSI driver. properties: fsType: description: |- @@ -48874,7 +48871,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -51441,7 +51437,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -54775,7 +54770,7 @@ spec: A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. - The volume will be mounted read-only (ro) and non-executable files (noexec). + The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. properties: @@ -54949,8 +54944,7 @@ spec: description: |- portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - is on. + are redirected to the pxd.portworx.com CSI driver. properties: fsType: description: |- @@ -58327,7 +58321,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -60905,7 +60898,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -64255,7 +64247,7 @@ spec: A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. - The volume will be mounted read-only (ro) and non-executable files (noexec). + The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. properties: @@ -64429,8 +64421,7 @@ spec: description: |- portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - is on. + are redirected to the pxd.portworx.com CSI driver. properties: fsType: description: |- diff --git a/docs/flags.md b/docs/flags.md index 169b81720..ae491e5f9 100644 --- a/docs/flags.md +++ b/docs/flags.md @@ -86,7 +86,7 @@ Usage of bin/operator: -zap-encoder value Zap log encoding (one of 'json' or 'console') -zap-log-level value - Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', 'panic'or any integer value > 0 which corresponds to custom debug levels of increasing verbosity + Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', 'panic' or any integer value > 0 which corresponds to custom debug levels of increasing verbosity Note: warn is missing by design due to warn level not being supported by controller-runtime See: https://dave.cheney.net/2015/11/05/lets-talk-about-logging and https://github.com/kubernetes-sigs/controller-runtime/issues/2002 for more information. -zap-stacktrace-level value diff --git a/go.mod b/go.mod index 39ab96fda..b43c45d90 100644 --- a/go.mod +++ b/go.mod @@ -23,14 +23,14 @@ require ( go.uber.org/zap v1.27.1 golang.org/x/sync v0.20.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.35.4 - k8s.io/apiextensions-apiserver v0.35.4 - k8s.io/apimachinery v0.35.4 + k8s.io/api v0.36.0 + k8s.io/apiextensions-apiserver v0.36.0 + k8s.io/apimachinery v0.36.0 k8s.io/autoscaler/vertical-pod-autoscaler v1.6.0 - k8s.io/client-go v0.35.4 + k8s.io/client-go v0.36.0 k8s.io/klog/v2 v2.140.0 k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 - sigs.k8s.io/controller-runtime v0.23.3 + sigs.k8s.io/controller-runtime v0.24.0 sigs.k8s.io/gateway-api v1.5.1 sigs.k8s.io/yaml v1.6.0 ) @@ -78,7 +78,6 @@ require ( github.com/go-openapi/swag/yamlutils v0.25.5 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect - github.com/google/btree v1.1.3 // indirect github.com/google/gnostic-models v0.7.1 // indirect github.com/google/pprof v0.0.0-20260202012954-cb029daf43ef // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect @@ -130,7 +129,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 // indirect google.golang.org/grpc v1.80.0 // indirect - google.golang.org/protobuf v1.36.11 // indirect + google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 6fa738c3d..c8819d333 100644 --- a/go.sum +++ b/go.sum @@ -121,8 +121,6 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs= github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= -github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= @@ -164,8 +162,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= -github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= github.com/onsi/ginkgo/v2 v2.28.2 h1:DTrMfpqxiNUyQ3Y0zhn1n3cOO2euFgQPYIpkWwxVFps= github.com/onsi/ginkgo/v2 v2.28.2/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= @@ -287,8 +283,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= +google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -300,24 +296,24 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.35.4 h1:P7nFYKl5vo9AGUp1Z+Pmd3p2tA7bX2wbFWCvDeRv988= -k8s.io/api v0.35.4/go.mod h1:yl4lqySWOgYJJf9RERXKUwE9g2y+CkuwG+xmcOK8wXU= -k8s.io/apiextensions-apiserver v0.35.4 h1:HeP+Upp7ItdvnyGmub0yoix+2z5+ev4M5cE5TCgtOUU= -k8s.io/apiextensions-apiserver v0.35.4/go.mod h1:ogQlk+stIE8mnoRthSYCwlOS12fVqgWFiErMwPaXA7c= -k8s.io/apimachinery v0.35.4 h1:xtdom9RG7e+yDp71uoXoJDWEE2eOiHgeO4GdBzwWpds= -k8s.io/apimachinery v0.35.4/go.mod h1:NNi1taPOpep0jOj+oRha3mBJPqvi0hGdaV8TCqGQ+cc= +k8s.io/api v0.36.0 h1:SgqDhZzHdOtMk40xVSvCXkP9ME0H05hPM3p9AB1kL80= +k8s.io/api v0.36.0/go.mod h1:m1LVrGPNYax5NBHdO+QuAedXyuzTt4RryI/qnmNvs34= +k8s.io/apiextensions-apiserver v0.36.0 h1:Wt7E8J+VBCbj4FjiBfDTK/neXDDjyJVJc7xfuOHImZ0= +k8s.io/apiextensions-apiserver v0.36.0/go.mod h1:kGDjH0msuiIB3tgsYRV0kS9GqpMYMUsQ3GHv7TApyug= +k8s.io/apimachinery v0.36.0 h1:jZyPzhd5Z+3h9vJLt0z9XdzW9VzNzWAUw+P1xZ9PXtQ= +k8s.io/apimachinery v0.36.0/go.mod h1:FklypaRJt6n5wUIwWXIP6GJlIpUizTgfo1T/As+Tyxc= k8s.io/autoscaler/vertical-pod-autoscaler v1.6.0 h1:JC2YsVS6njOY8+a2mr8YX2FwZCpWfe7oVzjk98YPKZg= k8s.io/autoscaler/vertical-pod-autoscaler v1.6.0/go.mod h1:w7pOVKXZAZsct/dXWsGJflrGOTkMpBxI75KyQjUYg7Y= -k8s.io/client-go v0.35.4 h1:DN6fyaGuzK64UvnKO5fOA6ymSjvfGAnCAHAR0C66kD8= -k8s.io/client-go v0.35.4/go.mod h1:2Pg9WpsS4NeOpoYTfHHfMxBG8zFMSAUi4O/qoiJC3nY= +k8s.io/client-go v0.36.0 h1:pOYi7C4RHChYjMiHpZSpSbIM6ZxVbRXBy7CuiIwqA3c= +k8s.io/client-go v0.36.0/go.mod h1:ZKKcpwF0aLYfkHFCjillCKaTK/yBkEDHTDXCFY6AS9Y= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= k8s.io/kube-openapi v0.0.0-20260414162039-ec9c827d403f h1:4Qiq0YAoQATdgmHALJWz9rJ4fj20pB3xebpB4CFNhYM= k8s.io/kube-openapi v0.0.0-20260414162039-ec9c827d403f/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0= k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 h1:kBawHLSnx/mYHmRnNUf9d4CpjREbeZuxoSGOX/J+aYM= k8s.io/utils v0.0.0-20260319190234-28399d86e0b5/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= -sigs.k8s.io/controller-runtime v0.23.3 h1:VjB/vhoPoA9l1kEKZHBMnQF33tdCLQKJtydy4iqwZ80= -sigs.k8s.io/controller-runtime v0.23.3/go.mod h1:B6COOxKptp+YaUT5q4l6LqUJTRpizbgf9KSRNdQGns0= +sigs.k8s.io/controller-runtime v0.24.0 h1:Ck6N2LdS8Lovy1o25BB4r1xjvLEKUl1s2o9kU+KWDE4= +sigs.k8s.io/controller-runtime v0.24.0/go.mod h1:vFkfY5fGt5xAC/sKb8IBFKgWPNKG9OUG29dR8Y2wImw= sigs.k8s.io/gateway-api v1.5.1 h1:RqVRIlkhLhUO8wOHKTLnTJA6o/1un4po4/6M1nRzdd0= sigs.k8s.io/gateway-api v1.5.1/go.mod h1:GvCETiaMAlLym5CovLxGjS0NysqFk3+Yuq3/rh6QL2o= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= diff --git a/internal/controller/operator/factory/reconcile/reconcile_test.go b/internal/controller/operator/factory/reconcile/reconcile_test.go index 64a3f19cf..0bc326eae 100644 --- a/internal/controller/operator/factory/reconcile/reconcile_test.go +++ b/internal/controller/operator/factory/reconcile/reconcile_test.go @@ -20,7 +20,7 @@ func TestWaitForStatus(t *testing.T) { f := func(status vmv1beta1.UpdateStatus, isErr bool) { vmc := &vmv1beta1.VMCluster{ TypeMeta: metav1.TypeMeta{ - APIVersion: vmv1beta1.GroupVersion.String(), + APIVersion: vmv1beta1.SchemeGroupVersion.String(), Kind: "VMCluster", }, ObjectMeta: metav1.ObjectMeta{ @@ -57,7 +57,7 @@ func TestWaitForStatus_MinGeneration(t *testing.T) { f := func(observedGen, minGen int64, isErr bool) { vmc := &vmv1beta1.VMCluster{ TypeMeta: metav1.TypeMeta{ - APIVersion: vmv1beta1.GroupVersion.String(), + APIVersion: vmv1beta1.SchemeGroupVersion.String(), Kind: "VMCluster", }, ObjectMeta: metav1.ObjectMeta{ @@ -98,7 +98,7 @@ func TestWaitForStatus_GenerationChangesOnGet(t *testing.T) { minGen := int64(2) vmc := &vmv1beta1.VMCluster{ TypeMeta: metav1.TypeMeta{ - APIVersion: vmv1beta1.GroupVersion.String(), + APIVersion: vmv1beta1.SchemeGroupVersion.String(), Kind: "VMCluster", }, ObjectMeta: metav1.ObjectMeta{ diff --git a/internal/controller/operator/factory/vmdistributed/vmdistributed_test.go b/internal/controller/operator/factory/vmdistributed/vmdistributed_test.go index ea53ab792..5d91de9a6 100644 --- a/internal/controller/operator/factory/vmdistributed/vmdistributed_test.go +++ b/internal/controller/operator/factory/vmdistributed/vmdistributed_test.go @@ -90,7 +90,7 @@ func beforeEach(o opts) *testData { cr := &vmv1alpha1.VMDistributed{ TypeMeta: metav1.TypeMeta{ Kind: "VMDistributed", - APIVersion: vmv1alpha1.GroupVersion.String(), + APIVersion: vmv1alpha1.SchemeGroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Name: "test-vdc", diff --git a/test/e2e/vmagent_test.go b/test/e2e/vmagent_test.go index 1424ca046..bbb58c05b 100644 --- a/test/e2e/vmagent_test.go +++ b/test/e2e/vmagent_test.go @@ -73,7 +73,7 @@ var _ = Describe("test vmagent Controller", Label("vm", "agent", "vmagent"), fun var latestCR vmv1beta1.VMAgent Expect(k8sClient.Get(ctx, nsn, &latestCR)).ToNot(HaveOccurred()) latestCR.Kind = "VMAgent" - latestCR.APIVersion = vmv1beta1.GroupVersion.String() + latestCR.APIVersion = vmv1beta1.SchemeGroupVersion.String() k8sClient.Scheme().Default(&latestCR) Expect(vmagent.CreateOrUpdate(ctx, &latestCR, k8sClient)).ToNot(HaveOccurred()) } diff --git a/test/e2e/vmalert_test.go b/test/e2e/vmalert_test.go index 4b477993b..55cf23848 100644 --- a/test/e2e/vmalert_test.go +++ b/test/e2e/vmalert_test.go @@ -74,7 +74,7 @@ var _ = Describe("test vmalert Controller", Label("vm", "alert"), func() { var latestCR vmv1beta1.VMAlert Expect(k8sClient.Get(ctx, nsn, &latestCR)).ToNot(HaveOccurred()) latestCR.Kind = "VMAlert" - latestCR.APIVersion = vmv1beta1.GroupVersion.String() + latestCR.APIVersion = vmv1beta1.SchemeGroupVersion.String() k8sClient.Scheme().Default(&latestCR) Expect(vmalert.CreateOrUpdate(ctx, &latestCR, k8sClient, []string{})).ToNot(HaveOccurred()) } diff --git a/test/e2e/vmcluster_test.go b/test/e2e/vmcluster_test.go index 1eaebe5e4..e2d57c689 100644 --- a/test/e2e/vmcluster_test.go +++ b/test/e2e/vmcluster_test.go @@ -100,7 +100,7 @@ var _ = Describe("e2e vmcluster", Label("vm", "cluster", "vmcluster"), func() { var latestCR vmv1beta1.VMCluster Expect(k8sClient.Get(ctx, nsn, &latestCR)).ToNot(HaveOccurred()) latestCR.Kind = "VMCluster" - latestCR.APIVersion = vmv1beta1.GroupVersion.String() + latestCR.APIVersion = vmv1beta1.SchemeGroupVersion.String() k8sClient.Scheme().Default(&latestCR) Expect(vmcluster.CreateOrUpdate(ctx, &latestCR, k8sClient)).ToNot(HaveOccurred()) } diff --git a/test/e2e/vmdistributed_test.go b/test/e2e/vmdistributed_test.go index 04f50af5a..cac7abc5e 100644 --- a/test/e2e/vmdistributed_test.go +++ b/test/e2e/vmdistributed_test.go @@ -940,7 +940,7 @@ var _ = Describe("e2e VMDistributed", Label("vm", "vmdistributed"), func() { Expect(k8sClient.Get(ctx, nsn, &latestCR)).ToNot(HaveOccurred()) // Ensure that TypeMeta is set for ownership check to pass latestCR.Kind = "VMDistributed" - latestCR.APIVersion = vmv1alpha1.GroupVersion.String() + latestCR.APIVersion = vmv1alpha1.SchemeGroupVersion.String() k8sClient.Scheme().Default(&latestCR) Expect(vmdistributed.CreateOrUpdate(ctx, &latestCR, k8sClient)).ToNot(HaveOccurred()) } diff --git a/test/e2e/vmsingle_test.go b/test/e2e/vmsingle_test.go index 86ae57acc..cb5fe71fd 100644 --- a/test/e2e/vmsingle_test.go +++ b/test/e2e/vmsingle_test.go @@ -74,7 +74,7 @@ var _ = Describe("test vmsingle Controller", Label("vm", "single"), func() { var latestCR vmv1beta1.VMSingle Expect(k8sClient.Get(ctx, nsn, &latestCR)).ToNot(HaveOccurred()) latestCR.Kind = "VMSingle" - latestCR.APIVersion = vmv1beta1.GroupVersion.String() + latestCR.APIVersion = vmv1beta1.SchemeGroupVersion.String() k8sClient.Scheme().Default(&latestCR) Expect(vmsingle.CreateOrUpdate(ctx, &latestCR, k8sClient)).ToNot(HaveOccurred()) }