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

kpt fn run scoping broken #188

Closed
frankfarzan opened this issue Jan 30, 2020 · 2 comments
Closed

kpt fn run scoping broken #188

frankfarzan opened this issue Jan 30, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@frankfarzan
Copy link
Contributor

$ kpt pkg get git@github.com:GoogleContainerTools/kpt-functions-sdk.git/example-configs example-configs
$ cd example-configs

This works:

kpt fn source . |         
kpt fn run --image gcr.io/kpt-functions/label-namespace -- label_name=color label_value=orange |
kpt fn sink .  

This doesn't:

$ cat << EOF > kpt-func.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-config
  annotations:
    config.k8s.io/function: |
      container:
        image:  gcr.io/kpt-functions/label-namespace
    config.kubernetes.io/local-config: "true"
data:
  label_name: color
  label_value: orange
EOF
$ kpt fn source .

Removing scoping rules, will run the function:

kpt fn run --global-scope .
@frankfarzan frankfarzan added the bug Something isn't working label Jan 30, 2020
@frankfarzan frankfarzan self-assigned this Jan 31, 2020
@frankfarzan
Copy link
Contributor Author

Root cause is that code is using strings.HasPrefix(resourceDir, dir) to do subdirectory match.

@frankfarzan frankfarzan changed the title kpt fn run broken due to scoping kpt fn run scoping broken Jan 31, 2020
@frankfarzan
Copy link
Contributor Author

Fix: kubernetes-sigs/kustomize#2165

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