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

Resources not accessible in multi-line string fields #139

Open
giedri opened this issue Nov 14, 2024 · 0 comments
Open

Resources not accessible in multi-line string fields #139

giedri opened this issue Nov 14, 2024 · 0 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@giedri
Copy link
Contributor

giedri commented Nov 14, 2024

Description

Observed Behavior:
Synchronization fails if resource refers another resource's field in the string value, for example:

        apiVersion: iam.services.k8s.aws/v1alpha1
        kind: Role
...
        spec:
...
          inlinePolicies:
            s3-policy: |
              {
...
                    "Resource": [ 
                        "arn:aws:s3:::${inputBucket.status.location}/${schema.spec.input.prefix}/*"
                    ]
...
                  }

fails, while

        apiVersion: iam.services.k8s.aws/v1alpha1
        kind: Role
...
        spec:
...
          inlinePolicies:
            s3-policy: |
              {
...
                    "Resource": [ 
                        "arn:aws:s3:::${schema.spec.input.bucket}/${schema.spec.input.prefix}/*"
                    ]
...
                  }

works as expected
Expected Behavior:
I would expect fields of the other resources in the RG to be accessible throughout the template

Reproduction Steps (Please include ResourceGroup and Instances files):

Versions:

  • kro version: 0.1.0
  • Kubernetes Version (kubectl version):
    Client Version: v1.29.1
    Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
    Server Version: v1.31.0-eks-a737599
    Involved Controllers:
  • Controller URLs and Versions (if applicable):
    iam.services.k8s.aws/v1alpha1
    Error Logs (if applicable)**:
Message:               failed to synchronize reconciling resource inputBucket: failed to evaluate dynamic variables: failed compiling expression schema.spec.input.prefix: ERROR: <input>:1:1: undeclared reference to 'schema' (in container '')
 | schema.spec.input.prefix
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Which option describes the most your issue?

No response

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

No branches or pull requests

2 participants