diff --git a/CHANGELOG.md b/CHANGELOG.md index affb10d..6b0aba6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. * Objects are handled one by one * First error stops execution * Empty objects are ignored +* (#56) Add support for defining entrypoints in workloads ### Changed diff --git a/internal/pkg/rancher/cluster/project/model/testdata/golden-files/descriptor.job.golden b/internal/pkg/rancher/cluster/project/model/testdata/golden-files/descriptor.job.golden index 9588d9e..e8d39da 100644 --- a/internal/pkg/rancher/cluster/project/model/testdata/golden-files/descriptor.job.golden +++ b/internal/pkg/rancher/cluster/project/model/testdata/golden-files/descriptor.job.golden @@ -14,6 +14,8 @@ spec: - -Mbignum=bpi - -wle - print bpi(2000) + entrypoint: + - /bin/sh environment: TEST_VAR: test value image: perl diff --git a/internal/pkg/rancher/cluster/project/model/testdata/input/job.yaml b/internal/pkg/rancher/cluster/project/model/testdata/input/job.yaml index 8acb979..cbbdbac 100644 --- a/internal/pkg/rancher/cluster/project/model/testdata/input/job.yaml +++ b/internal/pkg/rancher/cluster/project/model/testdata/input/job.yaml @@ -11,6 +11,7 @@ spec: containers: - allowPrivilegeEscalation: true command: [ "perl", "-Mbignum=bpi", "-wle", "print bpi(2000)" ] + entrypoint: [ "/bin/sh" ] environment: TEST_VAR: test value environmentFrom: null diff --git a/internal/pkg/rancher/cluster/project/model/workload_model.go b/internal/pkg/rancher/cluster/project/model/workload_model.go index ed421ef..b9cde31 100644 --- a/internal/pkg/rancher/cluster/project/model/workload_model.go +++ b/internal/pkg/rancher/cluster/project/model/workload_model.go @@ -63,6 +63,7 @@ type baseWorkload struct { type Container struct { AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" yaml:"allowPrivilegeEscalation,omitempty"` Command []string `json:"command,omitempty" yaml:"command,omitempty"` + Entrypoint []string `json:"entrypoint,omitempty" yaml:"entrypoint,omitempty"` Environment map[string]string `json:"environment,omitempty" yaml:"environment,omitempty"` EnvironmentFrom []EnvironmentFrom `json:"environmentFrom,omitempty" yaml:"environmentFrom,omitempty"` Image string `json:"image,omitempty" yaml:"image,omitempty"`