-
Notifications
You must be signed in to change notification settings - Fork 13
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
allow passing in the cli args to the components as env args #4
Conversation
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com> Co-authored-by: fibonacci1729 <brian.hardock@fermyon.com>
I wonder if having an unconstrained set of guest data directly in the I wonder if we should use a |
Thats a good point. IIRC to do this you can |
I was playing around with it and setting spin up -- -- test notice the double |
Good point, @itowlson. In fact, there is another place where we need to make sure we can reliably pass arguments: the shim. spinkube/containerd-shim-spin#50 (comment) For example: spec:
initCcontainers:
- name: spin-init
image: ttl.sh/spinkube-init:24h
command: ["/"] # most likely keep this as "/"
args: ["these", "are", "some", "args"] |
Signed-off-by: Brian H <brian.hardock@fermyon.com>
Allow passing arguments to guest
With the latest changes from @fibonacci1729, the behavior is that anything passed after the $ spin up -f example -- one two three -h
CliArgs { id: None, guest_args: ["one", "two", "three", "-h"] }
simple # component_id
one
two
three
-h (the debug print of |
@radu-matei I am not sure about how to test the usage in the |
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
This app manifest works in the shim using the command trigger from this branch: apiVersion: apps/v1
kind: Deployment
metadata:
name: spin-test-init
spec:
replicas: 1
selector:
matchLabels:
app: spin-test
template:
metadata:
labels:
app: spin-test
spec:
runtimeClassName: wasmtime-spin-v2
initContainers:
- name: spin-init
image: ttl.sh/spinkube-init-args:24h
args: ["these", "are", "some", "args"]
containers:
- name: spin-test
image: ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:v0.10.0
command: ["/"]
ports:
- containerPort: 80 Getting the logs from the init container:
The "command" being injected as the component name makes sense to me. |
This PR enables passing in the CLI args passed to the component with the component ID used as the command name. eg:
Rust code
The updated behavior is describe in #4 (comment)