Skip to content

Commit 896aa45

Browse files
Add selective deployment to Spintainer executor
Signed-off-by: Kate Goldenring <[email protected]>
1 parent 3bccc56 commit 896aa45

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
File renamed without changes.

internal/controller/spinapp_controller.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,17 @@ func constructDeployment(ctx context.Context, app *spinv1alpha1.SpinApp, config
461461
ReadinessProbe: readinessProbe,
462462
}
463463
} else if config.SpinImage != nil {
464+
args := []string{"up", "--listen", fmt.Sprintf("0.0.0.0:%d", spinapp.DefaultHTTPPort), "-f", app.Spec.Image, "--runtime-config-file", "/runtime-config.toml"}
465+
if app.Spec.Components != nil {
466+
for _, component := range app.Spec.Components {
467+
args = append(args, "--component-id", component)
468+
}
469+
}
464470
container = corev1.Container{
465471
Name: app.Name,
466472
Image: *config.SpinImage,
467473
// TODO: add support for --component-id flags to set components to be retained once spintainer supports Spin v3.0
468-
Args: []string{"up", "--listen", fmt.Sprintf("0.0.0.0:%d", spinapp.DefaultHTTPPort), "-f", app.Spec.Image, "--runtime-config-file", "/runtime-config.toml"},
474+
Args: args,
469475
Ports: []corev1.ContainerPort{{
470476
Name: spinapp.HTTPPortName,
471477
ContainerPort: spinapp.DefaultHTTPPort,

0 commit comments

Comments
 (0)