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

Explain that KO_CONFIG_PATH should be a directory #910

Closed
wants to merge 1 commit into from

Conversation

halvards
Copy link
Collaborator

Related: #909

@codecov-commenter
Copy link

Codecov Report

Merging #910 (daa9b21) into main (e01a7ab) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #910   +/-   ##
=======================================
  Coverage   51.34%   51.34%           
=======================================
  Files          44       44           
  Lines        3414     3414           
=======================================
  Hits         1753     1753           
  Misses       1432     1432           
  Partials      229      229           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@imjasonh
Copy link
Member

#731 changed KO_CONFIG_PATH to allow specifying the file. Is there a bug in that logic?

@halvards
Copy link
Collaborator Author

It appears so. Repro steps:

$ ko version
0.12.0

$ git clone https://github.com/bluebrown/ko-bug-nested-config.git
$ cd ko-bug-nested-config
$ git checkout a07be3e7471a7cc2931cb45d2b52000d52a6557c
$ sed -i 's/dir:.*$/dir: ./' nested/.ko.yaml

$ export KO_CONFIG_PATH="$PWD/nested/.ko.yaml"
$ docker run --rm "$(ko build -L -B ./cmd/app/)"
tag is not used

$ export KO_CONFIG_PATH="$PWD/nested"
$ docker run --rm "$(ko build -L -B ./cmd/app/)"
tag is used

@developer-guy
Copy link
Collaborator

#731 changed KO_CONFIG_PATH to allow specifying the file. Is there a bug in that logic?

Yep, there is a bug related to that because it does not consider the file you supply in the KO_CONFIG_PATH because of the viper logic you provide as v.AddConfigPath(override); if the value of the override variable is a file, it doesn't consider using the content of it while running v.ReadInConfig(). I've faced the same issue while working on #904 ☝️

@imjasonh
Copy link
Member

I believe handling of KO_CONFIG_PATH pointing to a file is handled correctly now, so I'm closing this. If folks would like to improve docs or find bugs please feel free to comment here.

@imjasonh imjasonh closed this Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants