This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 7b7947b8b0ff64b2c1b32194d0c0626f5ba9ecd1 Author: Antonin Stefanutti <anto...@stefanutti.fr> AuthorDate: Wed Feb 26 10:44:00 2020 +0100 feat(build): Support custom container security context --- pkg/apis/camel/v1/build_types.go | 13 +++++++------ pkg/apis/camel/v1/integrationplatform_types_support.go | 2 +- pkg/apis/camel/v1/zz_generated.deepcopy.go | 5 +++++ pkg/controller/build/schedule_pod.go | 1 + 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pkg/apis/camel/v1/build_types.go b/pkg/apis/camel/v1/build_types.go index 2045442..8b40734 100644 --- a/pkg/apis/camel/v1/build_types.go +++ b/pkg/apis/camel/v1/build_types.go @@ -48,12 +48,13 @@ type BaseTask struct { // ContainerTask -- type ContainerTask struct { - BaseTask `json:",inline"` - Image string `json:"image,omitempty"` - Command []string `json:"command,omitempty"` - Args []string `json:"args,omitempty"` - Env []corev1.EnvVar `json:"env,omitempty"` - WorkingDir string `json:"workingDir,omitempty"` + BaseTask `json:",inline"` + Image string `json:"image,omitempty"` + Command []string `json:"command,omitempty"` + Args []string `json:"args,omitempty"` + Env []corev1.EnvVar `json:"env,omitempty"` + WorkingDir string `json:"workingDir,omitempty"` + SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"` } // ImageTask -- diff --git a/pkg/apis/camel/v1/integrationplatform_types_support.go b/pkg/apis/camel/v1/integrationplatform_types_support.go index ce33114..23acc1a 100644 --- a/pkg/apis/camel/v1/integrationplatform_types_support.go +++ b/pkg/apis/camel/v1/integrationplatform_types_support.go @@ -97,7 +97,7 @@ func (in *IntegrationPlatform) GetActualValue(extractor func(spec IntegrationPla return res } -// ResyncStatusFullConfig copies the spec configuration into the status-fullConfig field. +// ResyncStatusFullConfig copies the spec configuration into the status field. func (in *IntegrationPlatform) ResyncStatusFullConfig() { cl := in.Spec.DeepCopy() in.Status.IntegrationPlatformSpec = *cl diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go index dbe9858..8ec7148 100644 --- a/pkg/apis/camel/v1/zz_generated.deepcopy.go +++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go @@ -515,6 +515,11 @@ func (in *ContainerTask) DeepCopyInto(out *ContainerTask) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(corev1.SecurityContext) + (*in).DeepCopyInto(*out) + } return } diff --git a/pkg/controller/build/schedule_pod.go b/pkg/controller/build/schedule_pod.go index d4b7c45..82c134d 100644 --- a/pkg/controller/build/schedule_pod.go +++ b/pkg/controller/build/schedule_pod.go @@ -188,6 +188,7 @@ func (action *schedulePodAction) addImageTaskToPod(task *v1.ImageTask, pod *core Env: task.Env, WorkingDir: task.WorkingDir, VolumeMounts: task.VolumeMounts, + SecurityContext: task.SecurityContext, }) action.addBaseTaskToPod(&task.BaseTask, pod)