Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions api/v1alpha/instance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,26 @@ type SandboxContainer struct {
// +kubebuilder:validation:Required
Image string `json:"image"`

// Entrypoint array to run in the container image, overriding the image's
// ENTRYPOINT. Each element is a separate token, not a shell command — to run a
// shell command use: ["sh", "-c", "my command"].
//
// If not provided, the container image's own ENTRYPOINT is used.
//
// +kubebuilder:validation:Optional
Command []string `json:"command,omitempty"`

// Arguments to the entrypoint, overriding the image's CMD. Combined with
// Command: when Command is also set the resulting invocation is
// append(Command, Args...). When only Args is set it overrides CMD while
// preserving the image's ENTRYPOINT.
//
// If neither Command nor Args is set, the image's own ENTRYPOINT and CMD
// are used unchanged.
//
// +kubebuilder:validation:Optional
Args []string `json:"args,omitempty"`

// List of environment variables to set in the container.
//
// +kubebuilder:validation:Optional
Expand Down
10 changes: 10 additions & 0 deletions api/v1alpha/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions config/base/crd/bases/compute.datumapis.com_instances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,28 @@ spec:
description: A list of containers to run within the sandbox.
items:
properties:
args:
description: |-
Arguments to the entrypoint, overriding the image's CMD. Combined with
Command: when Command is also set the resulting invocation is
append(Command, Args...). When only Args is set it overrides CMD while
preserving the image's ENTRYPOINT.

If neither Command nor Args is set, the image's own ENTRYPOINT and CMD
are used unchanged.
items:
type: string
type: array
command:
description: |-
Entrypoint array to run in the container image, overriding the image's
ENTRYPOINT. Each element is a separate token, not a shell command — to run a
shell command use: ["sh", "-c", "my command"].

If not provided, the container image's own ENTRYPOINT is used.
items:
type: string
type: array
env:
description: |-
List of environment variables to set in the container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,28 @@ spec:
sandbox.
items:
properties:
args:
description: |-
Arguments to the entrypoint, overriding the image's CMD. Combined with
Command: when Command is also set the resulting invocation is
append(Command, Args...). When only Args is set it overrides CMD while
preserving the image's ENTRYPOINT.

If neither Command nor Args is set, the image's own ENTRYPOINT and CMD
are used unchanged.
items:
type: string
type: array
command:
description: |-
Entrypoint array to run in the container image, overriding the image's
ENTRYPOINT. Each element is a separate token, not a shell command — to run a
shell command use: ["sh", "-c", "my command"].

If not provided, the container image's own ENTRYPOINT is used.
items:
type: string
type: array
env:
description: |-
List of environment variables to set in the container.
Expand Down
22 changes: 22 additions & 0 deletions config/base/crd/bases/compute.datumapis.com_workloads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,28 @@ spec:
sandbox.
items:
properties:
args:
description: |-
Arguments to the entrypoint, overriding the image's CMD. Combined with
Command: when Command is also set the resulting invocation is
append(Command, Args...). When only Args is set it overrides CMD while
preserving the image's ENTRYPOINT.

If neither Command nor Args is set, the image's own ENTRYPOINT and CMD
are used unchanged.
items:
type: string
type: array
command:
description: |-
Entrypoint array to run in the container image, overriding the image's
ENTRYPOINT. Each element is a separate token, not a shell command — to run a
shell command use: ["sh", "-c", "my command"].

If not provided, the container image's own ENTRYPOINT is used.
items:
type: string
type: array
env:
description: |-
List of environment variables to set in the container.
Expand Down
8 changes: 4 additions & 4 deletions internal/controller/instance_writeback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func wbTestCellInstance() *computev1alpha.Instance {
},
Spec: computev1alpha.InstanceSpec{
Runtime: computev1alpha.InstanceRuntimeSpec{
Resources: computev1alpha.InstanceRuntimeResources{InstanceType: "d1-standard-2"},
Resources: computev1alpha.InstanceRuntimeResources{InstanceType: testInstanceType},
},
},
Status: computev1alpha.InstanceStatus{
Expand Down Expand Up @@ -182,7 +182,7 @@ func TestWriteBackToUpstream_UpdatePath_LabelMerge(t *testing.T) {
},
Spec: computev1alpha.InstanceSpec{
Runtime: computev1alpha.InstanceRuntimeSpec{
Resources: computev1alpha.InstanceRuntimeResources{InstanceType: "d1-standard-2"},
Resources: computev1alpha.InstanceRuntimeResources{InstanceType: testInstanceType},
},
},
}
Expand Down Expand Up @@ -240,7 +240,7 @@ func TestWriteBackToUpstream_LabelChangeTriggerUpdate(t *testing.T) {
},
Spec: computev1alpha.InstanceSpec{
Runtime: computev1alpha.InstanceRuntimeSpec{
Resources: computev1alpha.InstanceRuntimeResources{InstanceType: "d1-standard-2"},
Resources: computev1alpha.InstanceRuntimeResources{InstanceType: testInstanceType},
},
},
}
Expand Down Expand Up @@ -296,7 +296,7 @@ func TestWriteBackToUpstream_EmptyLinkingLabels_NonFatal(t *testing.T) {
},
Spec: computev1alpha.InstanceSpec{
Runtime: computev1alpha.InstanceRuntimeSpec{
Resources: computev1alpha.InstanceRuntimeResources{InstanceType: "d1-standard-2"},
Resources: computev1alpha.InstanceRuntimeResources{InstanceType: testInstanceType},
},
},
}
Expand Down
Loading