kapicorp / kapitan

Generic templated configuration management for Kubernetes, Terraform and other things
https://kapitan.dev
Apache License 2.0
1.83k stars 200 forks source link

deep_get function is not matching keys according to globbing pattern(partially). #697

Open Nightrider0098 opened 3 years ago

Nightrider0098 commented 3 years ago

The deep_get function in utils is filtering globbing names in a buggy way. The function is supposed to filter a name containing wildcard * (at the end) by searching if the dictionary has a key starting with the name. But instead, it searches for the name in the whole key.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'examples/kubernetes/inventory/targets/all-glob.yml'
  2. In the parameter section add a parameter: development_naming: value_2l
  3. open a terminal and navigate to examples/kubernetes
  4. type kapitan searchvar parameters.naming*

Expected behavior Should filter only those keys which start with the given name, instead of the keys which contain the globbing pattern.

Screenshots If applicable, add screenshots to help explain your problem/idea.

yml file image

CLI image

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 1 year with no activity. Remove the stale label or comment if this issue is still relevant for you. If not, please close it yourself.