From 4f18f640e7d9fbfb1fe3e156156e709c7836254f Mon Sep 17 00:00:00 2001 From: Mykola Morhun Date: Fri, 17 May 2024 15:02:31 +0300 Subject: [PATCH] Move Konflux Image Controller to konflux-ci org (#111) --- .tekton/image-controller-pull-request.yaml | 2 +- .tekton/image-controller-push.yaml | 2 +- Makefile | 4 ++-- PROJECT | 4 ++-- README.md | 2 +- config/manager/kustomization.yaml | 2 +- controllers/component_image_controller.go | 6 +++--- controllers/component_image_controller_remote_test.go | 2 +- controllers/component_image_controller_test.go | 2 +- controllers/imagerepository_controller.go | 8 ++++---- controllers/imagerepository_controller_test.go | 4 ++-- controllers/imagerepository_controller_unit_test.go | 2 +- controllers/suite_test.go | 4 ++-- controllers/suite_util_test.go | 2 +- go.mod | 2 +- main.go | 10 +++++----- pkg/metrics/metrics_test.go | 5 +++-- pkg/metrics/quay.go | 3 ++- 18 files changed, 34 insertions(+), 32 deletions(-) diff --git a/.tekton/image-controller-pull-request.yaml b/.tekton/image-controller-pull-request.yaml index 25d32d1..4432481 100644 --- a/.tekton/image-controller-pull-request.yaml +++ b/.tekton/image-controller-pull-request.yaml @@ -2,7 +2,7 @@ apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: annotations: - build.appstudio.openshift.io/repo: https://github.com/redhat-appstudio/image-controller?rev={{revision}} + build.appstudio.openshift.io/repo: https://github.com/konflux-ci/image-controller?rev={{revision}} build.appstudio.redhat.com/commit_sha: '{{revision}}' build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' diff --git a/.tekton/image-controller-push.yaml b/.tekton/image-controller-push.yaml index 78f1cb1..d43ea48 100644 --- a/.tekton/image-controller-push.yaml +++ b/.tekton/image-controller-push.yaml @@ -2,7 +2,7 @@ apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: annotations: - build.appstudio.openshift.io/repo: https://github.com/redhat-appstudio/image-controller?rev={{revision}} + build.appstudio.openshift.io/repo: https://github.com/konflux-ci/image-controller?rev={{revision}} build.appstudio.redhat.com/commit_sha: '{{revision}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "3" diff --git a/Makefile b/Makefile index b5c9034..df5d0a7 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) # # For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both # appstudio.redhat.com/image-controller-bundle:$VERSION and appstudio.redhat.com/image-controller-catalog:$VERSION. -IMAGE_TAG_BASE ?= quay.io/redhat-appstudio/image-controller +IMAGE_TAG_BASE ?= quay.io/konflux-ci/image-controller # BUNDLE_IMG defines the image:tag used for the bundle. # You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=/:) @@ -47,7 +47,7 @@ ifeq ($(USE_IMAGE_DIGESTS), true) endif # Image URL to use all building/pushing image targets -IMG ?= quay.io/redhat-appstudio/image-controller +IMG ?= quay.io/konflux-ci/image-controller # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.24.2 diff --git a/PROJECT b/PROJECT index 444fc20..6e242f1 100644 --- a/PROJECT +++ b/PROJECT @@ -5,7 +5,7 @@ plugins: manifests.sdk.operatorframework.io/v2: {} scorecard.sdk.operatorframework.io/v2: {} projectName: image-controller -repo: github.com/redhat-appstudio/image-controller +repo: github.com/konflux-ci/image-controller resources: - api: crdVersion: v1 @@ -14,6 +14,6 @@ resources: domain: appstudio.redhat.com group: appstudio.redhat.com kind: ImageRepository - path: github.com/redhat-appstudio/image-controller/api/v1alpha1 + path: github.com/konflux-ci/image-controller/api/v1alpha1 version: v1alpha1 version: "3" diff --git a/README.md b/README.md index 4a54aa3..446ac6c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![codecov](https://codecov.io/gh/redhat-appstudio/image-controller/branch/main/graph/badge.svg)](https://codecov.io/gh/redhat-appstudio/image-controller) +[![codecov](https://codecov.io/gh/konflux-ci/image-controller/branch/main/graph/badge.svg)](https://codecov.io/gh/konflux-ci/image-controller) # The Image Controller for AppStudio The Image Controller operator helps set up container image repositories on Quay.io for AppStudio. diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 3d7a973..6d36746 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/redhat-appstudio/image-controller + newName: quay.io/konflux-ci/image-controller newTag: next diff --git a/controllers/component_image_controller.go b/controllers/component_image_controller.go index 785bd40..852b966 100644 --- a/controllers/component_image_controller.go +++ b/controllers/component_image_controller.go @@ -35,10 +35,10 @@ import ( ctrllog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/go-logr/logr" + l "github.com/konflux-ci/image-controller/pkg/logs" + "github.com/konflux-ci/image-controller/pkg/metrics" + "github.com/konflux-ci/image-controller/pkg/quay" appstudioredhatcomv1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" - l "github.com/redhat-appstudio/image-controller/pkg/logs" - "github.com/redhat-appstudio/image-controller/pkg/metrics" - "github.com/redhat-appstudio/image-controller/pkg/quay" remotesecretv1beta1 "github.com/redhat-appstudio/remote-secret/api/v1beta1" ) diff --git a/controllers/component_image_controller_remote_test.go b/controllers/component_image_controller_remote_test.go index 718459e..8c3a7fc 100644 --- a/controllers/component_image_controller_remote_test.go +++ b/controllers/component_image_controller_remote_test.go @@ -23,8 +23,8 @@ import ( "github.com/go-logr/logr" "github.com/h2non/gock" + "github.com/konflux-ci/image-controller/pkg/quay" appstudioredhatcomv1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" - "github.com/redhat-appstudio/image-controller/pkg/quay" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/controllers/component_image_controller_test.go b/controllers/component_image_controller_test.go index e69b120..34e1b9b 100644 --- a/controllers/component_image_controller_test.go +++ b/controllers/component_image_controller_test.go @@ -31,7 +31,7 @@ import ( k8sErrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" - "github.com/redhat-appstudio/image-controller/pkg/quay" + "github.com/konflux-ci/image-controller/pkg/quay" ) var _ = Describe("Component image controller", func() { diff --git a/controllers/imagerepository_controller.go b/controllers/imagerepository_controller.go index 904ae61..d283fef 100644 --- a/controllers/imagerepository_controller.go +++ b/controllers/imagerepository_controller.go @@ -21,15 +21,15 @@ import ( "crypto/rand" "encoding/hex" "fmt" - "github.com/redhat-appstudio/image-controller/pkg/metrics" "strings" "time" "github.com/go-logr/logr" + imagerepositoryv1alpha1 "github.com/konflux-ci/image-controller/api/v1alpha1" + l "github.com/konflux-ci/image-controller/pkg/logs" + "github.com/konflux-ci/image-controller/pkg/metrics" + "github.com/konflux-ci/image-controller/pkg/quay" appstudioredhatcomv1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" - imagerepositoryv1alpha1 "github.com/redhat-appstudio/image-controller/api/v1alpha1" - l "github.com/redhat-appstudio/image-controller/pkg/logs" - "github.com/redhat-appstudio/image-controller/pkg/quay" remotesecretv1beta1 "github.com/redhat-appstudio/remote-secret/api/v1beta1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" diff --git a/controllers/imagerepository_controller_test.go b/controllers/imagerepository_controller_test.go index 6471d24..191fd55 100644 --- a/controllers/imagerepository_controller_test.go +++ b/controllers/imagerepository_controller_test.go @@ -23,15 +23,15 @@ import ( "strings" "time" + "github.com/konflux-ci/image-controller/pkg/quay" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/redhat-appstudio/image-controller/pkg/quay" remotesecretv1beta1 "github.com/redhat-appstudio/remote-secret/api/v1beta1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - imagerepositoryv1alpha1 "github.com/redhat-appstudio/image-controller/api/v1alpha1" + imagerepositoryv1alpha1 "github.com/konflux-ci/image-controller/api/v1alpha1" ) var _ = Describe("Image repository controller", func() { diff --git a/controllers/imagerepository_controller_unit_test.go b/controllers/imagerepository_controller_unit_test.go index 882b5c2..4b0213e 100644 --- a/controllers/imagerepository_controller_unit_test.go +++ b/controllers/imagerepository_controller_unit_test.go @@ -20,7 +20,7 @@ import ( "strings" "testing" - imagerepositoryv1alpha1 "github.com/redhat-appstudio/image-controller/api/v1alpha1" + imagerepositoryv1alpha1 "github.com/konflux-ci/image-controller/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 57defeb..efc2845 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -36,9 +36,9 @@ import ( ctrl "sigs.k8s.io/controller-runtime" + imagerepositoryv1alpha1 "github.com/konflux-ci/image-controller/api/v1alpha1" + "github.com/konflux-ci/image-controller/pkg/quay" appstudioredhatcomv1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" - imagerepositoryv1alpha1 "github.com/redhat-appstudio/image-controller/api/v1alpha1" - "github.com/redhat-appstudio/image-controller/pkg/quay" remotesecretv1beta1 "github.com/redhat-appstudio/remote-secret/api/v1beta1" //+kubebuilder:scaffold:imports ) diff --git a/controllers/suite_util_test.go b/controllers/suite_util_test.go index 77fe248..df5ec07 100644 --- a/controllers/suite_util_test.go +++ b/controllers/suite_util_test.go @@ -31,8 +31,8 @@ import ( "k8s.io/apimachinery/pkg/selection" "k8s.io/apimachinery/pkg/types" + imagerepositoryv1alpha1 "github.com/konflux-ci/image-controller/api/v1alpha1" appstudioapiv1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" - imagerepositoryv1alpha1 "github.com/redhat-appstudio/image-controller/api/v1alpha1" remotesecretv1beta1 "github.com/redhat-appstudio/remote-secret/api/v1beta1" ) diff --git a/go.mod b/go.mod index 750f026..0559c98 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/redhat-appstudio/image-controller +module github.com/konflux-ci/image-controller go 1.20 diff --git a/main.go b/main.go index 3caf778..895be61 100644 --- a/main.go +++ b/main.go @@ -19,10 +19,8 @@ package main import ( "flag" "fmt" - "github.com/redhat-appstudio/image-controller/pkg/metrics" "net/http" "os" - cmetrics "sigs.k8s.io/controller-runtime/pkg/metrics" "strings" // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) @@ -43,12 +41,14 @@ import ( "sigs.k8s.io/controller-runtime/pkg/metrics/server" "github.com/go-logr/logr" + "github.com/konflux-ci/image-controller/pkg/metrics" appstudioredhatcomv1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" remotesecretv1beta1 "github.com/redhat-appstudio/remote-secret/api/v1beta1" + cmetrics "sigs.k8s.io/controller-runtime/pkg/metrics" - imagerepositoryv1alpha1 "github.com/redhat-appstudio/image-controller/api/v1alpha1" - "github.com/redhat-appstudio/image-controller/controllers" - "github.com/redhat-appstudio/image-controller/pkg/quay" + imagerepositoryv1alpha1 "github.com/konflux-ci/image-controller/api/v1alpha1" + "github.com/konflux-ci/image-controller/controllers" + "github.com/konflux-ci/image-controller/pkg/quay" //+kubebuilder:scaffold:imports ) diff --git a/pkg/metrics/metrics_test.go b/pkg/metrics/metrics_test.go index ee9c2f5..e5a4fb3 100644 --- a/pkg/metrics/metrics_test.go +++ b/pkg/metrics/metrics_test.go @@ -2,11 +2,12 @@ package metrics import ( "context" + "testing" + "github.com/go-logr/logr" + "github.com/konflux-ci/image-controller/pkg/quay" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/testutil" - "github.com/redhat-appstudio/image-controller/pkg/quay" - "testing" ) func TestRegisterMetrics(t *testing.T) { diff --git a/pkg/metrics/quay.go b/pkg/metrics/quay.go index 10f3b7a..6a69315 100644 --- a/pkg/metrics/quay.go +++ b/pkg/metrics/quay.go @@ -3,9 +3,10 @@ package metrics import ( "context" "fmt" + "github.com/go-logr/logr" + "github.com/konflux-ci/image-controller/pkg/quay" "github.com/prometheus/client_golang/prometheus" - "github.com/redhat-appstudio/image-controller/pkg/quay" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" )