From 8a83e1ff34831e5e7d82e032c8be9d315e42e0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kesser?= Date: Thu, 22 Jun 2023 14:52:52 +0200 Subject: [PATCH 1/2] feat: move to dkb-bank MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Kesser --- .github/workflows/ci.yml | 111 +++++-------- .github/workflows/issue-triage.yml | 13 ++ .github/workflows/uptest-all.yml | 157 ++++++++++++++++++ Makefile | 8 +- README.md | 10 +- apis/castai/v1alpha1/zz_autoscaler_types.go | 2 +- .../v1alpha1/zz_nodeconfiguration_types.go | 2 +- .../zz_nodeconfigurationdefault_types.go | 4 +- apis/castai/v1alpha1/zz_nodetemplate_types.go | 4 +- .../v1alpha1/zz_rebalancingjob_types.go | 4 +- apis/zz_register.go | 6 +- cmd/generator/main.go | 2 +- cmd/provider/main.go | 12 +- config/autoscaler/config.go | 2 +- config/eksclusterid/config.go | 2 +- config/nodeconfiguration/config.go | 2 +- config/nodeconfigurationdefault/config.go | 4 +- config/nodetemplate/config.go | 4 +- config/provider.go | 18 +- config/rebalancingjob/config.go | 4 +- examples/install.yaml | 2 +- go.mod | 2 +- internal/clients/castai.go | 2 +- .../castai/autoscaler/zz_controller.go | 4 +- .../castai/ekscluster/zz_controller.go | 4 +- .../castai/eksclusterid/zz_controller.go | 4 +- .../castai/nodeconfiguration/zz_controller.go | 4 +- .../nodeconfigurationdefault/zz_controller.go | 4 +- .../castai/nodetemplate/zz_controller.go | 4 +- .../castai/rebalancingjob/zz_controller.go | 4 +- .../rebalancingschedule/zz_controller.go | 4 +- internal/controller/providerconfig/config.go | 2 +- internal/controller/zz_setup.go | 18 +- 33 files changed, 284 insertions(+), 145 deletions(-) create mode 100644 .github/workflows/issue-triage.yml create mode 100644 .github/workflows/uptest-all.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dc4dce..517d8a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,12 @@ env: GOLANGCI_VERSION: 'v1.50.0' DOCKER_BUILDX_VERSION: 'v0.8.2' - # Common users. We can't run a step 'if secrets.XXX != ""' but we can run a - # step 'if env.XXX != ""', so we copy these to succinctly test whether + # Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run + # a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether # credentials have been provided before trying to run steps that need them. - UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} + XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }} + DOCKER_USR: ${{ secrets.DOCKER_USR }} + AWS_USR: ${{ secrets.AWS_USR }} jobs: detect-noop: @@ -27,13 +29,12 @@ jobs: steps: - name: Detect No-op Changes id: noop - uses: fkirc/skip-duplicate-actions@v5.3.0 + uses: fkirc/skip-duplicate-actions@v2.0.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} paths_ignore: '["**.md", "**.png", "**.jpg"]' do_not_skip: '["workflow_dispatch", "schedule", "push"]' - lint: runs-on: ubuntu-22.04 needs: detect-noop @@ -52,17 +53,17 @@ jobs: - name: Find the Go Build Cache id: go - run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT + run: echo "::set-output name=cache::$(make go.cachedir)" - name: Cache the Go Build Cache - uses: actions/cache@v3 + uses: actions/cache@v2 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-lint-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-lint- - name: Cache Go Dependencies - uses: actions/cache@v3 + uses: actions/cache@v2 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} @@ -99,17 +100,17 @@ jobs: - name: Find the Go Build Cache id: go - run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT + run: echo "::set-output name=cache::$(make go.cachedir)" - name: Cache the Go Build Cache - uses: actions/cache@v3 + uses: actions/cache@v2 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-check-diff- - name: Cache Go Dependencies - uses: actions/cache@v3 + uses: actions/cache@v2 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} @@ -142,17 +143,17 @@ jobs: - name: Find the Go Build Cache id: go - run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT + run: echo "::set-output name=cache::$(make go.cachedir)" - name: Cache the Go Build Cache - uses: actions/cache@v3 + uses: actions/cache@v2 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-unit-tests- - name: Cache Go Dependencies - uses: actions/cache@v3 + uses: actions/cache@v2 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} @@ -170,49 +171,6 @@ jobs: flags: unittests file: _output/tests/linux_amd64/coverage.txt - local-deploy: - runs-on: ubuntu-22.04 - needs: detect-noop - if: needs.detect-noop.outputs.noop != 'true' - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: true - - - name: Fetch History - run: git fetch --prune --unshallow - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Find the Go Build Cache - id: go - run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - - - name: Cache the Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go.outputs.cache }} - key: ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-build-unit-tests- - - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - - name: Vendor Dependencies - run: make vendor vendor.check - - - name: Deploying locally built provider package - run: make local-deploy - publish-artifacts: runs-on: ubuntu-22.04 needs: detect-noop @@ -225,19 +183,11 @@ jobs: platforms: all - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v1 with: version: ${{ env.DOCKER_BUILDX_VERSION }} install: true - - name: Login to Upbound - uses: docker/login-action@v2 - if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != '' - with: - registry: xpkg.upbound.io - username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} - password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }} - - name: Checkout uses: actions/checkout@v2 with: @@ -253,17 +203,17 @@ jobs: - name: Find the Go Build Cache id: go - run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT + run: echo "::set-output name=cache::$(make go.cachedir)" - name: Cache the Go Build Cache - uses: actions/cache@v3 + uses: actions/cache@v2 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-publish-artifacts- - name: Cache Go Dependencies - uses: actions/cache@v3 + uses: actions/cache@v2 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} @@ -278,12 +228,31 @@ jobs: # We're using docker buildx, which doesn't actually load the images it # builds by default. Specifying --load does so. BUILD_ARGS: "--load" - - - name: Upload Artifacts to GitHub + + - name: Publish Artifacts to GitHub uses: actions/upload-artifact@v2 with: name: output path: _output/** + - name: Login to Upbound + uses: docker/login-action@v1 + if: env.XPKG_ACCESS_ID != '' + with: + registry: xpkg.upbound.io + username: ${{ secrets.XPKG_ACCESS_ID }} + password: ${{ secrets.XPKG_TOKEN }} + + - name: Login to Docker + uses: docker/login-action@v1 + if: env.DOCKER_USR != '' + with: + username: ${{ secrets.DOCKER_USR }} + password: ${{ secrets.DOCKER_PSW }} + - name: Publish Artifacts run: make publish BRANCH_NAME=${GITHUB_REF##*/} + if: env.XPKG_ACCESS_ID != '' + env: + UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.XPKG_ACCESS_ID }} + UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW: ${{ secrets.XPKG_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml new file mode 100644 index 0000000..3ace073 --- /dev/null +++ b/.github/workflows/issue-triage.yml @@ -0,0 +1,13 @@ +name: Issue Triage + +on: + issues: + types: + - opened + - unlabeled + +jobs: + community-issue-triage: + uses: upbound/uptest/.github/workflows/issue-triage.yml@main + secrets: + UPBOUND_BOT_GITHUB_TOKEN: ${{ secrets.UPBOUND_COMMUNITY_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml new file mode 100644 index 0000000..cb456f1 --- /dev/null +++ b/.github/workflows/uptest-all.yml @@ -0,0 +1,157 @@ +name: Uptest All + +on: + workflow_dispatch: {} + +env: + # Common versions + GO_VERSION: '1.19' + DOCKER_BUILDX_VERSION: 'v0.8.2' + +jobs: + detect-api-groups: + runs-on: ubuntu-22.04 + outputs: + api_groups: ${{ steps.api-groups.outputs.list }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - name: Detect Api Groups + id: api-groups + run: | + export API_GROUPS="" + for i in $(ls -d examples/*/); do API_GROUPS="${API_GROUPS},${i}"; done + + OUTPUT=$(python3 -c "\ + import os, sys; \ + value = os.getenv('API_GROUPS'); \ + list = value.split(','); \ + print(list[1:]); \ + ") + echo "Api Groups: $OUTPUT" + echo "::set-output name=list::${OUTPUT}" + + uptest: + runs-on: ubuntu-22.04 + needs: detect-api-groups + strategy: + fail-fast: false + matrix: + api-groups: ${{ fromJson(needs.detect-api-groups.outputs.api_groups) }} + exclude: + - api-groups: examples/providerconfig/ + steps: + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: all + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + version: ${{ env.DOCKER_BUILDX_VERSION }} + install: true + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + + - name: Fetch History + run: git fetch --prune --unshallow + + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Find the Go Build Cache + id: go + run: echo "::set-output name=cache::$(go env GOCACHE)" + + - name: Cache the Go Build Cache + uses: actions/cache@v2 + with: + path: ${{ steps.go.outputs.cache }} + key: ${{ runner.os }}-build-uptest-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-build-uptest- + + - name: Cache Go Dependencies + uses: actions/cache@v2 + with: + path: .work/pkg + key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-pkg- + + - name: Vendor Dependencies + run: make vendor vendor.check + + - name: Build Artifacts + run: make -j2 build.all + env: + # We're using docker buildx, which doesn't actually load the images it + # builds by default. Specifying --load does so. + BUILD_ARGS: "--load" + + - name: Prepare The Example List + id: prepare-example-list + run: | + cd .. + EXAMPLE_LIST="" + EXAMPLE_LIST="${EXAMPLE_LIST},$(find ${{ matrix.api-groups }} -name '*.yaml' | tr '\n' ',')" + echo "::set-output name=example-list::${EXAMPLE_LIST:1}" + echo "Examples: ${EXAMPLE_LIST:1}" + + - name: Run Uptest + id: run-uptest + env: + UPTEST_AWS_CREDS: ${{ secrets.UPTEST_AWS_CREDS }} + EXAMPLE_LIST: ${{ needs.get-example-list.outputs.example_list }} + UPTEST_EXAMPLE_VALUE_REPLACEMENTS: ${{ secrets.UPTEST_EXAMPLE_VALUE_REPLACEMENTS }} + DUMP_DIRECTORY: "./_output/cluster-dump" + run: make uptest + + - name: Collect Cluster Dump + if: always() + run: | + export DUMP_DIRECTORY=./_output/cluster-dump + make cluster_dump + + - name: Upload Cluster Dump + if: always() + uses: actions/upload-artifact@v3 + with: + name: cluster-dump-aws + path: ./_output/cluster-dump + + - name: Cleanup + if: always() + run: | + kubectl delete managed --all + + report: + runs-on: ubuntu-22.04 + needs: uptest + if: always() + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - name: Manual Intervention Report + run: | + echo "Total Resources for AWS: $(cat examples/*/* | grep -o "kind: " | wc -l)" + echo "Number of Skipped Resources: $(grep -r -o "upjet.upbound.io/manual-intervention" examples/* | wc -l)" + echo "Skipped Manifests (Manual Intervention): $(grep -r -o "upjet.upbound.io/manual-intervention" examples/*)" + - name: Coverage Report + run: | + OUTPUT=$(gh api -H "Accept: application/vnd.github+json" /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq '.jobs | .[] | select(.name!="detect-api-groups" and .name!="report") | .name + " -> " + .conclusion') + FAILURE=$(echo ${OUTPUT} | grep -o 'failure' | wc -l) + SUCCESS=$(echo ${OUTPUT} | grep -o 'success' | wc -l) + echo "Success: ${SUCCESS}" + echo "Failure: ${FAILURE}" + echo "${OUTPUT}" diff --git a/Makefile b/Makefile index a87ada4..bda6563 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Setup Project PROJECT_NAME ?= provider-castai -PROJECT_REPO ?= github.com/haarchri/$(PROJECT_NAME) +PROJECT_REPO ?= github.com/dkb-bank/$(PROJECT_NAME) export TERRAFORM_VERSION ?= 1.3.3 @@ -59,17 +59,17 @@ UPTEST_VERSION = v0.2.1 # ==================================================================================== # Setup Images -REGISTRY_ORGS ?= index.docker.io/haarchri +REGISTRY_ORGS ?= index.docker.io/platformdkbcf IMAGES = $(PROJECT_NAME) -include build/makelib/imagelight.mk # ==================================================================================== # Setup XPKG -XPKG_REG_ORGS ?= index.docker.io/haarchri +XPKG_REG_ORGS ?= index.docker.io/platformdkbcf # NOTE(hasheddan): skip promoting on xpkg.upbound.io as channel tags are # inferred. -XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/haarchri +XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/dkb-bank XPKGS = $(PROJECT_NAME) -include build/makelib/xpkg.mk diff --git a/README.md b/README.md index b89c53b..d1e2aa9 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ CastAI API. ## Getting Started Install the provider by using the following command after changing the image tag -to the [latest release](https://marketplace.upbound.io/providers/haarchri/provider-castai): +to the [latest release](https://marketplace.upbound.io/providers/dkb-bank/provider-castai): ``` -up ctp provider install haarchri/provider-castai:v0.1.0 +up ctp provider install dkb-bank/provider-castai:v0.1.0 ``` Alternatively, you can use declarative installation: @@ -21,7 +21,7 @@ kind: Provider metadata: name: provider-castai spec: - package: haarchri/provider-castai:v0.1.0 + package: dkb-bank/provider-castai:v0.1.0 EOF ``` @@ -59,7 +59,7 @@ spec: Notice that in this example Provider resource is referencing ControllerConfig with debug enabled. -You can see the API reference [here](https://doc.crds.dev/github.com/haarchri/provider-castai). +You can see the API reference [here](https://doc.crds.dev/github.com/dkb-bank/provider-castai). ## Developing @@ -89,4 +89,4 @@ make build ## Report a Bug For filing bugs, suggesting improvements, or requesting new features, please -open an [issue](https://github.com/haarchri/provider-castai/issues). +open an [issue](https://github.com/dkb-bank/provider-castai/issues). diff --git a/apis/castai/v1alpha1/zz_autoscaler_types.go b/apis/castai/v1alpha1/zz_autoscaler_types.go index 2442f00..b314390 100755 --- a/apis/castai/v1alpha1/zz_autoscaler_types.go +++ b/apis/castai/v1alpha1/zz_autoscaler_types.go @@ -34,7 +34,7 @@ type AutoScalerParameters struct { AutoscalerPoliciesJSON *string `json:"autoscalerPoliciesJson,omitempty" tf:"autoscaler_policies_json,omitempty"` // CAST AI cluster id - // +crossplane:generate:reference:type=github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId + // +crossplane:generate:reference:type=github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId // +kubebuilder:validation:Optional ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` diff --git a/apis/castai/v1alpha1/zz_nodeconfiguration_types.go b/apis/castai/v1alpha1/zz_nodeconfiguration_types.go index fb76b1b..1b6d8b4 100755 --- a/apis/castai/v1alpha1/zz_nodeconfiguration_types.go +++ b/apis/castai/v1alpha1/zz_nodeconfiguration_types.go @@ -182,7 +182,7 @@ type NodeConfigurationParameters struct { Aks []AksParameters `json:"aks,omitempty" tf:"aks,omitempty"` // CAST AI cluster id - // +crossplane:generate:reference:type=github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId + // +crossplane:generate:reference:type=github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId // +kubebuilder:validation:Optional ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` diff --git a/apis/castai/v1alpha1/zz_nodeconfigurationdefault_types.go b/apis/castai/v1alpha1/zz_nodeconfigurationdefault_types.go index 2e45642..cfcf608 100755 --- a/apis/castai/v1alpha1/zz_nodeconfigurationdefault_types.go +++ b/apis/castai/v1alpha1/zz_nodeconfigurationdefault_types.go @@ -27,7 +27,7 @@ type NodeConfigurationDefaultObservation struct { type NodeConfigurationDefaultParameters struct { // CAST AI cluster id - // +crossplane:generate:reference:type=github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId + // +crossplane:generate:reference:type=github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId // +kubebuilder:validation:Optional ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` @@ -40,7 +40,7 @@ type NodeConfigurationDefaultParameters struct { ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` // Id of the node configuration - // +crossplane:generate:reference:type=github.com/haarchri/provider-castai/apis/castai/v1alpha1.NodeConfiguration + // +crossplane:generate:reference:type=github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.NodeConfiguration // +kubebuilder:validation:Optional ConfigurationID *string `json:"configurationId,omitempty" tf:"configuration_id,omitempty"` diff --git a/apis/castai/v1alpha1/zz_nodetemplate_types.go b/apis/castai/v1alpha1/zz_nodetemplate_types.go index 1e8e375..f045731 100755 --- a/apis/castai/v1alpha1/zz_nodetemplate_types.go +++ b/apis/castai/v1alpha1/zz_nodetemplate_types.go @@ -244,7 +244,7 @@ type NodeTemplateObservation struct { type NodeTemplateParameters struct { // CAST AI cluster id. - // +crossplane:generate:reference:type=github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId + // +crossplane:generate:reference:type=github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId // +kubebuilder:validation:Optional ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` @@ -257,7 +257,7 @@ type NodeTemplateParameters struct { ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` // CAST AI node configuration id to be used for node template. - // +crossplane:generate:reference:type=github.com/haarchri/provider-castai/apis/castai/v1alpha1.NodeConfiguration + // +crossplane:generate:reference:type=github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.NodeConfiguration // +kubebuilder:validation:Optional ConfigurationID *string `json:"configurationId,omitempty" tf:"configuration_id,omitempty"` diff --git a/apis/castai/v1alpha1/zz_rebalancingjob_types.go b/apis/castai/v1alpha1/zz_rebalancingjob_types.go index 141cd05..8d18efe 100755 --- a/apis/castai/v1alpha1/zz_rebalancingjob_types.go +++ b/apis/castai/v1alpha1/zz_rebalancingjob_types.go @@ -30,7 +30,7 @@ type RebalancingJobObservation struct { type RebalancingJobParameters struct { // CAST AI cluster id. - // +crossplane:generate:reference:type=github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId + // +crossplane:generate:reference:type=github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId // +kubebuilder:validation:Optional ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` @@ -47,7 +47,7 @@ type RebalancingJobParameters struct { Enabled *bool `json:"enabled,omitempty" tf:"enabled,omitempty"` // Rebalancing schedule of this job. - // +crossplane:generate:reference:type=github.com/haarchri/provider-castai/apis/castai/v1alpha1.RebalancingSchedule + // +crossplane:generate:reference:type=github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.RebalancingSchedule // +kubebuilder:validation:Optional RebalancingScheduleID *string `json:"rebalancingScheduleId,omitempty" tf:"rebalancing_schedule_id,omitempty"` diff --git a/apis/zz_register.go b/apis/zz_register.go index 1531661..3285f93 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -10,9 +10,9 @@ package apis import ( "k8s.io/apimachinery/pkg/runtime" - v1alpha1 "github.com/haarchri/provider-castai/apis/castai/v1alpha1" - v1alpha1apis "github.com/haarchri/provider-castai/apis/v1alpha1" - v1beta1 "github.com/haarchri/provider-castai/apis/v1beta1" + v1alpha1 "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1" + v1alpha1apis "github.com/dkb-bank/provider-castai/apis/v1alpha1" + v1beta1 "github.com/dkb-bank/provider-castai/apis/v1beta1" ) func init() { diff --git a/cmd/generator/main.go b/cmd/generator/main.go index 3fc3f47..f91a54a 100644 --- a/cmd/generator/main.go +++ b/cmd/generator/main.go @@ -11,7 +11,7 @@ import ( "github.com/upbound/upjet/pkg/pipeline" - "github.com/haarchri/provider-castai/config" + "github.com/dkb-bank/provider-castai/config" ) func main() { diff --git a/cmd/provider/main.go b/cmd/provider/main.go index 7bfef31..5e68925 100644 --- a/cmd/provider/main.go +++ b/cmd/provider/main.go @@ -24,12 +24,12 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/log/zap" - "github.com/haarchri/provider-castai/apis" - "github.com/haarchri/provider-castai/apis/v1alpha1" - "github.com/haarchri/provider-castai/config" - "github.com/haarchri/provider-castai/internal/clients" - "github.com/haarchri/provider-castai/internal/controller" - "github.com/haarchri/provider-castai/internal/features" + "github.com/dkb-bank/provider-castai/apis" + "github.com/dkb-bank/provider-castai/apis/v1alpha1" + "github.com/dkb-bank/provider-castai/config" + "github.com/dkb-bank/provider-castai/internal/clients" + "github.com/dkb-bank/provider-castai/internal/controller" + "github.com/dkb-bank/provider-castai/internal/features" ) func main() { diff --git a/config/autoscaler/config.go b/config/autoscaler/config.go index 581c3ef..f669a82 100644 --- a/config/autoscaler/config.go +++ b/config/autoscaler/config.go @@ -11,7 +11,7 @@ func Configure(p *config.Provider) { r.Kind = "AutoScaler" r.References = config.References{ "cluster_id": { - Type: "github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId", + Type: "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId", }, } }) diff --git a/config/eksclusterid/config.go b/config/eksclusterid/config.go index 224e3e0..d582482 100644 --- a/config/eksclusterid/config.go +++ b/config/eksclusterid/config.go @@ -11,7 +11,7 @@ func Configure(p *config.Provider) { r.Kind = "EksClusterId" r.References = config.References{ "cluster_id": { - Type: "github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksCluster", + Type: "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksCluster", }, } }) diff --git a/config/nodeconfiguration/config.go b/config/nodeconfiguration/config.go index 74a27c6..b3b7ccc 100644 --- a/config/nodeconfiguration/config.go +++ b/config/nodeconfiguration/config.go @@ -11,7 +11,7 @@ func Configure(p *config.Provider) { r.Kind = "NodeConfiguration" r.References = config.References{ "cluster_id": { - Type: "github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId", + Type: "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId", }, } }) diff --git a/config/nodeconfigurationdefault/config.go b/config/nodeconfigurationdefault/config.go index 1b7b45e..9302ce7 100644 --- a/config/nodeconfigurationdefault/config.go +++ b/config/nodeconfigurationdefault/config.go @@ -11,10 +11,10 @@ func Configure(p *config.Provider) { r.Kind = "NodeConfigurationDefault" r.References = config.References{ "cluster_id": { - Type: "github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId", + Type: "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId", }, "configuration_id": { - Type: "github.com/haarchri/provider-castai/apis/castai/v1alpha1.NodeConfiguration", + Type: "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.NodeConfiguration", }, } }) diff --git a/config/nodetemplate/config.go b/config/nodetemplate/config.go index 3261fd3..bb50c67 100644 --- a/config/nodetemplate/config.go +++ b/config/nodetemplate/config.go @@ -11,10 +11,10 @@ func Configure(p *config.Provider) { r.Kind = "NodeTemplate" r.References = config.References{ "cluster_id": { - Type: "github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId", + Type: "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId", }, "configuration_id": { - Type: "github.com/haarchri/provider-castai/apis/castai/v1alpha1.NodeConfiguration", + Type: "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.NodeConfiguration", }, } }) diff --git a/config/provider.go b/config/provider.go index 20d7a59..8ac27d2 100644 --- a/config/provider.go +++ b/config/provider.go @@ -10,19 +10,19 @@ import ( ujconfig "github.com/upbound/upjet/pkg/config" - autoscaler "github.com/haarchri/provider-castai/config/autoscaler" - ekscluster "github.com/haarchri/provider-castai/config/ekscluster" - eksclusterid "github.com/haarchri/provider-castai/config/eksclusterid" - nodeconfiguration "github.com/haarchri/provider-castai/config/nodeconfiguration" - nodeconfigurationdefault "github.com/haarchri/provider-castai/config/nodeconfigurationdefault" - nodetemplate "github.com/haarchri/provider-castai/config/nodetemplate" - rebalancingjob "github.com/haarchri/provider-castai/config/rebalancingjob" - rebalancingschedule "github.com/haarchri/provider-castai/config/rebalancingschedule" + autoscaler "github.com/dkb-bank/provider-castai/config/autoscaler" + ekscluster "github.com/dkb-bank/provider-castai/config/ekscluster" + eksclusterid "github.com/dkb-bank/provider-castai/config/eksclusterid" + nodeconfiguration "github.com/dkb-bank/provider-castai/config/nodeconfiguration" + nodeconfigurationdefault "github.com/dkb-bank/provider-castai/config/nodeconfigurationdefault" + nodetemplate "github.com/dkb-bank/provider-castai/config/nodetemplate" + rebalancingjob "github.com/dkb-bank/provider-castai/config/rebalancingjob" + rebalancingschedule "github.com/dkb-bank/provider-castai/config/rebalancingschedule" ) const ( resourcePrefix = "castai" - modulePath = "github.com/haarchri/provider-castai" + modulePath = "github.com/dkb-bank/provider-castai" ) //go:embed schema.json diff --git a/config/rebalancingjob/config.go b/config/rebalancingjob/config.go index 82da9d3..1743ebf 100644 --- a/config/rebalancingjob/config.go +++ b/config/rebalancingjob/config.go @@ -11,10 +11,10 @@ func Configure(p *config.Provider) { r.Kind = "RebalancingJob" r.References = config.References{ "cluster_id": { - Type: "github.com/haarchri/provider-castai/apis/castai/v1alpha1.EksClusterId", + Type: "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.EksClusterId", }, "rebalancing_schedule_id": { - Type: "github.com/haarchri/provider-castai/apis/castai/v1alpha1.RebalancingSchedule", + Type: "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1.RebalancingSchedule", }, } }) diff --git a/examples/install.yaml b/examples/install.yaml index 8f784b7..624ba6c 100644 --- a/examples/install.yaml +++ b/examples/install.yaml @@ -3,4 +3,4 @@ kind: Provider metadata: name: provider-castai spec: - package: haarchri/provider-castai:v0.1.0 + package: dkb-bank/provider-castai:v0.1.0 diff --git a/go.mod b/go.mod index 012953f..c14ceec 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/haarchri/provider-castai +module github.com/dkb-bank/provider-castai go 1.19 diff --git a/internal/clients/castai.go b/internal/clients/castai.go index deef227..c80b26c 100644 --- a/internal/clients/castai.go +++ b/internal/clients/castai.go @@ -15,7 +15,7 @@ import ( "github.com/upbound/upjet/pkg/terraform" - "github.com/haarchri/provider-castai/apis/v1beta1" + "github.com/dkb-bank/provider-castai/apis/v1beta1" ) const ( diff --git a/internal/controller/castai/autoscaler/zz_controller.go b/internal/controller/castai/autoscaler/zz_controller.go index 45edb02..5a5c09a 100755 --- a/internal/controller/castai/autoscaler/zz_controller.go +++ b/internal/controller/castai/autoscaler/zz_controller.go @@ -18,8 +18,8 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/haarchri/provider-castai/apis/castai/v1alpha1" - features "github.com/haarchri/provider-castai/internal/features" + v1alpha1 "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1" + features "github.com/dkb-bank/provider-castai/internal/features" ) // Setup adds a controller that reconciles AutoScaler managed resources. diff --git a/internal/controller/castai/ekscluster/zz_controller.go b/internal/controller/castai/ekscluster/zz_controller.go index 357802a..d6758a8 100755 --- a/internal/controller/castai/ekscluster/zz_controller.go +++ b/internal/controller/castai/ekscluster/zz_controller.go @@ -18,8 +18,8 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/haarchri/provider-castai/apis/castai/v1alpha1" - features "github.com/haarchri/provider-castai/internal/features" + v1alpha1 "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1" + features "github.com/dkb-bank/provider-castai/internal/features" ) // Setup adds a controller that reconciles EksCluster managed resources. diff --git a/internal/controller/castai/eksclusterid/zz_controller.go b/internal/controller/castai/eksclusterid/zz_controller.go index e23a790..7d87c4b 100755 --- a/internal/controller/castai/eksclusterid/zz_controller.go +++ b/internal/controller/castai/eksclusterid/zz_controller.go @@ -18,8 +18,8 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/haarchri/provider-castai/apis/castai/v1alpha1" - features "github.com/haarchri/provider-castai/internal/features" + v1alpha1 "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1" + features "github.com/dkb-bank/provider-castai/internal/features" ) // Setup adds a controller that reconciles EksClusterId managed resources. diff --git a/internal/controller/castai/nodeconfiguration/zz_controller.go b/internal/controller/castai/nodeconfiguration/zz_controller.go index af01d55..df63b7b 100755 --- a/internal/controller/castai/nodeconfiguration/zz_controller.go +++ b/internal/controller/castai/nodeconfiguration/zz_controller.go @@ -18,8 +18,8 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/haarchri/provider-castai/apis/castai/v1alpha1" - features "github.com/haarchri/provider-castai/internal/features" + v1alpha1 "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1" + features "github.com/dkb-bank/provider-castai/internal/features" ) // Setup adds a controller that reconciles NodeConfiguration managed resources. diff --git a/internal/controller/castai/nodeconfigurationdefault/zz_controller.go b/internal/controller/castai/nodeconfigurationdefault/zz_controller.go index ef6f205..68a8033 100755 --- a/internal/controller/castai/nodeconfigurationdefault/zz_controller.go +++ b/internal/controller/castai/nodeconfigurationdefault/zz_controller.go @@ -18,8 +18,8 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/haarchri/provider-castai/apis/castai/v1alpha1" - features "github.com/haarchri/provider-castai/internal/features" + v1alpha1 "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1" + features "github.com/dkb-bank/provider-castai/internal/features" ) // Setup adds a controller that reconciles NodeConfigurationDefault managed resources. diff --git a/internal/controller/castai/nodetemplate/zz_controller.go b/internal/controller/castai/nodetemplate/zz_controller.go index f860c47..c2abac3 100755 --- a/internal/controller/castai/nodetemplate/zz_controller.go +++ b/internal/controller/castai/nodetemplate/zz_controller.go @@ -18,8 +18,8 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/haarchri/provider-castai/apis/castai/v1alpha1" - features "github.com/haarchri/provider-castai/internal/features" + v1alpha1 "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1" + features "github.com/dkb-bank/provider-castai/internal/features" ) // Setup adds a controller that reconciles NodeTemplate managed resources. diff --git a/internal/controller/castai/rebalancingjob/zz_controller.go b/internal/controller/castai/rebalancingjob/zz_controller.go index 23670d9..e22cefc 100755 --- a/internal/controller/castai/rebalancingjob/zz_controller.go +++ b/internal/controller/castai/rebalancingjob/zz_controller.go @@ -18,8 +18,8 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/haarchri/provider-castai/apis/castai/v1alpha1" - features "github.com/haarchri/provider-castai/internal/features" + v1alpha1 "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1" + features "github.com/dkb-bank/provider-castai/internal/features" ) // Setup adds a controller that reconciles RebalancingJob managed resources. diff --git a/internal/controller/castai/rebalancingschedule/zz_controller.go b/internal/controller/castai/rebalancingschedule/zz_controller.go index bb7fdf7..d7c6d60 100755 --- a/internal/controller/castai/rebalancingschedule/zz_controller.go +++ b/internal/controller/castai/rebalancingschedule/zz_controller.go @@ -18,8 +18,8 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/haarchri/provider-castai/apis/castai/v1alpha1" - features "github.com/haarchri/provider-castai/internal/features" + v1alpha1 "github.com/dkb-bank/provider-castai/apis/castai/v1alpha1" + features "github.com/dkb-bank/provider-castai/internal/features" ) // Setup adds a controller that reconciles RebalancingSchedule managed resources. diff --git a/internal/controller/providerconfig/config.go b/internal/controller/providerconfig/config.go index 360b5a4..b61509f 100644 --- a/internal/controller/providerconfig/config.go +++ b/internal/controller/providerconfig/config.go @@ -13,7 +13,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/upbound/upjet/pkg/controller" - "github.com/haarchri/provider-castai/apis/v1beta1" + "github.com/dkb-bank/provider-castai/apis/v1beta1" ) // Setup adds a controller that reconciles ProviderConfigs by accounting for diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 3760a97..e721ae4 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -9,15 +9,15 @@ import ( "github.com/upbound/upjet/pkg/controller" - autoscaler "github.com/haarchri/provider-castai/internal/controller/castai/autoscaler" - ekscluster "github.com/haarchri/provider-castai/internal/controller/castai/ekscluster" - eksclusterid "github.com/haarchri/provider-castai/internal/controller/castai/eksclusterid" - nodeconfiguration "github.com/haarchri/provider-castai/internal/controller/castai/nodeconfiguration" - nodeconfigurationdefault "github.com/haarchri/provider-castai/internal/controller/castai/nodeconfigurationdefault" - nodetemplate "github.com/haarchri/provider-castai/internal/controller/castai/nodetemplate" - rebalancingjob "github.com/haarchri/provider-castai/internal/controller/castai/rebalancingjob" - rebalancingschedule "github.com/haarchri/provider-castai/internal/controller/castai/rebalancingschedule" - providerconfig "github.com/haarchri/provider-castai/internal/controller/providerconfig" + autoscaler "github.com/dkb-bank/provider-castai/internal/controller/castai/autoscaler" + ekscluster "github.com/dkb-bank/provider-castai/internal/controller/castai/ekscluster" + eksclusterid "github.com/dkb-bank/provider-castai/internal/controller/castai/eksclusterid" + nodeconfiguration "github.com/dkb-bank/provider-castai/internal/controller/castai/nodeconfiguration" + nodeconfigurationdefault "github.com/dkb-bank/provider-castai/internal/controller/castai/nodeconfigurationdefault" + nodetemplate "github.com/dkb-bank/provider-castai/internal/controller/castai/nodetemplate" + rebalancingjob "github.com/dkb-bank/provider-castai/internal/controller/castai/rebalancingjob" + rebalancingschedule "github.com/dkb-bank/provider-castai/internal/controller/castai/rebalancingschedule" + providerconfig "github.com/dkb-bank/provider-castai/internal/controller/providerconfig" ) // Setup creates all controllers with the supplied logger and adds them to From 9e93ae7412719efd904f10194bcf9234a49ea779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kesser?= Date: Thu, 22 Jun 2023 14:56:37 +0200 Subject: [PATCH 2/2] feat: add annotations for marketplace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Kesser --- package/crossplane.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/crossplane.yaml b/package/crossplane.yaml index 6a67191..ee4dd73 100644 --- a/package/crossplane.yaml +++ b/package/crossplane.yaml @@ -2,3 +2,12 @@ apiVersion: meta.pkg.crossplane.io/v1alpha1 kind: Provider metadata: name: provider-castai + annotations: + meta.crossplane.io/maintainer: "Deutsche Kreditbank AG " + meta.crossplane.io/source: "github.com/dkb-bank/provider-castai" + meta.crossplane.io/license: "Apache2" + meta.crossplane.io/description: "Crossplane provider generated from https://github.com/castai/terraform-provider-castai." + meta.crossplane.io/readme: | + # Castai Provider + This provider is generated from https://github.com/castai/terraform-provider-castai by https://github.com/upbound/upjet. + See the [examples directory in the source repository](https://github.com/dkb-bank/provider-castai/tree/main/examples/) for examples on how to use this provider. \ No newline at end of file