-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Fix --kubeconfig flag priority #15
Comments
So looking at this issue it carries thru all app installs currently. I would like to make following changes:
/cc @alexellis |
This sounds good, please go ahead and raise the first PR for it.
There is no |
|
When should we expect a PR @phumberdroz ? 😄 |
Hopefully today @alexellis :) |
Please could someone suggest a simpler alternative fix? |
Sooo... Is this going to be fixed or ? |
See my comment from a month ago. What specific issue are you running into? Some people don't set their KUBECONFIG variable correctly. If you do that, then you shouldn't need this flag. |
My |
You should never use ./, always use |
Kubeconfig flag was not honoured if set. This commit checks the flag, then os.env then the default kueconfig location. Tested by installing a handful of apps (new and old style) with and without kubeconfig flag and os.env All installed ok Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
Kubeconfig flag was not honoured if set. This commit checks the flag, then os.env then the default kueconfig location. Tested by installing a handful of apps (new and old style) with and without kubeconfig flag and os.env All installed ok Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
Kubeconfig flag was not honoured if set. This commit checks the flag, then os.env then the default kueconfig location. Tested by installing a handful of apps (new and old style) with and without kubeconfig flag and os.env All installed ok Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
# This is the 1st commit message: Update README.md Signed-off-by: liam.baker <liam.baker@sage.com> # This is the commit message alexellis#2: address comments and remove dependency on go-git Signed-off-by: liam.baker <liam.baker@sage.com> # This is the commit message alexellis#3: Fix for regex for downloading Node.js Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com> # This is the commit message alexellis#4: Bump golang.org/x/crypto from 0.14.0 to 0.15.0 Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.15.0. - [Commits](golang/crypto@v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#5: Bump golang.org/x/mod from 0.13.0 to 0.14.0 Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.13.0 to 0.14.0. - [Commits](golang/mod@v0.13.0...v0.14.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#6: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](spf13/cobra@v1.7.0...v1.8.0) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#7: feat: add kwok to arkade get tools Signed-off-by: Czékus Máté <mate@picloud.hu> # This is the commit message alexellis#8: feat: add kwokctl to arkade get tools Signed-off-by: Czékus Máté <mate@picloud.hu> # This is the commit message alexellis#9: Update system go installation for new format The endpoint on go.dev now returns additional text after the version, \ntime. This change trims off the second half of the output. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com> # This is the commit message alexellis#10: Bump golang.org/x/crypto from 0.15.0 to 0.16.0 Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.15.0 to 0.16.0. - [Commits](golang/crypto@v0.15.0...v0.16.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#11: Bump github.com/google/go-containerregistry from 0.16.1 to 0.17.0 Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.16.1 to 0.17.0. - [Release notes](https://github.com/google/go-containerregistry/releases) - [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml) - [Commits](google/go-containerregistry@v0.16.1...v0.17.0) --- updated-dependencies: - dependency-name: github.com/google/go-containerregistry dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#12: Add rgee/snowmachine for the festive period Signed-off-by: Richard Gee <richard@technologee.co.uk> # This is the commit message alexellis#13: Bump actions/setup-go from 4 to 5 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#14: Update README.md Signed-off-by: Alex Ellis <alexellis2@gmail.com> # This is the commit message alexellis#15: Export LoadFrom Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
# This is the 1st commit message: Update README.md Signed-off-by: liam.baker <liam.baker@sage.com> # This is the commit message alexellis#2: address comments and remove dependency on go-git Signed-off-by: liam.baker <liam.baker@sage.com> # This is the commit message alexellis#3: Fix for regex for downloading Node.js Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com> # This is the commit message alexellis#4: Bump golang.org/x/crypto from 0.14.0 to 0.15.0 Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.15.0. - [Commits](golang/crypto@v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#5: Bump golang.org/x/mod from 0.13.0 to 0.14.0 Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.13.0 to 0.14.0. - [Commits](golang/mod@v0.13.0...v0.14.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#6: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](spf13/cobra@v1.7.0...v1.8.0) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#7: feat: add kwok to arkade get tools Signed-off-by: Czékus Máté <mate@picloud.hu> # This is the commit message alexellis#8: feat: add kwokctl to arkade get tools Signed-off-by: Czékus Máté <mate@picloud.hu> # This is the commit message alexellis#9: Update system go installation for new format The endpoint on go.dev now returns additional text after the version, \ntime. This change trims off the second half of the output. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com> # This is the commit message alexellis#10: Bump golang.org/x/crypto from 0.15.0 to 0.16.0 Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.15.0 to 0.16.0. - [Commits](golang/crypto@v0.15.0...v0.16.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#11: Bump github.com/google/go-containerregistry from 0.16.1 to 0.17.0 Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.16.1 to 0.17.0. - [Release notes](https://github.com/google/go-containerregistry/releases) - [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml) - [Commits](google/go-containerregistry@v0.16.1...v0.17.0) --- updated-dependencies: - dependency-name: github.com/google/go-containerregistry dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#12: Add rgee/snowmachine for the festive period Signed-off-by: Richard Gee <richard@technologee.co.uk> # This is the commit message alexellis#13: Bump actions/setup-go from 4 to 5 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#14: Update README.md Signed-off-by: Alex Ellis <alexellis2@gmail.com> # This is the commit message alexellis#15: Export LoadFrom Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com> # This is the commit message alexellis#16: Bump go.mod and vendor Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com> # This is the commit message alexellis#17: Fix issue with version flag for Helm charts The version was being specified in an invalid way in args for the helm command via a string with a space. This has been changed to use a slice. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com> # This is the commit message alexellis#18: Bump golang.org/x/crypto from 0.16.0 to 0.17.0 Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.16.0 to 0.17.0. - [Commits](golang/crypto@v0.16.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> # This is the commit message alexellis#19: Move to Go 1.21 for builds and minimum version Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com> # This is the commit message alexellis#20: Limit builds for same SHA Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com> # This is the commit message alexellis#21: Use Go 1.21 for e2e checker Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The
kubeconfig
flag on theapp install
command does not affect the actual kubernetes command execution. The kubernetes command is executed against the default kubeconfig file, not the one passed in via flags.Expected Behaviour
Passing the
kubeconfig
flag on theapp install
command should use that kubeconfig file when installing the app.Current Behaviour
The
kubeconfig
variable is only written out, but not utilized:https://github.com/alexellis/k3sup/blob/master/pkg/cmd/openfaas_app.go#L42
Possible Solution
Since the
kubernetes_exec.go
file is also in thecmd
package, it's possible for thekubectl
andkubectlTask
functions to look for changes on the flag to get that passed in value. Much the same as the above pasted code from one of the apps.Steps to Reproduce (for bugs)
k3sup app install openfaas --kubeconfig any/path/to/file
kubectl get pods --all-namespaces --kubeconfig /same/path/above
kubectl get pods --all-namespaces
(without the kubeconfig)Context
I have several k8s cluster set up in various environments for testing. Swapping the config files, or env var is annoying, and really time consuming if I forget before I run the install command.
Your Environment
Linux/ARM
Desktop (microk8s), GCP, DigitalOcean, Raspberry Pi 3+
Linux
The text was updated successfully, but these errors were encountered: