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

Request for kubectl #85

Open
yisiqi opened this issue Jul 9, 2019 · 7 comments
Open

Request for kubectl #85

yisiqi opened this issue Jul 9, 2019 · 7 comments

Comments

@yisiqi
Copy link

yisiqi commented Jul 9, 2019

Support for kubectl will make Kubernetes cluster operations easier. O&M engineers need this feature very much.

@holzschu
Copy link
Owner

holzschu commented Jul 9, 2019

Hi,
I'll see what I can do. After a quick research, I was unable to find the source code for this command, only precompiled binaries.

@holzschu
Copy link
Owner

holzschu commented Jul 9, 2019

For my own future reference: https://github.com/kubernetes/kubectl

@yisiqi
Copy link
Author

yisiqi commented Jul 9, 2019

yes, that is the official source repo. And it's a golang program.

For my own future reference: https://github.com/kubernetes/kubectl

@yisiqi
Copy link
Author

yisiqi commented Oct 28, 2019

I tried compiling a simple hello world with go build. Everything goes well.
But when I download the executable file into the blink shell, It's not working, caused by command not found.

Here is the screenshot:
image

@holzschu
Copy link
Owner

Hi,
I have many questions here.

  • which flags did you use to convince golang to cross-compile for arm64 / iOS instead of the host machine (probably x86 / OSX)?
  • did you link the binary with ios_system.framework? otherwise the output will go to the console, which is not useful.
  • binary commands have to be signed before they can be executed on iOS. The only way to do that is at install time, so you would have to sideload blinkshell and add go-test to the list of embedded binaries, and to the list of commands in Resources/commandDictionary.plist.

@yisiqi
Copy link
Author

yisiqi commented Oct 28, 2019

I used the following command to compile my test program.

CC=/usr/local/go/misc/ios/clangwrap.sh GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build

Then use ldid to sign the binary. I'm not sure if that works.

Your question has brought me some tips. But I don't know how to link the binary with ios_system.framework.

@holzschu
Copy link
Owner

ldid works for signing, but for iOS to accept a binary it has be both signed and placed in the right location. The only way to access this location is at install time, so you will have to compile your own version of Blink (It's free as long as you accept recompiling every 7 days).

To have your command recognized by iOS, you need to add the binary to the list of embedded binaries in the XCode project, and to commandDictionary.plist. Once you've done that, you should be able to start your command. The output might be on the XCode console.

The big difficulty is making sure your command runs multiple times: often, memory de-allocation is not treated as the command exits (because when a command exits, it releases all of its memory). This is not true with iOS, and so you need to reset all variables and release all memory on exit.

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

No branches or pull requests

2 participants