Coder Social home page Coder Social logo

Comments (4)

corneliusweig avatar corneliusweig commented on July 4, 2024

Hey @dhrp, thanks for reporting this! I fixed the bug with the hyphens in filenames, but I cannot reproduce your second issue (the one you added lateron). Can you please run as

DEBUG=yes kubectl konfig ...

This will show what commands are actually run and may give a clue as to what is going on.

Glad you like the tool :)


PS: you can hot-patch your installation with

sed -i '89celif [[ "${1}" =~ ^-(.*) ]]; then' `which kubectl-konfig`

I would like to resolve your issue completely before publishing a new release.

from konfig.

dhrp avatar dhrp commented on July 4, 2024

HI @corneliusweig

Thanks for the quick response..

Unfortunately, it seems this does not resolve the issue, and I've now actually spend more time than I would have thought to have needed digging into the situation. Turns out that I have bash 3.2, which is the default on Mac OS (still).

And it doesn't play nice with passing arrays as arguments to functions. More specifically, because you set the IFS to not contain space, the arrays will be passed as a single word, not an array. Notice the quotes around error: unrecognized flag "-s ingresscluster.yaml"

Now, I thought I could send you a patch or PR, but I don't quite understand why you change the IFS in the first place, though removing it does make the tests fail.

Oatcake:.kube thatcher$ DEBUG=yes kubectl konfig import -s ingresscluster 
+ set -eou pipefail
+ IFS=':
	'
+ TMPFILES=()
+ declare -a TMPFILES
+ trap cleanup EXIT
+ main import -s ingresscluster
+ hash kubectl
+ KUBECTL=kubectl
+ [[ 3 -eq 0 ]]
+ case "$1" in
+ import_ctx '-s ingresscluster'
+ local tmpcfg
+ local out=
+ [[ -s ingresscluster = \-\-\s\a\v\e ]]
+ [[ -s ingresscluster = \-\s ]]
+ [[ -s ingresscluster =~ -(.*) ]]
+ error 'unrecognized flag "-s ingresscluster"'
+ echo 'error: unrecognized flag "-s ingresscluster"'
error: unrecognized flag "-s ingresscluster"
+ exit 1
+ cleanup
+ [[ 0 -gt 0 ]]

from konfig.

corneliusweig avatar corneliusweig commented on July 4, 2024

Hey @dhrp, thanks for investing so much into the analysis here! I use IFS to expand the list of kubeconfigs to konfig1:konfig2:konfig3 such that I can set the env var KUBECONFIG=konfig1:konfig2:....
I'll have to see if I can find another way to achieve the same goal.

I'm so sorry that this has cost you more time than it will probably save you :( But I'm extremely grateful that you have reported this and helped in finding a solution.

PS: After you applied the hot-patch you will probably have problems with krew. When you are done with debugging konfig and want to continue using krew, please do rm -i $(which kubectl-konfig) and at your convenience you can re-install konfig via krew. I only found out about this glitch after I left the previous comment.

from konfig.

corneliusweig avatar corneliusweig commented on July 4, 2024

@dhrp Thanks to your help I could reproduce the issue and found a fix (#9). I'll publish the fixed version asap, so that it will be available in krew.

from konfig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.