Skip to content

Token secret is not populated after Token creation #273

@jonbos

Description

@jonbos

What happened?

When creating a Token, the secret details are not written to the secret specified in writeConnectionSecretToRef. The secret details do populate after an update.

How can we reproduce it?

echo "apiVersion: projects.argocd.crossplane.io/v1alpha1
kind: Project
metadata:
  name: example-project
spec:
  forProvider:
    projectLabels:
      argocd.crossplane.io/global-project: 'true'
    sourceNamespaces:
      - default
    roles:
      - name: example-role
        groups:
          - example-group
        policies:
          - p, proj:example-project:example-role, applications, *, example-project/*,
            allow
  providerConfigRef:
    name: argocd-provider
---
apiVersion: projects.argocd.crossplane.io/v1alpha1
kind: Token
metadata:
  name: example-token
spec:
  forProvider:
    id: example-token
    project: example-project
    role: example-role
    renewAfter: 1s
  providerConfigRef:
    name: argocd-provider
  writeConnectionSecretToRef:
    name: example-token
    namespace: default" | kubectl apply -f -

Review the secret, it has no data...

kubectl get secrets example-token -o yaml

NAME            TYPE                                DATA   AGE
example-token   connection.crossplane.io/v1alpha1   0      50m

When the token is updated (tested by setting renewAfter to 10s), the token is populated correctly

What environment did it happen in?

Crossplane version: 1.19.1
Crossplane Provider argocd version: 0.10.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions