-
Notifications
You must be signed in to change notification settings - Fork 24
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
deployment: Set SPIN_HTTP_LISTEN_ADDR env var #296
Conversation
This is currently a "practical no-op", as we default to setting the value to the Spin Default. It does however simplify a future, bigger, change to allow non-80 listen addresses with the container to reduce the priviliges that we give to the shim (e.g runAsNonRoot).
@@ -423,7 +423,7 @@ func constructDeployment(ctx context.Context, app *spinv1alpha1.SpinApp, config | |||
Requests: app.Spec.Resources.Requests, | |||
} | |||
|
|||
env := ConstructEnvForApp(ctx, app) | |||
env := ConstructEnvForApp(ctx, app, spinapp.DefaultHTTPPort) |
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.
so in future we may add the ability to override the port using SpinApp CRD?
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.
I think we'll want to keep it "automatic", but it'll at least be able to be non-80 😅
return nil | ||
} | ||
|
||
func ConstructEnvForApp(ctx context.Context, app *spinv1alpha1.SpinApp, listenPort int) []corev1.EnvVar { | ||
envs := make([]corev1.EnvVar, len(app.Spec.Variables)) |
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.
do we need to make it len(app.Spec.Variabled) + 1?
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.
nah - it'd be technically marginally faster, but i wanna avoid making the rebase for #273 too complicated
This is currently a "practical no-op", as we default to setting the value to the Spin Default.
It does however simplify a future, bigger, change to allow non-80 listen addresses with the container to reduce the priviliges that we give to the shim (e.g runAsNonRoot).