From c703a666ffd00cbfcfdb135ae306db3349ce72ca Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 22 Dec 2021 10:36:52 +1100 Subject: [PATCH] initial re-namespace --- .../workflows/{lagoon-kbd.yaml => remote-controller.yaml} | 3 ++- PROJECT | 2 +- README.md | 6 +++--- api/v1alpha1/zz_generated.deepcopy.go | 1 + build-push.sh | 4 ++-- config/default/kustomization.yaml | 4 ++-- config/manager/kustomization.yaml | 2 +- controller-test.sh | 6 +++--- controllers/helpers.go | 2 +- controllers/lagoon_harborintegration.go | 2 +- controllers/lagoonbuild_controller.go | 4 ++-- controllers/lagoonbuild_deletionhandlers.go | 2 +- controllers/lagoonbuild_helpers.go | 2 +- controllers/lagoonbuild_qoshandler.go | 2 +- controllers/lagoonbuild_standardhandler.go | 2 +- controllers/lagoonmonitor_buildhandlers.go | 2 +- controllers/lagoonmonitor_controller.go | 4 ++-- controllers/lagoonmonitor_taskhandlers.go | 2 +- controllers/lagoontask_controller.go | 2 +- controllers/suite_test.go | 2 +- go.mod | 2 +- handlers/helpers.go | 2 +- handlers/message_queue.go | 2 +- handlers/misctask_handler.go | 2 +- handlers/resource_cleanup.go | 2 +- helm-update.sh | 2 +- main.go | 6 +++--- test-resources/example-project1.yaml | 2 +- test-resources/example-project2.yaml | 2 +- 29 files changed, 40 insertions(+), 38 deletions(-) rename .github/workflows/{lagoon-kbd.yaml => remote-controller.yaml} (97%) diff --git a/.github/workflows/lagoon-kbd.yaml b/.github/workflows/remote-controller.yaml similarity index 97% rename from .github/workflows/lagoon-kbd.yaml rename to .github/workflows/remote-controller.yaml index 7ed05976..16c4e78d 100644 --- a/.github/workflows/lagoon-kbd.yaml +++ b/.github/workflows/remote-controller.yaml @@ -1,9 +1,10 @@ -name: Lagoon KBD Test +name: Lagoon Remote Controller Test on: push: branches: - main + - re-namespace pull_request: branches: - main diff --git a/PROJECT b/PROJECT index 93a5a472..fa156a65 100644 --- a/PROJECT +++ b/PROJECT @@ -1,5 +1,5 @@ domain: amazee.io -repo: github.com/amazeeio/lagoon-kbd +repo: github.com/uselagoon/remote-controller resources: - group: lagoon kind: LagoonBuild diff --git a/README.md b/README.md index f8f99122..a5f00e9d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ There is currently no documentation for how to do this, we may release more info Using [Helm 3](https://helm.sh/docs/intro/install/) ``` -helm repo add lagoon-builddeploy https://raw.githubusercontent.com/amazeeio/lagoon-kbd/main/charts +helm repo add lagoon-builddeploy https://raw.githubusercontent.com/uselagoon/remote-controller/main/charts ## with rabbitmq support for communicating with a lagoon messaging queue helm upgrade --install -n lagoon-builddeploy lagoon-builddeploy lagoon-builddeploy/lagoon-builddeploy \ @@ -49,7 +49,7 @@ You will need to install any prerequisites for kubebuilder [see here](https://bo # install any requirements make install # deploy the actual handler -make IMG=amazeeio/lagoon-builddeploy:latest deploy +make IMG=uselagoon/remote-controller:latest deploy ``` ## LagoonBuild Spec @@ -62,7 +62,7 @@ metadata: spec: build: ci: 'false' # this is a string, not a bool - image: amazeeio/kubectl-build-deploy-dind:v1.8.1 + image: uselagoon/kubectl-build-deploy-dind:v1.8.1 type: branch gitReference: origin/main openshift: false diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index df53ce5b..c3f4edfd 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/build-push.sh b/build-push.sh index d0890bc2..14230670 100755 --- a/build-push.sh +++ b/build-push.sh @@ -1,6 +1,6 @@ #!/bin/bash -REPO=${2:-amazeeio} +REPO=${2:-uselagoon} TAG=${1:-latest} -IMGNAME=${3:-lagoon-builddeploy} +IMGNAME=${3:-remote-controller} echo "Creating image for $REPO/${IMGNAME}:$TAG and pushing to docker hub" make IMG=$REPO/${IMGNAME}:$TAG docker-build && make IMG=$REPO/${IMGNAME}:$TAG docker-push diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 1c32b936..d22ccc90 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,12 +1,12 @@ # Adds namespace to all resources. -namespace: lagoon-kbd-system +namespace: remote-controller-system # Value of this field is prepended to the # names of all resources, e.g. a deployment named # "wordpress" becomes "alices-wordpress". # Note that it should also match with the prefix (text before '-') of the namespace # field above. -namePrefix: lagoon-kbd- +namePrefix: remote-controller- # Labels to add to all resources and selectors. #commonLabels: diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 6f0d463d..66e873ab 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: amazeeio/lagoon-builddeploy + newName: uselagoon/remote-controller newTag: test-tag diff --git a/controller-test.sh b/controller-test.sh index 7c67a631..52894674 100755 --- a/controller-test.sh +++ b/controller-test.sh @@ -8,10 +8,10 @@ KIND_VER=v1.17.5 # or get the latest tagged version of a specific k8s version of kind #KIND_VER=$(curl -s https://hub.docker.com/v2/repositories/kindest/node/tags | jq -r '.results | .[].name' | grep 'v1.17' | sort -Vr | head -1) KIND_NAME=chart-testing -CONTROLLER_IMAGE=amazeeio/lagoon-builddeploy:test-tag +CONTROLLER_IMAGE=uselagoon/remote-controller:test-tag -CONTROLLER_NAMESPACE=lagoon-kbd-system +CONTROLLER_NAMESPACE=remote-controller-system CHECK_TIMEOUT=20 NS=drupal-example-install @@ -238,7 +238,7 @@ echo ' \"spec\": { \"build\": { \"ci\": \"true\", - \"image\": \"amazeeio\/kubectl-build-deploy-dind:latest\", + \"image\": \"uselagoon\/kubectl-build-deploy-dind:latest\", \"type\": \"branch\" }, \"gitReference\": \"origin\/install\", diff --git a/controllers/helpers.go b/controllers/helpers.go index fb5bfdb1..45b99e65 100644 --- a/controllers/helpers.go +++ b/controllers/helpers.go @@ -13,8 +13,8 @@ import ( "strings" "time" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/go-logr/logr" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" apierrors "k8s.io/apimachinery/pkg/api/errors" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/lagoon_harborintegration.go b/controllers/lagoon_harborintegration.go index a170ff4d..f35e7512 100644 --- a/controllers/lagoon_harborintegration.go +++ b/controllers/lagoon_harborintegration.go @@ -9,11 +9,11 @@ import ( "encoding/json" "time" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/go-logr/logr" harborv2 "github.com/mittwald/goharbor-client/v3/apiv2" "github.com/mittwald/goharbor-client/v3/apiv2/model" "github.com/mittwald/goharbor-client/v3/apiv2/model/legacy" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/lagoonbuild_controller.go b/controllers/lagoonbuild_controller.go index 4f3f76ad..2a35ec71 100644 --- a/controllers/lagoonbuild_controller.go +++ b/controllers/lagoonbuild_controller.go @@ -28,8 +28,8 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" - "github.com/amazeeio/lagoon-kbd/handlers" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" + "github.com/uselagoon/remote-controller/handlers" // Openshift ) diff --git a/controllers/lagoonbuild_deletionhandlers.go b/controllers/lagoonbuild_deletionhandlers.go index 48c97317..99b63024 100644 --- a/controllers/lagoonbuild_deletionhandlers.go +++ b/controllers/lagoonbuild_deletionhandlers.go @@ -10,8 +10,8 @@ import ( "strings" "time" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/go-logr/logr" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" "gopkg.in/matryer/try.v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" diff --git a/controllers/lagoonbuild_helpers.go b/controllers/lagoonbuild_helpers.go index 6f5d490d..a21433cf 100644 --- a/controllers/lagoonbuild_helpers.go +++ b/controllers/lagoonbuild_helpers.go @@ -17,8 +17,8 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/go-logr/logr" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" // Openshift projectv1 "github.com/openshift/api/project/v1" diff --git a/controllers/lagoonbuild_qoshandler.go b/controllers/lagoonbuild_qoshandler.go index 670144e3..60fa3ab5 100644 --- a/controllers/lagoonbuild_qoshandler.go +++ b/controllers/lagoonbuild_qoshandler.go @@ -6,8 +6,8 @@ import ( "fmt" "sort" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/go-logr/logr" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/lagoonbuild_standardhandler.go b/controllers/lagoonbuild_standardhandler.go index edda172a..a97b5746 100644 --- a/controllers/lagoonbuild_standardhandler.go +++ b/controllers/lagoonbuild_standardhandler.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/go-logr/logr" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/lagoonmonitor_buildhandlers.go b/controllers/lagoonmonitor_buildhandlers.go index 01a81ab6..52856418 100644 --- a/controllers/lagoonmonitor_buildhandlers.go +++ b/controllers/lagoonmonitor_buildhandlers.go @@ -10,8 +10,8 @@ import ( "strings" "time" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/go-logr/logr" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" diff --git a/controllers/lagoonmonitor_controller.go b/controllers/lagoonmonitor_controller.go index 980a9a4d..9f24f88d 100644 --- a/controllers/lagoonmonitor_controller.go +++ b/controllers/lagoonmonitor_controller.go @@ -21,9 +21,9 @@ import ( "fmt" "io" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" - "github.com/amazeeio/lagoon-kbd/handlers" "github.com/go-logr/logr" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" + "github.com/uselagoon/remote-controller/handlers" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/lagoonmonitor_taskhandlers.go b/controllers/lagoonmonitor_taskhandlers.go index e5a92a1e..953b8859 100644 --- a/controllers/lagoonmonitor_taskhandlers.go +++ b/controllers/lagoonmonitor_taskhandlers.go @@ -8,8 +8,8 @@ import ( "fmt" "time" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/go-logr/logr" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" diff --git a/controllers/lagoontask_controller.go b/controllers/lagoontask_controller.go index cad63777..2144b917 100644 --- a/controllers/lagoontask_controller.go +++ b/controllers/lagoontask_controller.go @@ -31,7 +31,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" // openshift oappsv1 "github.com/openshift/api/apps/v1" ) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 0ccac2c9..58528078 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/go.mod b/go.mod index efb2ace1..9e326c89 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/amazeeio/lagoon-kbd +module github.com/uselagoon/remote-controller go 1.16 diff --git a/handlers/helpers.go b/handlers/helpers.go index 6caba1e4..b64bfeec 100644 --- a/handlers/helpers.go +++ b/handlers/helpers.go @@ -11,7 +11,7 @@ import ( "strings" "time" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" apierrors "k8s.io/apimachinery/pkg/api/errors" ) diff --git a/handlers/message_queue.go b/handlers/message_queue.go index 1c79351b..a58dc60a 100644 --- a/handlers/message_queue.go +++ b/handlers/message_queue.go @@ -8,8 +8,8 @@ import ( "strings" "time" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/cheshir/go-mq" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" "gopkg.in/matryer/try.v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" diff --git a/handlers/misctask_handler.go b/handlers/misctask_handler.go index fc5bb9f5..8a948ed3 100644 --- a/handlers/misctask_handler.go +++ b/handlers/misctask_handler.go @@ -6,8 +6,8 @@ import ( "fmt" "time" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" "github.com/go-logr/logr" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/handlers/resource_cleanup.go b/handlers/resource_cleanup.go index c922e944..e195eafb 100644 --- a/handlers/resource_cleanup.go +++ b/handlers/resource_cleanup.go @@ -11,7 +11,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" ) type cleanup interface { diff --git a/helm-update.sh b/helm-update.sh index 12c59493..01485fd2 100755 --- a/helm-update.sh +++ b/helm-update.sh @@ -29,7 +29,7 @@ case $1 in helm delete -n lagoon-builddeploy lagoon-builddeploy ;; install) - helm repo add lagoon-builddeploy https://raw.githubusercontent.com/amazeeio/lagoon-kbd/main/charts + helm repo add lagoon-builddeploy https://raw.githubusercontent.com/uselagoon/remote-controller/main/charts helm upgrade --install -n lagoon-builddeploy lagoon-builddeploy lagoon-builddeploy/lagoon-builddeploy ;; install-tgz) diff --git a/main.go b/main.go index fcc15fd9..a67365dc 100644 --- a/main.go +++ b/main.go @@ -25,10 +25,10 @@ import ( "strings" "time" - lagoonv1alpha1 "github.com/amazeeio/lagoon-kbd/api/v1alpha1" - "github.com/amazeeio/lagoon-kbd/controllers" - "github.com/amazeeio/lagoon-kbd/handlers" "github.com/cheshir/go-mq" + lagoonv1alpha1 "github.com/uselagoon/remote-controller/api/v1alpha1" + "github.com/uselagoon/remote-controller/controllers" + "github.com/uselagoon/remote-controller/handlers" str2duration "github.com/xhit/go-str2duration/v2" "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" diff --git a/test-resources/example-project1.yaml b/test-resources/example-project1.yaml index 5de349ef..38cc628a 100644 --- a/test-resources/example-project1.yaml +++ b/test-resources/example-project1.yaml @@ -5,7 +5,7 @@ metadata: spec: build: ci: 'true' #to make sure that readwritemany is changed to readwriteonce - image: amazeeio/kubectl-build-deploy-dind:latest + image: uselagoon/kubectl-build-deploy-dind:latest type: branch gitReference: origin/install project: diff --git a/test-resources/example-project2.yaml b/test-resources/example-project2.yaml index 39bfcaa7..b74cdbbe 100644 --- a/test-resources/example-project2.yaml +++ b/test-resources/example-project2.yaml @@ -5,7 +5,7 @@ metadata: spec: build: ci: 'true' #to make sure that readwritemany is changed to readwriteonce - image: amazeeio/kubectl-build-deploy-dind:latest + image: uselagoon/kubectl-build-deploy-dind:latest type: branch gitReference: origin/install project: