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

Issues running on MacOS #11

Open
insuusvenerati opened this issue Apr 9, 2024 · 8 comments · Fixed by #12
Open

Issues running on MacOS #11

insuusvenerati opened this issue Apr 9, 2024 · 8 comments · Fixed by #12

Comments

@insuusvenerati
Copy link

insuusvenerati commented Apr 9, 2024

Getting the error when running talos-bootstrap install. On MacOS 13.6.6 talosctl version v1.6.7

❯ talos-bootstrap install
/usr/local/bin/talos-bootstrap: line 126: syntax error near unexpected token `;;'
/usr/local/bin/talos-bootstrap: line 126: `        case " ${seen} " in *" ${mac} "*) continue ;; esac # remove duplicated nodes'
@kvaps
Copy link
Member

kvaps commented Apr 10, 2024

Hi @insuusvenerati could you please provide output of:

/bin/sh --version

@insuusvenerati
Copy link
Author

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin22)
Copyright (C) 2007 Free Software Foundation, Inc.

@kvaps
Copy link
Member

kvaps commented Apr 10, 2024

It seems case statement does not work inside subshell $() for some reason.

Please try this version from #12
https://github.com/aenix-io/talos-bootstrap/raw/8f3f1985a8b84b535d7ed01014d0f25bab13400b/talos-bootstrap

@insuusvenerati
Copy link
Author

Hey! That's works! Thanks so much

@insuusvenerati
Copy link
Author

Is there any chance you can get this to work on macOS? Mac doesn't have an iproute2 package so instead I used iproute2mac but get this error

❯ ./talos-bootstrap install
Option "-o" is unknown, try "ip help".
awk: extra ] at source line 1
 context is
        NR>1 >>>  {sub(/^[^/] <<< 
awk: nonterminated character class ^[^
 source line number 1
awk: illegal primary in regular expression *"$ at "$
 source line number 1
 context is
         >>> /*"$/ <<<

@kvaps kvaps closed this as completed in #12 Apr 11, 2024
@kvaps kvaps reopened this Apr 11, 2024
@kvaps kvaps changed the title unexpected token `;;' Issues running on MacOS Apr 11, 2024
@kvaps
Copy link
Member

kvaps commented Apr 11, 2024

Try installing awk

https://formulae.brew.sh/formula/awk

@thecodeassassin
Copy link

Try installing awk

https://formulae.brew.sh/formula/awk

Same happens with the latest version of awk installed

awk: extra ] at source line 1
 context is
	NR>1 >>>  {sub(/^[^/] <<<
awk: nonterminated character class ^[^
 source line number 1
awk: illegal primary in regular expression *"$ at "$
 source line number 1
 context is
	 >>> /*"$/ <<<
	 ```

@TrooperT
Copy link

TrooperT commented Aug 8, 2024

Sorry to necro this but as a resolution, it appears that some of the awk syntax used by talos-bootstrap includes GNU extensions that require using gawk
try brew install gawk and
do one of 2 things:

  1. symlink awk against gawk or
  2. replace all instances of awk with gawk in talos-boostrap using sed -i.bak 's/awk/gawk/' talos-bootstrap

I came to this conclusion after a bit of blue/green testing between my daily driver MBP and a clean Ubuntu VM install. in the clean install /usr/bin/awk links to /etc/alternatives/awk and /etc/alternatives/awk links back to /usr/bin/gawk thus explaining the difference in behaviour

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.

4 participants