Coder Social home page Coder Social logo

Comments (10)

stb1337 avatar stb1337 commented on July 24, 2024 1

@corneliusweig See #39 :)

from konfig.

stb1337 avatar stb1337 commented on July 24, 2024

i also tried without .yaml and removed "--".

konfig import kubeconfig-xxx-xxx-xxx-xxx
error: unrecognized flag "kubeconfig-xxx-xxx-xxx-xxx"
konfig import kubeconfig-xxx-xxx-xxx-xxx --save
error: unrecognized flag "kubeconfig-xxx-xxx-xxx-xxx"

from konfig.

corneliusweig avatar corneliusweig commented on July 24, 2024

Hm, I tried to repro your problem, but for me it worked fine. Can you please export DEBUG=1 in your shell, run the command again, and paste the output here?

from konfig.

stb1337 avatar stb1337 commented on July 24, 2024

thanks a lot for having a lot of patience.

konfig import kubeconfig--test-dsc5.yaml                                                                                                                                                                                                                                                                                               127 ↵
+ set -eou pipefail
+ IFS=':
	'
+ TMPFILES=()
+ declare -a TMPFILES
+ trap cleanup EXIT
+ main import kubeconfig--test-dsc5.yaml
+ hash kubectl
+ KUBECTL=kubectl
+ [[ 2 -eq 0 ]]
+ case "$1" in
+ import_ctx kubeconfig--test-dsc5.yaml
+ [[ kubeconfig--test-dsc5.yaml =~ -(.*) ]]
+ error 'unrecognized flag "kubeconfig--test-dsc5.yaml"'
+ echo 'error: unrecognized flag "kubeconfig--test-dsc5.yaml"'
error: unrecognized flag "kubeconfig--test-dsc5.yaml"
+ exit 1
+ cleanup
+ [[ 0 -gt 0 ]]
konfig import kubeconfig--test-dsc5 --save                                                                                                                                                                                                                                                                                               1 ↵ 
+ set -eou pipefail
+ IFS=':
	'
+ TMPFILES=()
+ declare -a TMPFILES
+ trap cleanup EXIT
+ main import kubeconfig--test-dsc5 --save
+ hash kubectl
+ KUBECTL=kubectl
+ [[ 3 -eq 0 ]]
+ case "$1" in
+ import_ctx kubeconfig--test-dsc5 --save
+ [[ kubeconfig--test-dsc5 =~ -(.*) ]]
+ error 'unrecognized flag "kubeconfig--test-dsc5"'
+ echo 'error: unrecognized flag "kubeconfig--test-dsc5"'
error: unrecognized flag "kubeconfig--test-dsc5"
+ exit 1
+ cleanup
+ [[ 0 -gt 0 ]]

from konfig.

stb1337 avatar stb1337 commented on July 24, 2024

I would guess that Line 74 is breaking execution.

I think If you remove "$1" =~ ^-(.*) it should work. Hopefully this helps, I am not that good with bash scripting.

from konfig.

corneliusweig avatar corneliusweig commented on July 24, 2024

What's strange is that your output says [[ kubeconfig--test-dsc5 =~ -(.*) ]], however the pattern in l.74 says [[ "$1" =~ ^-(.*) ]]. So the debug output shows matching against -(.*) but the code wants ^-(.*).
I don't know why the ^ gets lost. Can you tell me about your OS and bash version? However since I can't reproduce the problem I have to defer bug hunting to you.

from konfig.

stb1337 avatar stb1337 commented on July 24, 2024

After updating to v0.2.6 it worked.

konfig import kubeconfig--test-dsc5.yaml                                                                                                                                                                                       I540484@sTb31337
+ set -eEuo pipefail
+ TMPFILES=()
+ declare -a TMPFILES
+ trap cleanup EXIT
+ main import kubeconfig--test-dsc5.yaml
+ hash kubectl
+ KUBECTL=kubectl
+ [[ 2 -eq 0 ]]
+ case "$1" in
+ import_ctx kubeconfig--test-dsc5.yaml
+ tmpcfgs=()
+ declare -a tmpcfgs
+ local tmpcfg
+ local tmpinputcfg=
+ local out=
+ local arg=
++ mktemp konfig_XXXXXX
+ tmpcfg=konfig_sEV23k
+ TMPFILES+=("$tmpcfg")
+ tmpcfgs+=("$tmpcfg")
+ for OPT in "$@"
+ case $OPT in
+ kubectl config view --raw
+ [[ -z '' ]]
+ merge '' konfig_sEV23k kubeconfig--test-dsc5.yaml
+ [[ '' =~ ^-.+ ]]
+ IFS=':
	'
+ [[ '' == \-\p ]]
+ [[ '' == \-\-\p\r\e\s\e\r\v\e\-\s\t\r\u\c\t\u\r\e ]]
+ KUBECONFIG=:konfig_sEV23k:kubeconfig--test-dsc5.yaml
+ kubectl config view --flatten --merge
apiVersion: v1
clusters:
- cluster:
...
- name: user-read-only
  user: {}
+ IFS='
'
+ cleanup
+ [[ 1 -gt 0 ]]
+ rm -- konfig_sEV23k

I guess I had an old version of crew installed.

You may close the issue. Thanks a lot.

from konfig.

stb1337 avatar stb1337 commented on July 24, 2024

I know the issue. I just had to reinstall my OS and performed the install command of the Readme.MD.

Within this setup instructions and old version V0.2.0 is mentioned. It would be helpful to keep the setup instructions of readme.md up to date or switch to an dynamic approach.

Kind regards

from konfig.

corneliusweig avatar corneliusweig commented on July 24, 2024

It would be helpful to keep the setup instructions of readme.md up to date or switch to an dynamic approach.

That sounds like a documentation bug. Can you tell me what exactly confused you? You can also send a PR :)

from konfig.

stb1337 avatar stb1337 commented on July 24, 2024

I will send an PR :) Thanks again for this great tool and your support :)

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.