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

tk export -l not working #1336

Open
rezonick opened this issue Feb 3, 2025 · 1 comment
Open

tk export -l not working #1336

rezonick opened this issue Feb 3, 2025 · 1 comment

Comments

@rezonick
Copy link

rezonick commented Feb 3, 2025

% tk --version                                                                          
2025/02/03 14:39:21 tk version v0.29.0

I got the following resource:

% tk show environments/testenv/dev/main.jsonnet

apiVersion: iam.aws.upbound.io/v1beta1
kind: Role
metadata:
  annotations:
    argocd.argoproj.io/sync-wave: "-1"
  labels:
    managedby: crossplane
  name: role-dev
spec:
  forProvider:
    assumeRolePolicy: '{"Statement": [{"Action": ["sts:AssumeRole"], "Condition":
      {"StringEquals": {"sts:ExternalId": "abcabacabac"}},
      "Effect": "Allow", "Principal": {"AWS": ["arn:aws:iam::123412341234:root"]}}],
      "Version": "2012-10-17"}'
  managementPolicies:
  - '*'
  providerConfigRef:
    name: crossplane-provider-config
# Wasn't able to export :(
tk export export/ environments/test/dev/main.jsonnet --merge-strategy fail-on-conflicts --recursive --format {{env.metadata.name}}/resources/{{.kind}}.{{.metadata.name}} -t '!Application/.*' -l "managedby=crossplane"

# Exports
tk export export/ environments/test/dev/main.jsonnet --merge-strategy fail-on-conflicts --recursive --format {{env.metadata.name}}/resources/{{.kind}}.{{.metadata.name}} -t '!Application/.*' -l "managedby!=crossplane"

As you see I want to export all the resources managed by Crossplane which is not ArgoCD Application.

@zerok
Copy link
Contributor

zerok commented Feb 10, 2025

Hi 🙂 Looks like the documentation on that flag is a bit misleading. The selector is only for the environment but not the included resources 🙂 You'll need to set the labels in the apply phase or do some further post-processing after the export.

@julienduchesne julienduchesne moved this from Triage to Backlog in Tanka Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants