-
Notifications
You must be signed in to change notification settings - Fork 1
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
DEVOPS-3141 teleport changes #118
Conversation
Signed-off-by: shubhindia <shubhindia123@gmail.com>
Signed-off-by: shubhindia <shubhindia123@gmail.com>
pkg/exec/exec.go
Outdated
@@ -25,6 +25,8 @@ import ( | |||
var ( | |||
//go:embed bin/tsh | |||
tsh []byte | |||
//go:embed bin/tsh.md5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of embedding the md5 hash file into the binary, we can set md5Sum string value at build time using -ldflags, something like shubhindia/go-m1temperature@1d0084b. Embedding the file will unnecessarily increase the overall binary size. 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @shubhindia for suggestion, also we are already using -ldflags for version, we can use that for md5 hash too.
pkg/exec/exec.go
Outdated
@@ -36,9 +38,13 @@ func InstallTsh() error { | |||
return os.WriteFile(dir+"/tsh", tsh, 0755) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might cause issue in m1 where after executing the command it just returns zsh: killed
because of some gatekeeper issues in macOS. This can be solved by running codesign after binary is copied so binary doesn't get quarantined. codesign --sign - --force --preserve-metadata=entitlements,requirements,flags,runtime <binary-path>
should do the trick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm.. I will check on it. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you face above issue with a binary built-for arm or x86_64? We are not planning to build an arm-based binary but relaying on rosetta to the job on m1/2 macs. 🤞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. There is no issue with x86_64. Using Rosetta would mean people will have to install it. The issue occurs on arm machines only. Even homebrew guys had to implement a workaround. Homebrew/brew@4c19d67
I found the above command from there only 🤪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or installation can be manual. Like it is done for kubectl
right now. We just check if its installed and ask people to install it if it isn't
No description provided.