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

Disabling profiles does not work #7084

Closed
vladimir-avinkin opened this issue Feb 8, 2022 · 1 comment · Fixed by #7107
Closed

Disabling profiles does not work #7084

vladimir-avinkin opened this issue Feb 8, 2022 · 1 comment · Fixed by #7107

Comments

@vladimir-avinkin
Copy link

Expected behavior

According to documentation (in skaffold --help) prepending a minus sign before a profile name should disable it, instead, we get an error.

Actual behavior

When trying to disable a profile we get an error that says that a profile with a prepended minus is not declared.

Information

  • Skaffold version: v1.35.2
  • Operating system: Darwin MacBook-Pro-Vladimir.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
  • Installed via: homebrew
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta13
kind: Config
profiles:
  - name: default
  - name: test

Below are my speculations:
The initial feature was introduced here #4054 and then probably the logic got duplicated somewhere along the way, probably two places that conflict with each other are here:

return nil, sErrors.ConfigProfilesNotMatchedErr(unmatched)

activated = removeValue(activated, strings.TrimPrefix(profile, "-"))

Steps to reproduce the behavior

  1. bare skaffold.yaml contents of which are stated above is enough to reproduce
  2. skaffold dev -p -test
  3. According to documentation prepending a minus sign before a profile name should disable it, instead we got an error
skaffold dev -p -test
parsing skaffold config: profile selection ["-test"] did not match those defined in any configurations. Check that values specified in the "--profile" or "-p" flags are valid profile names.
@tomasmota
Copy link
Contributor

I'll take a look at this :)

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 a pull request may close this issue.

2 participants