diff --git a/Makefile b/Makefile index a0e51d5..f6db737 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ ARCH ?= amd64 OS ?= $(shell uname -s | tr A-Z a-z) K8S_LATEST_VER ?= $(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) export CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME) -TAG ?= main +TAG ?= dev ## Tool Binaries CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen diff --git a/PROJECT b/PROJECT index 42cfd07..b9bc37f 100644 --- a/PROJECT +++ b/PROJECT @@ -12,7 +12,7 @@ resources: domain: projectsveltos.io group: lib kind: SveltosCluster - version: v1alpha1 + version: v1beta1 - controller: true domain: x-k8s.io group: cluster diff --git a/cmd/main.go b/cmd/main.go index e9f86a0..1d68d9c 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -44,7 +44,7 @@ import ( metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" "sigs.k8s.io/controller-runtime/pkg/webhook" - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" + libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" "github.com/projectsveltos/libsveltos/lib/crd" "github.com/projectsveltos/libsveltos/lib/logsettings" "github.com/projectsveltos/shard-controller/internal/controller" @@ -119,7 +119,7 @@ func main() { ctx := ctrl.SetupSignalHandler() logsettings.RegisterForLogSettings(ctx, - libsveltosv1alpha1.ComponentShardController, ctrl.Log.WithName("log-setter"), + libsveltosv1beta1.ComponentShardController, ctrl.Log.WithName("log-setter"), ctrl.GetConfigOrDie()) if err = (&controller.SveltosClusterReconciler{ diff --git a/go.mod b/go.mod index 180f3b1..d152a30 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/onsi/ginkgo/v2 v2.19.0 github.com/onsi/gomega v1.33.1 github.com/pkg/errors v0.9.1 - github.com/projectsveltos/libsveltos v0.32.1-0.20240611141238-c8675b616482 + github.com/projectsveltos/libsveltos v0.32.1-0.20240623114855-e2d71f6c02d4 github.com/spf13/pflag v1.0.5 golang.org/x/text v0.16.0 k8s.io/api v0.30.1 diff --git a/go.sum b/go.sum index 3c93e1f..7acb10a 100644 --- a/go.sum +++ b/go.sum @@ -110,8 +110,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/projectsveltos/libsveltos v0.32.1-0.20240611141238-c8675b616482 h1:FSLwV0I/Z4mzcfY+iP46bz1CT07AMzK34xXdPm7Fahs= -github.com/projectsveltos/libsveltos v0.32.1-0.20240611141238-c8675b616482/go.mod h1:z6avfRqeHbzqkThyqqqoGcCWMI0JBeAjdeZlbJ7P8TI= +github.com/projectsveltos/libsveltos v0.32.1-0.20240623114855-e2d71f6c02d4 h1:P7DLljBI/BmqS9hFNoN4kaTaTvnYjUBs7XKLxP4v8Sc= +github.com/projectsveltos/libsveltos v0.32.1-0.20240623114855-e2d71f6c02d4/go.mod h1:z6avfRqeHbzqkThyqqqoGcCWMI0JBeAjdeZlbJ7P8TI= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= diff --git a/internal/controller/sveltoscluster_controller.go b/internal/controller/sveltoscluster_controller.go index 15fb21f..e8072fc 100644 --- a/internal/controller/sveltoscluster_controller.go +++ b/internal/controller/sveltoscluster_controller.go @@ -25,7 +25,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/reconcile" - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" + libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" logs "github.com/projectsveltos/libsveltos/lib/logsettings" ) @@ -46,7 +46,7 @@ func (r *SveltosClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reque logger.V(logs.LogInfo).Info("Reconciling SveltosCluster") // Fecth the SveltosCluster instance - sveltosCluster := &libsveltosv1alpha1.SveltosCluster{} + sveltosCluster := &libsveltosv1beta1.SveltosCluster{} addTypeInformationToObject(r.Scheme, sveltosCluster) return reconcile.Result{}, processCluster(ctx, r.Config, r.Client, r.AgentInMgmtCluster, sveltosCluster, req, logger) @@ -55,6 +55,6 @@ func (r *SveltosClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reque // SetupWithManager sets up the controller with the Manager. func (r *SveltosClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&libsveltosv1alpha1.SveltosCluster{}). + For(&libsveltosv1beta1.SveltosCluster{}). Complete(r) } diff --git a/internal/controller/utils.go b/internal/controller/utils.go index ace5764..94e75b6 100644 --- a/internal/controller/utils.go +++ b/internal/controller/utils.go @@ -39,7 +39,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" + libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" logs "github.com/projectsveltos/libsveltos/lib/logsettings" libsveltosset "github.com/projectsveltos/libsveltos/lib/set" "github.com/projectsveltos/libsveltos/lib/sharding" @@ -89,7 +89,7 @@ func InitScheme() (*runtime.Scheme, error) { if err := clusterv1.AddToScheme(s); err != nil { return nil, err } - if err := libsveltosv1alpha1.AddToScheme(s); err != nil { + if err := libsveltosv1beta1.AddToScheme(s); err != nil { return nil, err } if err := apiextensionsv1.AddToScheme(s); err != nil { diff --git a/internal/controller/utils_test.go b/internal/controller/utils_test.go index c0c8c3d..e29aa08 100644 --- a/internal/controller/utils_test.go +++ b/internal/controller/utils_test.go @@ -33,7 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" + libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" libsveltosset "github.com/projectsveltos/libsveltos/lib/set" "github.com/projectsveltos/libsveltos/lib/sharding" "github.com/projectsveltos/shard-controller/internal/controller" @@ -187,7 +187,7 @@ var _ = Describe("Utils", func() { It("processCluster, for existing cluster, starts tracking it", func() { shardKey := randomString() - cluster := &libsveltosv1alpha1.SveltosCluster{ + cluster := &libsveltosv1beta1.SveltosCluster{ ObjectMeta: metav1.ObjectMeta{ Namespace: randomString(), Name: randomString(), @@ -223,8 +223,8 @@ var _ = Describe("Utils", func() { clusterRef := &corev1.ObjectReference{ Namespace: cluster.Namespace, Name: cluster.Name, - Kind: libsveltosv1alpha1.SveltosClusterKind, - APIVersion: libsveltosv1alpha1.GroupVersion.String(), + Kind: libsveltosv1beta1.SveltosClusterKind, + APIVersion: libsveltosv1beta1.GroupVersion.String(), } verifyClusterIsRegisteredForShard(clusterRef, shardKey) @@ -232,7 +232,7 @@ var _ = Describe("Utils", func() { Expect(testEnv.Update(context.TODO(), cluster)).To(Succeed()) Eventually(func() bool { - currentCluster := &libsveltosv1alpha1.SveltosCluster{} + currentCluster := &libsveltosv1beta1.SveltosCluster{} err = testEnv.Get(context.TODO(), types.NamespacedName{Namespace: cluster.Namespace, Name: cluster.Name}, currentCluster) if err != nil { @@ -255,7 +255,7 @@ var _ = Describe("Utils", func() { It("processCluster, for deleted cluster, stops tracking it", func() { shardKey := randomString() - cluster := &libsveltosv1alpha1.SveltosCluster{ + cluster := &libsveltosv1beta1.SveltosCluster{ ObjectMeta: metav1.ObjectMeta{ Namespace: randomString(), Name: randomString(), @@ -268,8 +268,8 @@ var _ = Describe("Utils", func() { clusterRef := &corev1.ObjectReference{ Namespace: cluster.Namespace, Name: cluster.Name, - Kind: libsveltosv1alpha1.SveltosClusterKind, - APIVersion: libsveltosv1alpha1.GroupVersion.String(), + Kind: libsveltosv1beta1.SveltosClusterKind, + APIVersion: libsveltosv1beta1.GroupVersion.String(), } req := ctrl.Request{ @@ -416,8 +416,8 @@ func getClusterRef() *corev1.ObjectReference { return &corev1.ObjectReference{ Name: randomString(), Namespace: randomString(), - Kind: string(libsveltosv1alpha1.ClusterTypeSveltos), - APIVersion: libsveltosv1alpha1.GroupVersion.String(), + Kind: string(libsveltosv1beta1.ClusterTypeSveltos), + APIVersion: libsveltosv1beta1.GroupVersion.String(), } } diff --git a/internal/test/helpers/external/sveltos-api-const.go b/internal/test/helpers/external/sveltos-api-const.go index 3cd9baf..c9593d5 100644 --- a/internal/test/helpers/external/sveltos-api-const.go +++ b/internal/test/helpers/external/sveltos-api-const.go @@ -15,5 +15,5 @@ package external const ( clusterProfileGroup = "config.projectsveltos.io" - clusterProfileTestVersion = "v1alpha1" + clusterProfileTestVersion = "v1beta1" ) diff --git a/test/fv/fv_suite_test.go b/test/fv/fv_suite_test.go index 8d416ea..57e626f 100644 --- a/test/fv/fv_suite_test.go +++ b/test/fv/fv_suite_test.go @@ -38,7 +38,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1" + libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1" "github.com/projectsveltos/libsveltos/lib/sharding" ) @@ -92,7 +92,7 @@ var _ = BeforeSuite(func() { Expect(clientgoscheme.AddToScheme(scheme)).To(Succeed()) Expect(clusterv1.AddToScheme(scheme)).To(Succeed()) - Expect(libsveltosv1alpha1.AddToScheme(scheme)).To(Succeed()) + Expect(libsveltosv1beta1.AddToScheme(scheme)).To(Succeed()) Expect(sourcev1.AddToScheme(scheme)).To(Succeed()) var err error