diff --git a/api/core/v1alpha1/br_types.go b/api/core/v1alpha1/br_types.go index a2cff921..32435d37 100644 --- a/api/core/v1alpha1/br_types.go +++ b/api/core/v1alpha1/br_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,9 +16,10 @@ package v1alpha1 import ( fmt "fmt" + "time" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "time" ) const ( diff --git a/api/core/v1alpha1/bucketclaim_helpers.go b/api/core/v1alpha1/bucketclaim_helpers.go index 73ec687e..40905b1a 100644 --- a/api/core/v1alpha1/bucketclaim_helpers.go +++ b/api/core/v1alpha1/bucketclaim_helpers.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,12 @@ import ( "context" "crypto/sha1" "fmt" + "strings" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "strings" ) const ( diff --git a/api/core/v1alpha1/bucketclaim_types.go b/api/core/v1alpha1/bucketclaim_types.go index 2acce65c..523d2056 100644 --- a/api/core/v1alpha1/bucketclaim_types.go +++ b/api/core/v1alpha1/bucketclaim_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/cnclaim_helper.go b/api/core/v1alpha1/cnclaim_helper.go index f0fb0c68..33df42a8 100644 --- a/api/core/v1alpha1/cnclaim_helper.go +++ b/api/core/v1alpha1/cnclaim_helper.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/cnclaim_types.go b/api/core/v1alpha1/cnclaim_types.go index ca579271..f0383ca2 100644 --- a/api/core/v1alpha1/cnclaim_types.go +++ b/api/core/v1alpha1/cnclaim_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/cnpool_helper.go b/api/core/v1alpha1/cnpool_helper.go index 692c9ac1..518c2315 100644 --- a/api/core/v1alpha1/cnpool_helper.go +++ b/api/core/v1alpha1/cnpool_helper.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/cnpool_types.go b/api/core/v1alpha1/cnpool_types.go index dcf658f1..7924802d 100644 --- a/api/core/v1alpha1/cnpool_types.go +++ b/api/core/v1alpha1/cnpool_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/cnset_types.go b/api/core/v1alpha1/cnset_types.go index c9e3f751..26bfd08a 100644 --- a/api/core/v1alpha1/cnset_types.go +++ b/api/core/v1alpha1/cnset_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,10 +15,11 @@ package v1alpha1 import ( + "time" + recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "time" ) type CNRole string diff --git a/api/core/v1alpha1/common_helpers.go b/api/core/v1alpha1/common_helpers.go index 4b3ed0da..0924eec8 100644 --- a/api/core/v1alpha1/common_helpers.go +++ b/api/core/v1alpha1/common_helpers.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -289,10 +289,7 @@ func (p *PodSet) GetSemVer() (*semver.Version, bool) { if p.SemanticVersion != nil { s = *p.SemanticVersion } else { - ss := strings.Split(p.Image, ":") - if len(ss) == 2 { - s = ss[1] - } + s = getImageTag(p.Image) } v, err := semver.ParseTolerant(s) if err != nil { @@ -301,6 +298,13 @@ func (p *PodSet) GetSemVer() (*semver.Version, bool) { return &v, true } +func getImageTag(image string) string { + if idx := strings.LastIndex(image, ":"); idx >= 0 { + return image[idx+1:] + } + return "" +} + func (p *PodSet) GetOperatorVersion() semver.Version { if p.OperatorVersion == nil { return FirstOpVersion diff --git a/api/core/v1alpha1/common_helpers_test.go b/api/core/v1alpha1/common_helpers_test.go index 6f47aed7..bc53159d 100644 --- a/api/core/v1alpha1/common_helpers_test.go +++ b/api/core/v1alpha1/common_helpers_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,10 +15,11 @@ package v1alpha1 import ( + "testing" + . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "testing" ) func TestGetCNPodUUID(t *testing.T) { @@ -50,3 +51,45 @@ func TestGetCNPodUUID(t *testing.T) { }) } } + +func TestGetImageTag(t *testing.T) { + tests := []struct { + name string + image string + want string + }{ + { + name: "Regular image with tag", + image: "matrixorigin/matrixone:1.1.1", + want: "1.1.1", + }, + { + name: "Image with registry and tag", + image: "registry.example.com/matrixorigin/matrixone:latest", + want: "latest", + }, + { + name: "Image without tag", + image: "matrixorigin/matrixone", + want: "", + }, + { + name: "Image with multiple colons", + image: "registry.example.com:5000/matrixorigin/matrixone:v1.0.0", + want: "v1.0.0", + }, + { + name: "Empty string", + image: "", + want: "", + }, + } + + g := NewGomegaWithT(t) + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := getImageTag(tt.image) + g.Expect(got).To(Equal(tt.want)) + }) + } +} diff --git a/api/core/v1alpha1/common_types.go b/api/core/v1alpha1/common_types.go index 8d691d02..4cfcf9c9 100644 --- a/api/core/v1alpha1/common_types.go +++ b/api/core/v1alpha1/common_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/dnset_types.go b/api/core/v1alpha1/dnset_types.go index 00cf5051..fcc3b86d 100644 --- a/api/core/v1alpha1/dnset_types.go +++ b/api/core/v1alpha1/dnset_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/groupversion_info.go b/api/core/v1alpha1/groupversion_info.go index 40aafd55..4ce07947 100644 --- a/api/core/v1alpha1/groupversion_info.go +++ b/api/core/v1alpha1/groupversion_info.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/logset_helpers.go b/api/core/v1alpha1/logset_helpers.go index 58a973eb..bc1b7c55 100644 --- a/api/core/v1alpha1/logset_helpers.go +++ b/api/core/v1alpha1/logset_helpers.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/logset_types.go b/api/core/v1alpha1/logset_types.go index 5ff1f436..8702f1ae 100644 --- a/api/core/v1alpha1/logset_types.go +++ b/api/core/v1alpha1/logset_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,9 @@ package v1alpha1 import ( "fmt" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( diff --git a/api/core/v1alpha1/logset_types_test.go b/api/core/v1alpha1/logset_types_test.go index 8a861e52..d78e4141 100644 --- a/api/core/v1alpha1/logset_types_test.go +++ b/api/core/v1alpha1/logset_types_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,8 +15,9 @@ package v1alpha1 import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestSetDefaultRetentionPolicy(t *testing.T) { diff --git a/api/core/v1alpha1/matrixonecluster_helpers.go b/api/core/v1alpha1/matrixonecluster_helpers.go index a1f43ff0..73ef87ba 100644 --- a/api/core/v1alpha1/matrixonecluster_helpers.go +++ b/api/core/v1alpha1/matrixonecluster_helpers.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/matrixonecluster_types.go b/api/core/v1alpha1/matrixonecluster_types.go index 00141d50..02d901f0 100644 --- a/api/core/v1alpha1/matrixonecluster_types.go +++ b/api/core/v1alpha1/matrixonecluster_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/operator_version.go b/api/core/v1alpha1/operator_version.go index 75710c6c..c4dfbf31 100644 --- a/api/core/v1alpha1/operator_version.go +++ b/api/core/v1alpha1/operator_version.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/proxy_types.go b/api/core/v1alpha1/proxy_types.go index 7ecb68a8..5391a23d 100644 --- a/api/core/v1alpha1/proxy_types.go +++ b/api/core/v1alpha1/proxy_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/semver.go b/api/core/v1alpha1/semver.go index 109e8ba8..1503ce5b 100644 --- a/api/core/v1alpha1/semver.go +++ b/api/core/v1alpha1/semver.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/semver_test.go b/api/core/v1alpha1/semver_test.go index a5168b8c..001d31cf 100644 --- a/api/core/v1alpha1/semver_test.go +++ b/api/core/v1alpha1/semver_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/store_helper.go b/api/core/v1alpha1/store_helper.go index d22eab4f..e0ed0c05 100644 --- a/api/core/v1alpha1/store_helper.go +++ b/api/core/v1alpha1/store_helper.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/toml_config.go b/api/core/v1alpha1/toml_config.go index c336fc82..4bf54b84 100644 --- a/api/core/v1alpha1/toml_config.go +++ b/api/core/v1alpha1/toml_config.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/toml_config_test.go b/api/core/v1alpha1/toml_config_test.go index 78495c0f..67c8705c 100644 --- a/api/core/v1alpha1/toml_config_test.go +++ b/api/core/v1alpha1/toml_config_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/webui_types.go b/api/core/v1alpha1/webui_types.go index 550b6add..cf1f784d 100644 --- a/api/core/v1alpha1/webui_types.go +++ b/api/core/v1alpha1/webui_types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/core/v1alpha1/zz_generated.deepcopy.go b/api/core/v1alpha1/zz_generated.deepcopy.go index 1c7f8cc4..915f968d 100644 --- a/api/core/v1alpha1/zz_generated.deepcopy.go +++ b/api/core/v1alpha1/zz_generated.deepcopy.go @@ -1,6 +1,6 @@ //go:build !ignore_autogenerated -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/features/features.go b/api/features/features.go index 6753955f..c8e2cc21 100644 --- a/api/features/features.go +++ b/api/features/features.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cmd/hacli/main.go b/cmd/hacli/main.go index 9728b3cc..904e163e 100644 --- a/cmd/hacli/main.go +++ b/cmd/hacli/main.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ package main import ( "context" + "time" + "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" "github.com/matrixorigin/matrixone-operator/pkg/controllers/common" "github.com/matrixorigin/matrixone/pkg/logservice" @@ -23,7 +25,6 @@ import ( "github.com/matrixorigin/matrixone/pkg/pb/metadata" "go.uber.org/zap" logzap "sigs.k8s.io/controller-runtime/pkg/log/zap" - "time" ) // TODO(aylei): complete this CLI diff --git a/cmd/operator/main.go b/cmd/operator/main.go index 33be392d..09ad2fe2 100644 --- a/cmd/operator/main.go +++ b/cmd/operator/main.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,8 +17,9 @@ package main import ( "flag" "fmt" - "k8s.io/kubernetes/pkg/capabilities" "os" + + "k8s.io/kubernetes/pkg/capabilities" "sigs.k8s.io/controller-runtime/pkg/cache" "github.com/go-logr/zapr" @@ -52,6 +53,7 @@ import ( zaporigin "go.uber.org/zap" "go.uber.org/zap/zapcore" controllermetrics "sigs.k8s.io/controller-runtime/pkg/metrics" + // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) // to ensure that exec-entrypoint and run can make use of them. _ "k8s.io/client-go/plugin/pkg/client/auth" diff --git a/cmd/rpccli/main.go b/cmd/rpccli/main.go index 1abf3239..5dbee3c2 100644 --- a/cmd/rpccli/main.go +++ b/cmd/rpccli/main.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,10 +16,11 @@ package main import ( "context" + "time" + "github.com/matrixorigin/matrixone-operator/pkg/querycli" "go.uber.org/zap" logzap "sigs.k8s.io/controller-runtime/pkg/log/zap" - "time" ) func main() { diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index d75834d8..edf372de 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/cmd/client.go b/pkg/cmd/client.go index 89673b54..2c0f1519 100644 --- a/pkg/cmd/client.go +++ b/pkg/cmd/client.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,9 +17,10 @@ package cmd import ( "encoding/json" "fmt" - "github.com/go-errors/errors" "io" "net/http" + + "github.com/go-errors/errors" ) func GetCmdStatus(host string, port int) (*Status, error) { diff --git a/pkg/cmd/types.go b/pkg/cmd/types.go index 41f5be4f..4da51868 100644 --- a/pkg/cmd/types.go +++ b/pkg/cmd/types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/br/backup_controller.go b/pkg/controllers/br/backup_controller.go index 1f7b2409..59419e0e 100644 --- a/pkg/controllers/br/backup_controller.go +++ b/pkg/controllers/br/backup_controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,9 @@ package br import ( "fmt" + "strings" + "time" + "github.com/go-errors/errors" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/controller-runtime/pkg/util" @@ -31,8 +34,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" manager "sigs.k8s.io/controller-runtime/pkg/manager" - "strings" - "time" ) const ( diff --git a/pkg/controllers/br/command.go b/pkg/controllers/br/command.go index cbd2d96a..ed6f60af 100644 --- a/pkg/controllers/br/command.go +++ b/pkg/controllers/br/command.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,9 @@ package br import ( "fmt" - "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" "strings" + + "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" ) const ( diff --git a/pkg/controllers/br/common.go b/pkg/controllers/br/common.go index 3b6798e1..3c4c5a2b 100644 --- a/pkg/controllers/br/common.go +++ b/pkg/controllers/br/common.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ package br import ( + "time" + recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" "github.com/matrixorigin/matrixone-operator/pkg/controllers/common" @@ -24,7 +26,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" - "time" ) const ( diff --git a/pkg/controllers/br/gc_controller.go b/pkg/controllers/br/gc_controller.go index 317da42b..eeb08af8 100644 --- a/pkg/controllers/br/gc_controller.go +++ b/pkg/controllers/br/gc_controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ package br import ( + "time" + "github.com/matrixorigin/controller-runtime/pkg/observer" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" - "time" ) type GCActor[T JobObject] struct { diff --git a/pkg/controllers/br/restore_controller.go b/pkg/controllers/br/restore_controller.go index b29dd12e..5aeda900 100644 --- a/pkg/controllers/br/restore_controller.go +++ b/pkg/controllers/br/restore_controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ package br import ( "fmt" + "strings" + "github.com/go-errors/errors" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/controller-runtime/pkg/util" @@ -31,7 +33,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" - "strings" ) type RestoreActor struct { diff --git a/pkg/controllers/bucketclaim/controller.go b/pkg/controllers/bucketclaim/controller.go index 5c5ec4b9..cf60c0ee 100644 --- a/pkg/controllers/bucketclaim/controller.go +++ b/pkg/controllers/bucketclaim/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/bucketclaim/controller_test.go b/pkg/controllers/bucketclaim/controller_test.go index b187915b..e687f006 100644 --- a/pkg/controllers/bucketclaim/controller_test.go +++ b/pkg/controllers/bucketclaim/controller_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,9 +15,10 @@ package bucketclaim import ( + "testing" + "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" "github.com/stretchr/testify/assert" - "testing" ) func TestParseEndpoint(t *testing.T) { diff --git a/pkg/controllers/bucketclaim/jobtpl.go b/pkg/controllers/bucketclaim/jobtpl.go index c189cd48..d4fa073a 100644 --- a/pkg/controllers/bucketclaim/jobtpl.go +++ b/pkg/controllers/bucketclaim/jobtpl.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/bucketclaim/options.go b/pkg/controllers/bucketclaim/options.go index 2eb3a5c7..6ffb0147 100644 --- a/pkg/controllers/bucketclaim/options.go +++ b/pkg/controllers/bucketclaim/options.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnclaim/controller.go b/pkg/controllers/cnclaim/controller.go index 57833133..041cc1ec 100644 --- a/pkg/controllers/cnclaim/controller.go +++ b/pkg/controllers/cnclaim/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnclaim/controller_test.go b/pkg/controllers/cnclaim/controller_test.go index 11aa35c0..dd96505a 100644 --- a/pkg/controllers/cnclaim/controller_test.go +++ b/pkg/controllers/cnclaim/controller_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ package cnclaim import ( + "math/rand" + "testing" + "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - "math/rand" - "testing" . "github.com/onsi/gomega" ) diff --git a/pkg/controllers/cnclaim/migrate.go b/pkg/controllers/cnclaim/migrate.go index b52eeb5f..21360205 100644 --- a/pkg/controllers/cnclaim/migrate.go +++ b/pkg/controllers/cnclaim/migrate.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnclaimset/controller.go b/pkg/controllers/cnclaimset/controller.go index 73b55242..8046179c 100644 --- a/pkg/controllers/cnclaimset/controller.go +++ b/pkg/controllers/cnclaimset/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,9 @@ package cnclaimset import ( "context" + "strconv" + "time" + "github.com/go-errors/errors" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/controller-runtime/pkg/util" @@ -32,8 +35,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" - "strconv" - "time" ) const ( diff --git a/pkg/controllers/cnclaimset/controller_test.go b/pkg/controllers/cnclaimset/controller_test.go index 1161f879..389d1c39 100644 --- a/pkg/controllers/cnclaimset/controller_test.go +++ b/pkg/controllers/cnclaimset/controller_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ package cnclaimset import ( + "testing" + "time" + "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" "github.com/matrixorigin/matrixone-operator/pkg/controllers/common" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "testing" - "time" . "github.com/onsi/gomega" ) diff --git a/pkg/controllers/cnpool/controller.go b/pkg/controllers/cnpool/controller.go index 3cb4130f..62830dfb 100644 --- a/pkg/controllers/cnpool/controller.go +++ b/pkg/controllers/cnpool/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnpool/controller_test.go b/pkg/controllers/cnpool/controller_test.go index b1511fa9..442dd2ca 100644 --- a/pkg/controllers/cnpool/controller_test.go +++ b/pkg/controllers/cnpool/controller_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,10 @@ package cnpool import ( "context" + "math/rand" + "testing" + "time" + "github.com/go-logr/logr" "github.com/golang/mock/gomock" "github.com/matrixorigin/controller-runtime/pkg/fake" @@ -28,10 +32,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" - "math/rand" "sigs.k8s.io/controller-runtime/pkg/client" - "testing" - "time" . "github.com/onsi/gomega" ) diff --git a/pkg/controllers/cnset/controller.go b/pkg/controllers/cnset/controller.go index efeccd0f..6e25c2fc 100644 --- a/pkg/controllers/cnset/controller.go +++ b/pkg/controllers/cnset/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnset/controller_test.go b/pkg/controllers/cnset/controller_test.go index e09dd567..bb29dc33 100644 --- a/pkg/controllers/cnset/controller_test.go +++ b/pkg/controllers/cnset/controller_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,9 +15,10 @@ package cnset import ( - kruisev1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1" "testing" + kruisev1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1" + "github.com/golang/mock/gomock" "github.com/matrixorigin/controller-runtime/pkg/fake" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" diff --git a/pkg/controllers/cnset/resource.go b/pkg/controllers/cnset/resource.go index 347b8533..c1c575e1 100644 --- a/pkg/controllers/cnset/resource.go +++ b/pkg/controllers/cnset/resource.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnset/resource_test.go b/pkg/controllers/cnset/resource_test.go index ffecc7f3..47a48e2d 100644 --- a/pkg/controllers/cnset/resource_test.go +++ b/pkg/controllers/cnset/resource_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnset/utils.go b/pkg/controllers/cnset/utils.go index 22d3461b..f6b8daef 100644 --- a/pkg/controllers/cnset/utils.go +++ b/pkg/controllers/cnset/utils.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnstore/controller.go b/pkg/controllers/cnstore/controller.go index 4fd52305..6d81b5ed 100644 --- a/pkg/controllers/cnstore/controller.go +++ b/pkg/controllers/cnstore/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnstore/metric.go b/pkg/controllers/cnstore/metric.go index 037ed270..d616e700 100644 --- a/pkg/controllers/cnstore/metric.go +++ b/pkg/controllers/cnstore/metric.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/cnstore/pooling.go b/pkg/controllers/cnstore/pooling.go index 07f81f2b..8758d1ac 100644 --- a/pkg/controllers/cnstore/pooling.go +++ b/pkg/controllers/cnstore/pooling.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/cnstore.go b/pkg/controllers/common/cnstore.go index fd1f7f05..848a02de 100644 --- a/pkg/controllers/common/cnstore.go +++ b/pkg/controllers/common/cnstore.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/cnstore_test.go b/pkg/controllers/common/cnstore_test.go index a183a262..14e38ec5 100644 --- a/pkg/controllers/common/cnstore_test.go +++ b/pkg/controllers/common/cnstore_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,8 +15,9 @@ package common import ( - corev1 "k8s.io/api/core/v1" "testing" + + corev1 "k8s.io/api/core/v1" ) // returns true when pod spec container image differs from pod status container image diff --git a/pkg/controllers/common/configmap.go b/pkg/controllers/common/configmap.go index eef98454..0b5149bd 100644 --- a/pkg/controllers/common/configmap.go +++ b/pkg/controllers/common/configmap.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/configmap_test.go b/pkg/controllers/common/configmap_test.go index 3cfe4e71..6b0ace92 100644 --- a/pkg/controllers/common/configmap_test.go +++ b/pkg/controllers/common/configmap_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/consts.go b/pkg/controllers/common/consts.go index fb1461f0..5c88730e 100644 --- a/pkg/controllers/common/consts.go +++ b/pkg/controllers/common/consts.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/failover.go b/pkg/controllers/common/failover.go index 56654c91..680d59a0 100644 --- a/pkg/controllers/common/failover.go +++ b/pkg/controllers/common/failover.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,11 +15,12 @@ package common import ( + "time" + "github.com/matrixorigin/controller-runtime/pkg/util" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "time" ) const ( diff --git a/pkg/controllers/common/fileservice.go b/pkg/controllers/common/fileservice.go index 8a90c716..3c968d67 100644 --- a/pkg/controllers/common/fileservice.go +++ b/pkg/controllers/common/fileservice.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,11 +16,12 @@ package common import ( "fmt" + "strings" + "github.com/matrixorigin/controller-runtime/pkg/util" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - "strings" ) const ( diff --git a/pkg/controllers/common/fileservice_test.go b/pkg/controllers/common/fileservice_test.go index 939f8b85..14e0b651 100644 --- a/pkg/controllers/common/fileservice_test.go +++ b/pkg/controllers/common/fileservice_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,11 +15,12 @@ package common import ( + "testing" + "github.com/google/go-cmp/cmp" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - "testing" ) func TestFileServiceConfig(t *testing.T) { diff --git a/pkg/controllers/common/history.go b/pkg/controllers/common/history.go index 5c5819e4..edc60c9a 100644 --- a/pkg/controllers/common/history.go +++ b/pkg/controllers/common/history.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ import ( "fmt" "hash" "hash/fnv" + "k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/rand" ) diff --git a/pkg/controllers/common/history_test.go b/pkg/controllers/common/history_test.go index 48502507..8012e4c4 100644 --- a/pkg/controllers/common/history_test.go +++ b/pkg/controllers/common/history_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,9 +14,10 @@ package common import ( - "github.com/matrixorigin/matrixone-operator/pkg/utils" "testing" + "github.com/matrixorigin/matrixone-operator/pkg/utils" + . "github.com/onsi/gomega" ) diff --git a/pkg/controllers/common/operatorcfg.go b/pkg/controllers/common/operatorcfg.go index 3cea76a8..084e95b9 100644 --- a/pkg/controllers/common/operatorcfg.go +++ b/pkg/controllers/common/operatorcfg.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/pod.go b/pkg/controllers/common/pod.go index 76aa0284..3d59ab31 100644 --- a/pkg/controllers/common/pod.go +++ b/pkg/controllers/common/pod.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/pod_test.go b/pkg/controllers/common/pod_test.go index fa43b611..6c4ef794 100644 --- a/pkg/controllers/common/pod_test.go +++ b/pkg/controllers/common/pod_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,9 +15,10 @@ package common import ( + "testing" + v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/event" - "testing" ) func TestPodStatusChangedPredicate_Update(t *testing.T) { diff --git a/pkg/controllers/common/podset.go b/pkg/controllers/common/podset.go index 755cc5c5..88866794 100644 --- a/pkg/controllers/common/podset.go +++ b/pkg/controllers/common/podset.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/podset_test.go b/pkg/controllers/common/podset_test.go index d6b59d05..414d384e 100644 --- a/pkg/controllers/common/podset_test.go +++ b/pkg/controllers/common/podset_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/selector.go b/pkg/controllers/common/selector.go index 25c5ce87..0c42caf5 100644 --- a/pkg/controllers/common/selector.go +++ b/pkg/controllers/common/selector.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/template.go b/pkg/controllers/common/template.go index b1b35c5a..7a3559d8 100644 --- a/pkg/controllers/common/template.go +++ b/pkg/controllers/common/template.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/types.go b/pkg/controllers/common/types.go index 3895fe3b..67a22981 100644 --- a/pkg/controllers/common/types.go +++ b/pkg/controllers/common/types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/common/volume.go b/pkg/controllers/common/volume.go index b5947d4c..72a21b89 100644 --- a/pkg/controllers/common/volume.go +++ b/pkg/controllers/common/volume.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/dnset/controller.go b/pkg/controllers/dnset/controller.go index 6e38644a..0b1de64b 100644 --- a/pkg/controllers/dnset/controller.go +++ b/pkg/controllers/dnset/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/dnset/controller_test.go b/pkg/controllers/dnset/controller_test.go index 28dc9f19..fcca0a55 100644 --- a/pkg/controllers/dnset/controller_test.go +++ b/pkg/controllers/dnset/controller_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/dnset/resource.go b/pkg/controllers/dnset/resource.go index 291efbd0..30118c06 100644 --- a/pkg/controllers/dnset/resource.go +++ b/pkg/controllers/dnset/resource.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/dnset/resource_test.go b/pkg/controllers/dnset/resource_test.go index 5e0e7d32..69b02720 100644 --- a/pkg/controllers/dnset/resource_test.go +++ b/pkg/controllers/dnset/resource_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/dnset/utils.go b/pkg/controllers/dnset/utils.go index 6c487d1e..35d355a5 100644 --- a/pkg/controllers/dnset/utils.go +++ b/pkg/controllers/dnset/utils.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package dnset import ( "fmt" + "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" "github.com/matrixorigin/matrixone-operator/pkg/controllers/common" ) diff --git a/pkg/controllers/logset/bootstrap.go b/pkg/controllers/logset/bootstrap.go index c0d34008..8a606123 100644 --- a/pkg/controllers/logset/bootstrap.go +++ b/pkg/controllers/logset/bootstrap.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package logset import ( "fmt" + "github.com/go-errors/errors" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" diff --git a/pkg/controllers/logset/bucketclaim.go b/pkg/controllers/logset/bucketclaim.go index 8554abec..64bdc555 100644 --- a/pkg/controllers/logset/bucketclaim.go +++ b/pkg/controllers/logset/bucketclaim.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ package logset import ( "fmt" + "sort" + recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" "github.com/matrixorigin/matrixone-operator/api/features" @@ -24,7 +26,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sort" ) func (r *Actor) syncBucketEverRunningAnn(ctx *recon.Context[*v1alpha1.LogSet]) error { diff --git a/pkg/controllers/logset/configmap.go b/pkg/controllers/logset/configmap.go index 4129a9b1..0f6552d0 100644 --- a/pkg/controllers/logset/configmap.go +++ b/pkg/controllers/logset/configmap.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/logset/configmap_test.go b/pkg/controllers/logset/configmap_test.go index 117c5118..3be8628e 100644 --- a/pkg/controllers/logset/configmap_test.go +++ b/pkg/controllers/logset/configmap_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,11 +14,12 @@ package logset import ( + "reflect" + "testing" + "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" kruisev1 "github.com/openkruise/kruise-api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "reflect" - "testing" ) func Test_gossipSeeds(t *testing.T) { diff --git a/pkg/controllers/logset/controller.go b/pkg/controllers/logset/controller.go index e9bbb066..a2f291a2 100644 --- a/pkg/controllers/logset/controller.go +++ b/pkg/controllers/logset/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/logset/controller_test.go b/pkg/controllers/logset/controller_test.go index b76ef717..4d586143 100644 --- a/pkg/controllers/logset/controller_test.go +++ b/pkg/controllers/logset/controller_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,9 @@ package logset import ( "context" + "testing" + "time" + "github.com/golang/mock/gomock" "github.com/matrixorigin/controller-runtime/pkg/fake" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" @@ -30,8 +33,6 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" - "testing" - "time" . "github.com/onsi/gomega" ) diff --git a/pkg/controllers/logset/discovery.go b/pkg/controllers/logset/discovery.go index 660c1064..12e4cfd8 100644 --- a/pkg/controllers/logset/discovery.go +++ b/pkg/controllers/logset/discovery.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/logset/sts.go b/pkg/controllers/logset/sts.go index e6f86a2a..f50d92a3 100644 --- a/pkg/controllers/logset/sts.go +++ b/pkg/controllers/logset/sts.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/logset/sts_test.go b/pkg/controllers/logset/sts_test.go index a0c11e73..affde553 100644 --- a/pkg/controllers/logset/sts_test.go +++ b/pkg/controllers/logset/sts_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/mocluster/controller.go b/pkg/controllers/mocluster/controller.go index 487f913e..fc12917b 100644 --- a/pkg/controllers/mocluster/controller.go +++ b/pkg/controllers/mocluster/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/mocluster/controller_test.go b/pkg/controllers/mocluster/controller_test.go index b836191d..7b32f46f 100644 --- a/pkg/controllers/mocluster/controller_test.go +++ b/pkg/controllers/mocluster/controller_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ package mocluster import ( "context" + "testing" + "github.com/golang/mock/gomock" "github.com/matrixorigin/controller-runtime/pkg/fake" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" @@ -32,7 +34,6 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client" - "testing" ) func TestMatrixOneClusterActor_Observe(t *testing.T) { diff --git a/pkg/controllers/proxyset/controller.go b/pkg/controllers/proxyset/controller.go index b545bdf8..ddf62240 100644 --- a/pkg/controllers/proxyset/controller.go +++ b/pkg/controllers/proxyset/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package proxyset import ( "fmt" + "github.com/go-errors/errors" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/controller-runtime/pkg/util" diff --git a/pkg/controllers/proxyset/resource.go b/pkg/controllers/proxyset/resource.go index 2c0862f9..864b5267 100644 --- a/pkg/controllers/proxyset/resource.go +++ b/pkg/controllers/proxyset/resource.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/webhook/controller.go b/pkg/controllers/webhook/controller.go index 6213b5bb..2a70dd97 100644 --- a/pkg/controllers/webhook/controller.go +++ b/pkg/controllers/webhook/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package webhook import ( "context" + "github.com/go-errors/errors" "github.com/go-logr/logr" v1 "k8s.io/api/admissionregistration/v1" diff --git a/pkg/controllers/webui/controller.go b/pkg/controllers/webui/controller.go index e692d443..f18f4848 100644 --- a/pkg/controllers/webui/controller.go +++ b/pkg/controllers/webui/controller.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ package webui import ( + "time" + "github.com/go-errors/errors" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/controller-runtime/pkg/util" @@ -30,7 +32,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" - "time" ) const ( diff --git a/pkg/controllers/webui/controller_test.go b/pkg/controllers/webui/controller_test.go index 7cb01e68..e5dd617c 100644 --- a/pkg/controllers/webui/controller_test.go +++ b/pkg/controllers/webui/controller_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/webui/resource.go b/pkg/controllers/webui/resource.go index 412f213a..7b654a5f 100644 --- a/pkg/controllers/webui/resource.go +++ b/pkg/controllers/webui/resource.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controllers/webui/utils.go b/pkg/controllers/webui/utils.go index 0151d989..85f49f2e 100644 --- a/pkg/controllers/webui/utils.go +++ b/pkg/controllers/webui/utils.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/hook/cnclaim.go b/pkg/hook/cnclaim.go index c974042e..7cd92cd7 100644 --- a/pkg/hook/cnclaim.go +++ b/pkg/hook/cnclaim.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package hook import ( "context" + "github.com/go-logr/logr" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/hook/cnclaimset.go b/pkg/hook/cnclaimset.go index 00b9d928..5b729a6b 100644 --- a/pkg/hook/cnclaimset.go +++ b/pkg/hook/cnclaimset.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package hook import ( "context" + "github.com/go-logr/logr" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/metric/rpc.go b/pkg/metric/rpc.go index 96f77aa6..434066b6 100644 --- a/pkg/metric/rpc.go +++ b/pkg/metric/rpc.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/metric/types.go b/pkg/metric/types.go index 19512106..ae7c768c 100644 --- a/pkg/metric/types.go +++ b/pkg/metric/types.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/mocli/cn_cache.go b/pkg/mocli/cn_cache.go index 1b95e699..d8f9b50b 100644 --- a/pkg/mocli/cn_cache.go +++ b/pkg/mocli/cn_cache.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,12 +16,13 @@ package mocli import ( "context" + "sync" + "time" + "github.com/go-logr/logr" "github.com/matrixorigin/matrixone/pkg/logservice" logpb "github.com/matrixorigin/matrixone/pkg/pb/logservice" "github.com/matrixorigin/matrixone/pkg/pb/metadata" - "sync" - "time" ) type StoreCache struct { diff --git a/pkg/mocli/lockservice_client.go b/pkg/mocli/lockservice_client.go index 10458215..2be779eb 100644 --- a/pkg/mocli/lockservice_client.go +++ b/pkg/mocli/lockservice_client.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package mocli import ( "context" + "github.com/go-errors/errors" "github.com/matrixorigin/matrixone/pkg/common/morpc" "github.com/matrixorigin/matrixone/pkg/pb/lock" diff --git a/pkg/mocli/manager.go b/pkg/mocli/manager.go index 229a78a7..74f7dff4 100644 --- a/pkg/mocli/manager.go +++ b/pkg/mocli/manager.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,9 @@ package mocli import ( "context" + "sync" + "time" + "github.com/go-errors/errors" "github.com/go-logr/zapr" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" @@ -25,8 +28,6 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - "sync" - "time" ) const ( diff --git a/pkg/mosql/client.go b/pkg/mosql/client.go index 1e94b68f..2beeca52 100644 --- a/pkg/mosql/client.go +++ b/pkg/mosql/client.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,12 @@ import ( "context" "database/sql" "fmt" + "sync" + "time" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - "sync" - "time" // mysql driver _ "github.com/go-sql-driver/mysql" diff --git a/pkg/mosql/fake.go b/pkg/mosql/fake.go index 1e61dba1..d3f76373 100644 --- a/pkg/mosql/fake.go +++ b/pkg/mosql/fake.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package mosql import ( "context" "database/sql" + "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/querycli/query.go b/pkg/querycli/query.go index c9ed74ba..e72aa01f 100644 --- a/pkg/querycli/query.go +++ b/pkg/querycli/query.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,12 +16,13 @@ package querycli import ( "context" + "time" + "github.com/go-errors/errors" "github.com/matrixorigin/matrixone-operator/pkg/metric" "github.com/matrixorigin/matrixone/pkg/common/morpc" pb "github.com/matrixorigin/matrixone/pkg/pb/query" "github.com/matrixorigin/matrixone/pkg/txn/rpc" - "time" ) var timeout = 10 * time.Second diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 2698876c..1262aaa3 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package utils import ( "fmt" + "github.com/cespare/xxhash" recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" corev1 "k8s.io/api/core/v1" diff --git a/pkg/webhook/cnset_webhook.go b/pkg/webhook/cnset_webhook.go index beccd45b..89a23fc6 100644 --- a/pkg/webhook/cnset_webhook.go +++ b/pkg/webhook/cnset_webhook.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/cnset_webhook_test.go b/pkg/webhook/cnset_webhook_test.go index 6151a872..1165ecdd 100644 --- a/pkg/webhook/cnset_webhook_test.go +++ b/pkg/webhook/cnset_webhook_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/common.go b/pkg/webhook/common.go index 691e1ec9..05740c2e 100644 --- a/pkg/webhook/common.go +++ b/pkg/webhook/common.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/convertor/convertor.go b/pkg/webhook/convertor/convertor.go index a17f0458..a0a94df0 100644 --- a/pkg/webhook/convertor/convertor.go +++ b/pkg/webhook/convertor/convertor.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/convertor/convertor_test.go b/pkg/webhook/convertor/convertor_test.go index 55cbe7f8..bc14117f 100644 --- a/pkg/webhook/convertor/convertor_test.go +++ b/pkg/webhook/convertor/convertor_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,10 +15,11 @@ package convertor import ( - apiscorev1 "k8s.io/kubernetes/pkg/apis/core/v1" "reflect" "testing" + apiscorev1 "k8s.io/kubernetes/pkg/apis/core/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/kubernetes/pkg/apis/core" ) diff --git a/pkg/webhook/corevalidation/exported.go b/pkg/webhook/corevalidation/exported.go index 292ad171..459339c1 100644 --- a/pkg/webhook/corevalidation/exported.go +++ b/pkg/webhook/corevalidation/exported.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/dnset_webhook.go b/pkg/webhook/dnset_webhook.go index f1c1f935..13e54eef 100644 --- a/pkg/webhook/dnset_webhook.go +++ b/pkg/webhook/dnset_webhook.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/dnset_webhook_test.go b/pkg/webhook/dnset_webhook_test.go index 459fd1ec..725bc0f0 100644 --- a/pkg/webhook/dnset_webhook_test.go +++ b/pkg/webhook/dnset_webhook_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/logset_webhook.go b/pkg/webhook/logset_webhook.go index f4290c37..4e3f8704 100644 --- a/pkg/webhook/logset_webhook.go +++ b/pkg/webhook/logset_webhook.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/logset_webhook_test.go b/pkg/webhook/logset_webhook_test.go index 1c5ab427..268fa847 100644 --- a/pkg/webhook/logset_webhook_test.go +++ b/pkg/webhook/logset_webhook_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/matrixonecluster_webhook.go b/pkg/webhook/matrixonecluster_webhook.go index 60a175fe..4e0c70b2 100644 --- a/pkg/webhook/matrixonecluster_webhook.go +++ b/pkg/webhook/matrixonecluster_webhook.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package webhook import ( "context" "fmt" + admissionv1 "k8s.io/api/admission/v1" "k8s.io/utils/pointer" diff --git a/pkg/webhook/matrixonecluster_webhook_test.go b/pkg/webhook/matrixonecluster_webhook_test.go index 6d8c44f6..62d24b20 100644 --- a/pkg/webhook/matrixonecluster_webhook_test.go +++ b/pkg/webhook/matrixonecluster_webhook_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package webhook import ( "context" "fmt" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" diff --git a/pkg/webhook/proxy_webhook.go b/pkg/webhook/proxy_webhook.go index 9fb94adf..40b97617 100644 --- a/pkg/webhook/proxy_webhook.go +++ b/pkg/webhook/proxy_webhook.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/proxy_webhook_test.go b/pkg/webhook/proxy_webhook_test.go index 390c45ee..fd1d2674 100644 --- a/pkg/webhook/proxy_webhook_test.go +++ b/pkg/webhook/proxy_webhook_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/utils.go b/pkg/webhook/utils.go index ddd969ed..6fcddcb9 100644 --- a/pkg/webhook/utils.go +++ b/pkg/webhook/utils.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/webhook.go b/pkg/webhook/webhook.go index 8ef7ffd6..141e5e6a 100644 --- a/pkg/webhook/webhook.go +++ b/pkg/webhook/webhook.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/webhook_suite_test.go b/pkg/webhook/webhook_suite_test.go index 5728bfe8..1d1373ea 100644 --- a/pkg/webhook/webhook_suite_test.go +++ b/pkg/webhook/webhook_suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/webhook/webui_webhook.go b/pkg/webhook/webui_webhook.go index a963648d..5ce1b69a 100644 --- a/pkg/webhook/webui_webhook.go +++ b/pkg/webhook/webui_webhook.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/e2e/bucket_test.go b/test/e2e/bucket_test.go index 8b7bcb09..4555793c 100644 --- a/test/e2e/bucket_test.go +++ b/test/e2e/bucket_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,10 @@ package e2e import ( "context" "fmt" + "reflect" + "strings" + "time" + recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/controller-runtime/pkg/util" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" @@ -27,10 +31,7 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "reflect" "sigs.k8s.io/controller-runtime/pkg/client" - "strings" - "time" ) const ( diff --git a/test/e2e/claim_test.go b/test/e2e/claim_test.go index fabc89d1..4d4cb966 100644 --- a/test/e2e/claim_test.go +++ b/test/e2e/claim_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/e2e/cnset_test.go b/test/e2e/cnset_test.go index e90c6264..71bed826 100644 --- a/test/e2e/cnset_test.go +++ b/test/e2e/cnset_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,11 +16,12 @@ package e2e import ( "fmt" - "github.com/matrixorigin/matrixone-operator/pkg/utils" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "strings" "time" + "github.com/matrixorigin/matrixone-operator/pkg/utils" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + recon "github.com/matrixorigin/controller-runtime/pkg/reconciler" "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" "github.com/matrixorigin/matrixone-operator/pkg/controllers/common" diff --git a/test/e2e/dnset_test.go b/test/e2e/dnset_test.go index 5a9c4199..6fc34adb 100644 --- a/test/e2e/dnset_test.go +++ b/test/e2e/dnset_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/e2e/e2eminio/minios3.go b/test/e2e/e2eminio/minios3.go index ddf164e4..ff8151e1 100644 --- a/test/e2e/e2eminio/minios3.go +++ b/test/e2e/e2eminio/minios3.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,15 +18,16 @@ import ( "bytes" "context" "fmt" + "path/filepath" + "strings" + "github.com/matrixorigin/matrixone-operator/test/e2e/util" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/rand" "k8s.io/client-go/rest" - "path/filepath" "sigs.k8s.io/controller-runtime/pkg/client" - "strings" ) var ( diff --git a/test/e2e/logset_test.go b/test/e2e/logset_test.go index f50bc8a6..32734741 100644 --- a/test/e2e/logset_test.go +++ b/test/e2e/logset_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/e2e/matrixonecluster_test.go b/test/e2e/matrixonecluster_test.go index e5fc07a0..2c8ded83 100644 --- a/test/e2e/matrixonecluster_test.go +++ b/test/e2e/matrixonecluster_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/e2e/proxy_test.go b/test/e2e/proxy_test.go index 213416e4..d5ff3fa5 100644 --- a/test/e2e/proxy_test.go +++ b/test/e2e/proxy_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/e2e/sql/sql.go b/test/e2e/sql/sql.go index b5b56f1f..4f8e82b3 100644 --- a/test/e2e/sql/sql.go +++ b/test/e2e/sql/sql.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/e2e/suite_test.go b/test/e2e/suite_test.go index e8a8488d..3c46802a 100644 --- a/test/e2e/suite_test.go +++ b/test/e2e/suite_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ import ( "encoding/json" "flag" "fmt" + "github.com/matrixorigin/matrixone-operator/test/e2e/e2eminio" e2eutil "github.com/matrixorigin/matrixone-operator/test/e2e/util" diff --git a/test/e2e/util/patch.go b/test/e2e/util/patch.go index c3f5d0ad..97ab0bd3 100644 --- a/test/e2e/util/patch.go +++ b/test/e2e/util/patch.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/test/e2e/util/portforward.go b/test/e2e/util/portforward.go index 7b1a86ec..7d847a0a 100644 --- a/test/e2e/util/portforward.go +++ b/test/e2e/util/portforward.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,15 +15,16 @@ package util import ( "fmt" + "log" + "net/http" + "os" + "time" + "github.com/go-errors/errors" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/portforward" "k8s.io/client-go/transport/spdy" - "log" - "net/http" - "os" - "time" ) type PortForwardHandler struct { diff --git a/test/e2e/util/template.go b/test/e2e/util/template.go index 6921c885..26397a06 100644 --- a/test/e2e/util/template.go +++ b/test/e2e/util/template.go @@ -1,4 +1,4 @@ -// Copyright 2024 Matrix Origin +// Copyright 2025 Matrix Origin // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ package util import ( + "time" + "github.com/matrixorigin/matrixone-operator/api/core/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" - "time" ) // NewLogSetTpl return a logSet template, name is random generated