Skip to content

Commit

Permalink
Merge pull request #339 from kate-goldenring/spintainer-selective-dep…
Browse files Browse the repository at this point in the history
…loyment

Add selective deployment to Spintainer executor
  • Loading branch information
calebschoepp authored Nov 1, 2024
2 parents 3bccc56 + 896aa45 commit 5f41de2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
File renamed without changes.
8 changes: 7 additions & 1 deletion internal/controller/spinapp_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,17 @@ func constructDeployment(ctx context.Context, app *spinv1alpha1.SpinApp, config
ReadinessProbe: readinessProbe,
}
} else if config.SpinImage != nil {
args := []string{"up", "--listen", fmt.Sprintf("0.0.0.0:%d", spinapp.DefaultHTTPPort), "-f", app.Spec.Image, "--runtime-config-file", "/runtime-config.toml"}
if app.Spec.Components != nil {
for _, component := range app.Spec.Components {
args = append(args, "--component-id", component)
}
}
container = corev1.Container{
Name: app.Name,
Image: *config.SpinImage,
// TODO: add support for --component-id flags to set components to be retained once spintainer supports Spin v3.0
Args: []string{"up", "--listen", fmt.Sprintf("0.0.0.0:%d", spinapp.DefaultHTTPPort), "-f", app.Spec.Image, "--runtime-config-file", "/runtime-config.toml"},
Args: args,
Ports: []corev1.ContainerPort{{
Name: spinapp.HTTPPortName,
ContainerPort: spinapp.DefaultHTTPPort,
Expand Down

0 comments on commit 5f41de2

Please sign in to comment.