From 93769cf295be5cd1830859b670b81bd83174d7d4 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 19 Sep 2022 10:06:09 +0000 Subject: [PATCH] :art: Rebrand to Kairos See: https://github.com/kairos-io/kairos/issues/88 --- .github/workflows/image.yml | 2 +- .github/workflows/tool-image.yml | 2 +- Makefile | 8 ++++---- PROJECT | 8 ++++---- api/v1alpha1/groupversion_info.go | 6 +++--- config/crd/bases/build.c3os-x.io_osartifacts.yaml | 4 ++-- config/crd/kustomization.yaml | 2 +- config/crd/patches/cainjection_in_osartifacts.yaml | 2 +- config/crd/patches/webhook_in_osartifacts.yaml | 2 +- config/manager/controller_manager_config.yaml | 2 +- config/manager/kustomization.yaml | 2 +- config/rbac/osartifact_editor_role.yaml | 4 ++-- config/rbac/osartifact_viewer_role.yaml | 4 ++-- config/rbac/role.yaml | 6 +++--- config/rbac/role_custom.yaml | 8 ++++---- config/samples/build_v1alpha1_osartifact.yaml | 2 +- controllers/configmap.go | 2 +- controllers/deployment.go | 2 +- controllers/osartifact_controller.go | 8 ++++---- controllers/service.go | 2 +- controllers/suite_test.go | 2 +- go.mod | 2 +- main.go | 8 ++++---- script/test.sh | 2 +- tests/e2e/e2e_simple_test.go | 12 ++++++------ tests/e2e/e2e_suite_test.go | 2 +- tests/fixtures/simple.yaml | 8 ++++---- 27 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 0ff7941..914a02b 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -18,7 +18,7 @@ jobs: - name: Prepare id: prep run: | - DOCKER_IMAGE=quay.io/c3os/osbuilder + DOCKER_IMAGE=quay.io/kairos/osbuilder VERSION=latest SHORTREF=${GITHUB_SHA::8} # If this is git tag, use the tag name as a docker tag diff --git a/.github/workflows/tool-image.yml b/.github/workflows/tool-image.yml index f703f51..e263462 100644 --- a/.github/workflows/tool-image.yml +++ b/.github/workflows/tool-image.yml @@ -18,7 +18,7 @@ jobs: - name: Prepare id: prep run: | - DOCKER_IMAGE=quay.io/c3os/osbuilder-tools + DOCKER_IMAGE=quay.io/kairos/osbuilder-tools VERSION=latest SHORTREF=${GITHUB_SHA::8} # If this is git tag, use the tag name as a docker tag diff --git a/Makefile b/Makefile index eb228e4..6b172ca 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) VERSION ?= 0.0.1 -IMG ?= quay.io/c3os/osbuilder:test -CLUSTER_NAME?="c3os-osbuilder-e2e" +IMG ?= quay.io/kairos/osbuilder:test +CLUSTER_NAME?="kairos-osbuilder-e2e" export ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) # CHANNELS define the bundle channels used in the bundle. @@ -31,8 +31,8 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) # This variable is used to construct full image tags for bundle and catalog images. # # For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both -# c3os-x.io/osbuilder-operator-bundle:$VERSION and c3os-x.io/osbuilder-operator-catalog:$VERSION. -IMAGE_TAG_BASE ?= c3os-x.io/osbuilder-operator +# kairos.io/osbuilder-bundle:$VERSION and kairos.io/osbuilder-catalog:$VERSION. +IMAGE_TAG_BASE ?= kairos.io/osbuilder # BUNDLE_IMG defines the image:tag used for the bundle. # You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=/:) diff --git a/PROJECT b/PROJECT index 4d5e725..630ead4 100644 --- a/PROJECT +++ b/PROJECT @@ -1,19 +1,19 @@ -domain: c3os-x.io +domain: kairos.io layout: - go.kubebuilder.io/v3 plugins: manifests.sdk.operatorframework.io/v2: {} scorecard.sdk.operatorframework.io/v2: {} projectName: osartifactbuilder-operator -repo: github.com/c3os-io/osbuilder-operator +repo: github.com/kairos-io/osbuilder resources: - api: crdVersion: v1 namespaced: true controller: true - domain: c3os-x.io + domain: kairos.io group: build kind: OSArtifact - path: github.com/c3os-io/osbuilder-operator/api/v1alpha1 + path: github.com/kairos-io/osbuilder/api/v1alpha1 version: v1alpha1 version: "3" diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go index c107365..739435f 100644 --- a/api/v1alpha1/groupversion_info.go +++ b/api/v1alpha1/groupversion_info.go @@ -15,8 +15,8 @@ limitations under the License. */ // Package v1alpha1 contains API Schema definitions for the build v1alpha1 API group -//+kubebuilder:object:generate=true -//+groupName=build.c3os-x.io +// +kubebuilder:object:generate=true +// +groupName=build.kairos.io package v1alpha1 import ( @@ -26,7 +26,7 @@ import ( var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "build.c3os-x.io", Version: "v1alpha1"} + GroupVersion = schema.GroupVersion{Group: "build.kairos.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/config/crd/bases/build.c3os-x.io_osartifacts.yaml b/config/crd/bases/build.c3os-x.io_osartifacts.yaml index 47cbe28..f64d57d 100644 --- a/config/crd/bases/build.c3os-x.io_osartifacts.yaml +++ b/config/crd/bases/build.c3os-x.io_osartifacts.yaml @@ -5,9 +5,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.9.0 creationTimestamp: null - name: osartifacts.build.c3os-x.io + name: osartifacts.build.kairos.io spec: - group: build.c3os-x.io + group: build.kairos.io names: kind: OSArtifact listKind: OSArtifactList diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 594cdb9..7a07db9 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -2,7 +2,7 @@ # since it depends on service name and namespace that are out of this kustomize package. # It should be run by config/default resources: -- bases/build.c3os-x.io_osartifacts.yaml +- bases/build.kairos.io_osartifacts.yaml #+kubebuilder:scaffold:crdkustomizeresource patchesStrategicMerge: diff --git a/config/crd/patches/cainjection_in_osartifacts.yaml b/config/crd/patches/cainjection_in_osartifacts.yaml index a8fb3a9..2d7a8f7 100644 --- a/config/crd/patches/cainjection_in_osartifacts.yaml +++ b/config/crd/patches/cainjection_in_osartifacts.yaml @@ -4,4 +4,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: osartifacts.build.c3os-x.io + name: osartifacts.build.kairos.io diff --git a/config/crd/patches/webhook_in_osartifacts.yaml b/config/crd/patches/webhook_in_osartifacts.yaml index 13dc302..0dd798c 100644 --- a/config/crd/patches/webhook_in_osartifacts.yaml +++ b/config/crd/patches/webhook_in_osartifacts.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: osartifacts.build.c3os-x.io + name: osartifacts.build.kairos.io spec: conversion: strategy: Webhook diff --git a/config/manager/controller_manager_config.yaml b/config/manager/controller_manager_config.yaml index cc5c481..d95dc28 100644 --- a/config/manager/controller_manager_config.yaml +++ b/config/manager/controller_manager_config.yaml @@ -8,7 +8,7 @@ webhook: port: 9443 leaderElection: leaderElect: true - resourceName: 98ca89ca.c3os-x.io + resourceName: 98ca89ca.kairos.io # leaderElectionReleaseOnCancel defines if the leader should step down volume # when the Manager ends. This requires the binary to immediately end when the # Manager is stopped, otherwise, this setting is unsafe. Setting this significantly diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 98aad23..7a33ce9 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -12,5 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: quay.io/c3os/osbuilder + newName: quay.io/kairos/osbuilder newTag: test diff --git a/config/rbac/osartifact_editor_role.yaml b/config/rbac/osartifact_editor_role.yaml index 3f77ce7..543ea08 100644 --- a/config/rbac/osartifact_editor_role.yaml +++ b/config/rbac/osartifact_editor_role.yaml @@ -5,7 +5,7 @@ metadata: name: osartifact-editor-role rules: - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts verbs: @@ -17,7 +17,7 @@ rules: - update - watch - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts/status verbs: diff --git a/config/rbac/osartifact_viewer_role.yaml b/config/rbac/osartifact_viewer_role.yaml index 7886d3e..c56a639 100644 --- a/config/rbac/osartifact_viewer_role.yaml +++ b/config/rbac/osartifact_viewer_role.yaml @@ -5,7 +5,7 @@ metadata: name: osartifact-viewer-role rules: - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts verbs: @@ -13,7 +13,7 @@ rules: - list - watch - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts/status verbs: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 3d3b25f..49cdc45 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -6,7 +6,7 @@ metadata: name: manager-role rules: - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts verbs: @@ -18,13 +18,13 @@ rules: - update - watch - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts/finalizers verbs: - update - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts/status verbs: diff --git a/config/rbac/role_custom.yaml b/config/rbac/role_custom.yaml index c0ad139..d3f8bd2 100644 --- a/config/rbac/role_custom.yaml +++ b/config/rbac/role_custom.yaml @@ -6,7 +6,7 @@ metadata: name: manager-role rules: - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts verbs: @@ -18,13 +18,13 @@ rules: - update - watch - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts/finalizers verbs: - update - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts/status verbs: @@ -32,7 +32,7 @@ rules: - patch - update - apiGroups: - - build.c3os-x.io + - build.kairos.io resources: - osartifacts/finalizers verbs: diff --git a/config/samples/build_v1alpha1_osartifact.yaml b/config/samples/build_v1alpha1_osartifact.yaml index fd1bf32..1f243d0 100644 --- a/config/samples/build_v1alpha1_osartifact.yaml +++ b/config/samples/build_v1alpha1_osartifact.yaml @@ -1,4 +1,4 @@ -apiVersion: build.c3os-x.io/v1alpha1 +apiVersion: build.kairos.io/v1alpha1 kind: OSArtifact metadata: name: osartifact-sample diff --git a/controllers/configmap.go b/controllers/configmap.go index e7fbae4..6d252b0 100644 --- a/controllers/configmap.go +++ b/controllers/configmap.go @@ -17,7 +17,7 @@ limitations under the License. package controllers import ( - buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1" + buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/deployment.go b/controllers/deployment.go index 6b0a632..b3ad611 100644 --- a/controllers/deployment.go +++ b/controllers/deployment.go @@ -19,7 +19,7 @@ package controllers import ( "fmt" - buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1" + buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" diff --git a/controllers/osartifact_controller.go b/controllers/osartifact_controller.go index acce07b..6060961 100644 --- a/controllers/osartifact_controller.go +++ b/controllers/osartifact_controller.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1" + buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1" "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -53,9 +53,9 @@ func genOwner(artifact buildv1alpha1.OSArtifact) []metav1.OwnerReference { } } -//+kubebuilder:rbac:groups=build.c3os-x.io,resources=osartifacts,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=build.c3os-x.io,resources=osartifacts/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=build.c3os-x.io,resources=osartifacts/finalizers,verbs=update +//+kubebuilder:rbac:groups=build.kairos.io,resources=osartifacts,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=build.kairos.io,resources=osartifacts/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=build.kairos.io,resources=osartifacts/finalizers,verbs=update // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. diff --git a/controllers/service.go b/controllers/service.go index c67b964..21f805c 100644 --- a/controllers/service.go +++ b/controllers/service.go @@ -17,7 +17,7 @@ limitations under the License. package controllers import ( - buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1" + buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 0336735..b97f98e 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -30,7 +30,7 @@ import ( logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" - buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1" + buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1" //+kubebuilder:scaffold:imports ) diff --git a/go.mod b/go.mod index bce6e91..cd230d5 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/c3os-io/osbuilder-operator +module github.com/kairos-io/osbuilder go 1.18 diff --git a/main.go b/main.go index 65aa094..61a2ae5 100644 --- a/main.go +++ b/main.go @@ -31,8 +31,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" - buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1" - "github.com/c3os-io/osbuilder-operator/controllers" + buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1" + "github.com/kairos-io/osbuilder/controllers" //+kubebuilder:scaffold:imports ) @@ -56,7 +56,7 @@ func main() { flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") flag.StringVar(&serveImage, "serve-image", "nginx", "Serve image.") // It needs luet inside - flag.StringVar(&toolImage, "tool-image", "quay.io/c3os/osbuilder-tools:latest", "Tool image.") + flag.StringVar(&toolImage, "tool-image", "quay.io/kairos/osbuilder-tools:latest", "Tool image.") flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") flag.BoolVar(&enableLeaderElection, "leader-elect", false, @@ -76,7 +76,7 @@ func main() { Port: 9443, HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, - LeaderElectionID: "98ca89ca.c3os-x.io", + LeaderElectionID: "98ca89ca.kairos.io", // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily // when the Manager ends. This requires the binary to immediately end when the // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly diff --git a/script/test.sh b/script/test.sh index 99021c7..6985134 100755 --- a/script/test.sh +++ b/script/test.sh @@ -1,7 +1,7 @@ #!/bin/bash KUBE_VERSION=${KUBE_VERSION:-v1.22.7} -CLUSTER_NAME="${CLUSTER_NAME:-c3os-osbuilder-e2e}" +CLUSTER_NAME="${CLUSTER_NAME:-kairos-osbuilder-e2e}" if ! kind get clusters | grep "$CLUSTER_NAME"; then cat << EOF > kind.config diff --git a/tests/e2e/e2e_simple_test.go b/tests/e2e/e2e_simple_test.go index 469e431..bce4cd4 100644 --- a/tests/e2e/e2e_simple_test.go +++ b/tests/e2e/e2e_simple_test.go @@ -13,7 +13,7 @@ var _ = Describe("ISO build test", func() { Context("registration", func() { AfterEach(func() { - kubectl.New().Delete("osartifacts", "-n", "default", "hello-c3os") + kubectl.New().Delete("osartifacts", "-n", "default", "hello-kairos") }) It("creates a simple iso", func() { @@ -21,16 +21,16 @@ var _ = Describe("ISO build test", func() { Expect(err).ToNot(HaveOccurred()) Eventually(func() string { - b, _ := kubectl.GetData("default", "osartifacts", "hello-c3os", "jsonpath={.spec.imageName}") + b, _ := kubectl.GetData("default", "osartifacts", "hello-kairos", "jsonpath={.spec.imageName}") return string(b) - }, 2*time.Minute, 2*time.Second).Should(Equal("quay.io/c3os/c3os:opensuse-latest")) + }, 2*time.Minute, 2*time.Second).Should(Equal("quay.io/kairos/kairos:opensuse-latest")) Eventually(func() string { - b, _ := kubectl.GetData("default", "deployments", "hello-c3os", "jsonpath={.spec.template.metadata.labels.osbuild}") + b, _ := kubectl.GetData("default", "deployments", "hello-kairos", "jsonpath={.spec.template.metadata.labels.osbuild}") return string(b) - }, 2*time.Minute, 2*time.Second).Should(Equal("workloadhello-c3os")) + }, 2*time.Minute, 2*time.Second).Should(Equal("workloadhello-kairos")) Eventually(func() string { - b, _ := kubectl.GetData("default", "deployments", "hello-c3os", "jsonpath={.spec.status.unavailableReplicas}") + b, _ := kubectl.GetData("default", "deployments", "hello-kairos", "jsonpath={.spec.status.unavailableReplicas}") return string(b) }, 15*time.Minute, 2*time.Second).ShouldNot(Equal("1")) }) diff --git a/tests/e2e/e2e_suite_test.go b/tests/e2e/e2e_suite_test.go index 2f4045f..217810c 100644 --- a/tests/e2e/e2e_suite_test.go +++ b/tests/e2e/e2e_suite_test.go @@ -9,5 +9,5 @@ import ( func TestE2e(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "c3os-operator e2e test Suite") + RunSpecs(t, "kairos-operator e2e test Suite") } diff --git a/tests/fixtures/simple.yaml b/tests/fixtures/simple.yaml index 99a5460..212b607 100644 --- a/tests/fixtures/simple.yaml +++ b/tests/fixtures/simple.yaml @@ -1,12 +1,12 @@ -apiVersion: build.c3os-x.io/v1alpha1 +apiVersion: build.kairos.io/v1alpha1 kind: OSArtifact metadata: - name: hello-c3os + name: hello-kairos spec: - imageName: "quay.io/c3os/c3os:opensuse-latest" + imageName: "quay.io/kairos/core-opensuse:latest" iso: true bundles: - - quay.io/c3os/packages:goreleaser-utils-1.11.1 + - quay.io/kairos/packages:goreleaser-utils-1.11.1 grubConfig: | search --file --set=root /boot/kernel.xz set default=0