Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECR ReplicationConfiguration not working as expected #1877

Closed
invalidred opened this issue Sep 20, 2023 · 1 comment
Closed

ECR ReplicationConfiguration not working as expected #1877

invalidred opened this issue Sep 20, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@invalidred
Copy link

invalidred commented Sep 20, 2023

What happened?

I am using provider-aws-ecr and having issues with ReplicationConfiguration where when I add repositoryFilter array, I get the following error

CannotObserveExternalResource 38s (x16 over 12m) managed/ecr.aws.upbound.io/v1beta1, kind=replicationconfiguration cannot run refresh: refresh failed: Insufficient destination blocks: A │
│ t least 1 "destination" blocks are required.

I am following the ReplicationConfiguration Schema and I should be able to have rule with destination and reposityFilter. However whenever I add respositoryFilter I get the error above.

apiVersion: ecr.aws.upbound.io/v1beta1
kind: ReplicationConfiguration
metadata:
  name: peo-server-repo
spec:
  forProvider:
    region: us-west-2
    replicationConfiguration:
      - rule:
          - destination:
              - region: us-west-2
                registryId: <some-string>
          - repositoryFilter:
              - filter: peo-server-repo-prod
                filterType: PREFIX_MATCH
  providerConfigRef:
    name: aws-provider

How can we reproduce it?

The below does create an ecr repository, but fails to to create ReplicationConfiguration

---
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-aws-ecr
spec:
  package: xpkg.upbound.io/upbound/provider-aws-ecr:v0.40.0
  controllerConfigRef:
    name: aws-config
---
apiVersion: ecr.aws.upbound.io/v1beta1
kind: Repository
metadata:
  name: peo-server-repo
spec:
  forProvider:
    imageScanningConfiguration:
      - scanOnPush: false
    imageTagMutability: IMMUTABLE
    region: us-west-2
    tags:
      team: peo
      env: dev
  providerConfigRef:
    name: aws-provider
---
apiVersion: ecr.aws.upbound.io/v1beta1
kind: ReplicationConfiguration
metadata:
  name: peo-server-repo
spec:
  forProvider:
    region: us-west-2
    replicationConfiguration:
      - rule:
          - destination:
              - region: us-west-2
                registryId: <some-string>
          - repositoryFilter:
              - filter: peo-server-repo-prod
                filterType: PREFIX_MATCH
  providerConfigRef:
    name: aws-provider
---

Note if I remove the repositoryFilter configuration as seen below the ReplicationConfiguration is created and there are no issues.

---
apiVersion: ecr.aws.upbound.io/v1beta1
kind: ReplicationConfiguration
metadata:
  name: peo-server-repo
spec:
  forProvider:
    region: us-west-2
    replicationConfiguration:
      - rule:
          - destination:
              - region: us-west-2
                registryId: <some-string>
          #- repositoryFilter:
          #    - filter: peo-server-repo-prod
          #     filterType: PREFIX_MATCH
  providerConfigRef:
    name: aws-provider
---

What environment did it happen in?

Crossplane version: 1.13

  • Cloud provider or hardware configuration: EKS m5.large
  • Kubernetes version: 1.27
  • Kubernetes distribution: EKS
  • OS: bottlerocket
  • Kernel: latest bottlerocket os
    -->
@invalidred invalidred added the bug Something isn't working label Sep 20, 2023
@MisterMX
Copy link
Collaborator

You are using the official Upbound provider but this is old provider-aws that is maintained by the community. You want to file a bug at https://github.com/upbound/provider-aws.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants