Skip to content

Commit cdb7468

Browse files
committed
Added ImagePullPolicy to parseDefintion and scancompletionhook.
1 parent ed0149e commit cdb7468

7 files changed

Lines changed: 1263 additions & 7 deletions

File tree

‎operator/apis/execution/v1/parsedefinition_types.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type ParseDefinitionSpec struct {
3333
Image string `json:"image,omitempty"`
3434
// ImagePullSecrets used to access private parser images
3535
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
36+
// Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
37+
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
3638

3739
// TTLSecondsAfterFinished configures the ttlSecondsAfterFinished field for the created parse job
3840
// +nullable

‎operator/apis/execution/v1/scancompletionhook.go‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,25 @@ const (
3838
type ScanCompletionHookSpec struct {
3939
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
4040
// Important: Run "make" to regenerate code after modifying this file
41+
Type HookType `json:"type"`
4142

4243
// Image is the container image for the hooks kubernetes job
43-
Image string `json:"image,omitempty"`
44+
Image string `json:"image,omitempty"`
45+
// ImagePullSecrets used to access private parser images
4446
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
45-
Env []corev1.EnvVar `json:"env,omitempty"`
46-
Type HookType `json:"type"`
47+
// Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
48+
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
49+
50+
// Env allows to specify environment vars for the parser container.
51+
Env []corev1.EnvVar `json:"env,omitempty"`
52+
// Volumes allows to specify volumes for the parser container.
53+
Volumes []corev1.Volume `json:"volumes,omitempty"`
54+
// VolumeMounts allows to specify volume mounts for the parser container.
55+
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
56+
4757
// ServiceAccountName Name of the serviceAccount Name used. Should only be used if your hook needs specifc RBAC Access. Otherwise the hook is run using a "scan-completion-hook" service account. The service account should have at least "get" rights on scans.execution.securecodebox.io, and "get" & "patch" scans.execution.securecodebox.io/status
4858
ServiceAccountName *string `json:"serviceAccountName,omitempty"`
59+
4960
// TTLSecondsAfterFinished configures the ttlSecondsAfterFinished field for the created hook job
5061
// +nullable
5162
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`

‎operator/apis/execution/v1/zz_generated.deepcopy.go‎

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎operator/config/crd/bases/execution.securecodebox.io_parsedefinitions.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ spec:
143143
description: Image is the reference to the parser container image which
144144
ca transform the raw scan report into findings
145145
type: string
146+
imagePullPolicy:
147+
description: 'Image pull policy. One of Always, Never, IfNotPresent.
148+
Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
149+
Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images'
150+
type: string
146151
imagePullSecrets:
147152
description: ImagePullSecrets used to access private parser images
148153
items:

0 commit comments

Comments
 (0)