diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f32308bfb..fde8159b3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,7 @@ env: # 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. - CONTRIB_DOCKER_USR: ${{ secrets.CONTRIB_DOCKER_USR }} - XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }} - AWS_USR: ${{ secrets.AWS_USR }} + DOCKER_USR: ${{ github.actor }} jobs: detect-noop: @@ -317,35 +315,23 @@ jobs: name: output path: _output/** - - name: Login to Docker + - name: Login to GHCR uses: docker/login-action@v1 - if: env.CONTRIB_DOCKER_USR != '' + if: env.DOCKER_USR != '' with: - username: ${{ secrets.CONTRIB_DOCKER_USR }} - password: ${{ secrets.CONTRIB_DOCKER_PSW }} - - - 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: Publish Artifacts to S3 and Docker Hub + registry: ghcr.io + username: ${{ secrets.DOCKER_USR }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish Artifacts to GHCR run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/} - if: env.AWS_USR != '' && env.CONTRIB_DOCKER_USR != '' + if: env.DOCKER_USR != '' env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }} GIT_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Promote Artifacts in S3 and Docker Hub - if: github.ref == 'refs/heads/master' && env.AWS_USR != '' && env.CONTRIB_DOCKER_USR != '' + - name: Promote Artifacts in Docker Hub + if: github.ref == 'refs/heads/master' && env.DOCKER_USR != '' run: make -j2 promote env: BRANCH_NAME: master CHANNEL: master - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }} - diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index a8767e60b2..14e20227dc 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -15,11 +15,7 @@ env: # Common versions GO_VERSION: '1.18' - # 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. - CONTRIB_DOCKER_USR: ${{ secrets.CONTRIB_DOCKER_USR }} - AWS_USR: ${{ secrets.AWS_USR }} + DOCKER_USR: ${{ github.actor }} jobs: promote-artifacts: @@ -39,19 +35,18 @@ jobs: - name: Fetch History run: git fetch --prune --unshallow - - name: Login to Docker + - name: Login to GHCR uses: docker/login-action@v1 - if: env.CONTRIB_DOCKER_USR != '' + if: env.DOCKER_USR != '' with: - username: ${{ secrets.CONTRIB_DOCKER_USR }} - password: ${{ secrets.CONTRIB_DOCKER_PSW }} + registry: ghcr.io + username: ${{ secrets.DOCKER_USR }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Promote Artifacts in S3 and Docker Hub - if: env.AWS_USR != '' && env.CONTRIB_DOCKER_USR != '' + - name: Promote Artifacts in GHCR + if: env.DOCKER_USR != '' run: make -j2 promote BRANCH_NAME=${GITHUB_REF##*/} env: VERSION: ${{ github.event.inputs.version }} CHANNEL: ${{ github.event.inputs.channel }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }} diff --git a/Makefile b/Makefile index ea01e0d69c..e74922cfe8 100644 --- a/Makefile +++ b/Makefile @@ -61,10 +61,7 @@ IMAGES = provider-aws # ==================================================================================== # Setup XPKG -XPKG_REG_ORGS ?= xpkg.upbound.io/crossplane-contrib index.docker.io/crossplanecontrib -# NOTE(hasheddan): skip promoting on xpkg.upbound.io as channel tags are -# inferred. -XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/crossplane-contrib +XPKG_REG_ORGS ?= ghcr.io/infobloxopen XPKGS = provider-aws -include build/makelib/xpkg.mk diff --git a/pkg/controller/rds/dbinstance/setup.go b/pkg/controller/rds/dbinstance/setup.go index 91eddaf1c4..ddd5791aa9 100644 --- a/pkg/controller/rds/dbinstance/setup.go +++ b/pkg/controller/rds/dbinstance/setup.go @@ -30,6 +30,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" aws "github.com/crossplane-contrib/provider-aws/pkg/clients" dbinstance "github.com/crossplane-contrib/provider-aws/pkg/clients/rds" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/rds" "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) @@ -450,6 +451,15 @@ func (e *custom) isUpToDate(cr *svcapitypes.DBInstance, out *svcsdk.DescribeDBIn cmpopts.IgnoreFields(svcapitypes.CustomDBInstanceParameters{}, "DeleteAutomatedBackups"), ) + // for tagging: at least one option must be added, modified, or removed. + tagsUpToDate, _ := svcutils.AreTagsUpToDate(e.client, cr.Spec.ForProvider.Tags, cr.Status.AtProvider.DBInstanceARN) + if !tagsUpToDate { + err := svcutils.UpdateTagsForResource(e.client, cr.Spec.ForProvider.Tags, cr.Status.AtProvider.DBInstanceARN) + if err != nil { + return true, aws.Wrap(err, errDescribe) + } + } + if diff == "" && !maintenanceWindowChanged && !backupWindowChanged && !versionChanged && !vpcSGsChanged && !dbParameterGroupChanged && !optionGroupChanged { return true, nil }