From 39638b11d48dd00f17931ee48ac87b7130c7f957 Mon Sep 17 00:00:00 2001
From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com>
Date: Mon, 25 Mar 2024 10:38:09 +0100
Subject: [PATCH] [Feature] Remove ImagePullSecrets Reference from Container
(#1629)
---
CHANGELOG.md | 1 +
docs/api/ArangoMLExtension.V1Alpha1.md | 78 +++++++------------
docs/api/ArangoMLStorage.V1Alpha1.md | 12 +--
docs/api/ArangoProfile.V1Alpha1.md | 12 +--
.../v1alpha1/container/resources/image.go | 26 -------
.../container/resources/image_test.go | 11 ---
.../resources/zz_generated.deepcopy.go | 25 ------
.../crds/ml-extension.schema.generated.yaml | 12 ---
pkg/crd/crds/ml-storage.schema.generated.yaml | 4 -
.../scheduler-profile.schema.generated.yaml | 4 -
10 files changed, 32 insertions(+), 153 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 15cbcddce..531044fe5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@
- (Feature) Expose Force CRD Install option
- (Maintenance) Move Container utils functions
- (Feature) ArangoProfile Selectors
+- (Bugfix) Remove ImagePullSecrets Reference from Container
## [1.2.39](https://github.com/arangodb/kube-arangodb/tree/1.2.39) (2024-03-11)
- (Feature) Extract Scheduler API
diff --git a/docs/api/ArangoMLExtension.V1Alpha1.md b/docs/api/ArangoMLExtension.V1Alpha1.md
index 6dda8b824..cee3a888f 100644
--- a/docs/api/ArangoMLExtension.V1Alpha1.md
+++ b/docs/api/ArangoMLExtension.V1Alpha1.md
@@ -193,7 +193,7 @@ Default Value: `false`
### .spec.deployment.prediction.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -201,7 +201,7 @@ Image define image details
### .spec.deployment.prediction.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -209,14 +209,6 @@ Default Value: `IfNotPresent`
***
-### .spec.deployment.prediction.imagePullSecrets
-
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
-
-ImagePullSecrets define Secrets used to pull Image from registry
-
-***
-
### .spec.deployment.prediction.lifecycle
Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35)
@@ -391,7 +383,7 @@ Default Value: `false`
### .spec.deployment.project.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -399,7 +391,7 @@ Image define image details
### .spec.deployment.project.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -407,14 +399,6 @@ Default Value: `IfNotPresent`
***
-### .spec.deployment.project.imagePullSecrets
-
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
-
-ImagePullSecrets define Secrets used to pull Image from registry
-
-***
-
### .spec.deployment.project.lifecycle
Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35)
@@ -662,7 +646,7 @@ Default Value: `false`
### .spec.deployment.training.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -670,7 +654,7 @@ Image define image details
### .spec.deployment.training.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -678,14 +662,6 @@ Default Value: `IfNotPresent`
***
-### .spec.deployment.training.imagePullSecrets
-
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
-
-ImagePullSecrets define Secrets used to pull Image from registry
-
-***
-
### .spec.deployment.training.lifecycle
Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35)
@@ -924,7 +900,7 @@ Default Value: `false`
### .spec.init.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -932,7 +908,7 @@ Image define image details
### .spec.init.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -942,7 +918,7 @@ Default Value: `IfNotPresent`
### .spec.init.imagePullSecrets
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
+Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36)
ImagePullSecrets define Secrets used to pull Image from registry
@@ -1270,7 +1246,7 @@ Default Value: `false`
### .spec.jobsTemplates.featurization.cpu.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -1278,7 +1254,7 @@ Image define image details
### .spec.jobsTemplates.featurization.cpu.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -1288,7 +1264,7 @@ Default Value: `IfNotPresent`
### .spec.jobsTemplates.featurization.cpu.imagePullSecrets
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
+Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36)
ImagePullSecrets define Secrets used to pull Image from registry
@@ -1616,7 +1592,7 @@ Default Value: `false`
### .spec.jobsTemplates.featurization.gpu.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -1624,7 +1600,7 @@ Image define image details
### .spec.jobsTemplates.featurization.gpu.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -1634,7 +1610,7 @@ Default Value: `IfNotPresent`
### .spec.jobsTemplates.featurization.gpu.imagePullSecrets
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
+Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36)
ImagePullSecrets define Secrets used to pull Image from registry
@@ -1962,7 +1938,7 @@ Default Value: `false`
### .spec.jobsTemplates.prediction.cpu.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -1970,7 +1946,7 @@ Image define image details
### .spec.jobsTemplates.prediction.cpu.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -1980,7 +1956,7 @@ Default Value: `IfNotPresent`
### .spec.jobsTemplates.prediction.cpu.imagePullSecrets
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
+Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36)
ImagePullSecrets define Secrets used to pull Image from registry
@@ -2308,7 +2284,7 @@ Default Value: `false`
### .spec.jobsTemplates.prediction.gpu.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -2316,7 +2292,7 @@ Image define image details
### .spec.jobsTemplates.prediction.gpu.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -2326,7 +2302,7 @@ Default Value: `IfNotPresent`
### .spec.jobsTemplates.prediction.gpu.imagePullSecrets
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
+Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36)
ImagePullSecrets define Secrets used to pull Image from registry
@@ -2654,7 +2630,7 @@ Default Value: `false`
### .spec.jobsTemplates.training.cpu.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -2662,7 +2638,7 @@ Image define image details
### .spec.jobsTemplates.training.cpu.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -2672,7 +2648,7 @@ Default Value: `IfNotPresent`
### .spec.jobsTemplates.training.cpu.imagePullSecrets
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
+Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36)
ImagePullSecrets define Secrets used to pull Image from registry
@@ -3000,7 +2976,7 @@ Default Value: `false`
### .spec.jobsTemplates.training.gpu.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -3008,7 +2984,7 @@ Image define image details
### .spec.jobsTemplates.training.gpu.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -3018,7 +2994,7 @@ Default Value: `IfNotPresent`
### .spec.jobsTemplates.training.gpu.imagePullSecrets
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
+Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/pod/resources/image.go#L36)
ImagePullSecrets define Secrets used to pull Image from registry
diff --git a/docs/api/ArangoMLStorage.V1Alpha1.md b/docs/api/ArangoMLStorage.V1Alpha1.md
index bc0d89e26..4a3bb2ad9 100644
--- a/docs/api/ArangoMLStorage.V1Alpha1.md
+++ b/docs/api/ArangoMLStorage.V1Alpha1.md
@@ -172,7 +172,7 @@ Links:
### .spec.mode.sidecar.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -180,7 +180,7 @@ Image define image details
### .spec.mode.sidecar.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -188,14 +188,6 @@ Default Value: `IfNotPresent`
***
-### .spec.mode.sidecar.imagePullSecrets
-
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
-
-ImagePullSecrets define Secrets used to pull Image from registry
-
-***
-
### .spec.mode.sidecar.lifecycle
Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35)
diff --git a/docs/api/ArangoProfile.V1Alpha1.md b/docs/api/ArangoProfile.V1Alpha1.md
index 3fa5b2541..9fd070f30 100644
--- a/docs/api/ArangoProfile.V1Alpha1.md
+++ b/docs/api/ArangoProfile.V1Alpha1.md
@@ -104,7 +104,7 @@ Links:
### .spec.template.container.containers.\.image
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L37)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L35)
Image define image details
@@ -112,7 +112,7 @@ Image define image details
### .spec.template.container.containers.\.imagePullPolicy
-Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L41)
+Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L39)
ImagePullPolicy define Image pull policy
@@ -120,14 +120,6 @@ Default Value: `IfNotPresent`
***
-### .spec.template.container.containers.\.imagePullSecrets
-
-Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/image.go#L44)
-
-ImagePullSecrets define Secrets used to pull Image from registry
-
-***
-
### .spec.template.container.containers.\.lifecycle
Type: `core.Lifecycle` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.39/pkg/apis/scheduler/v1alpha1/container/resources/lifecycle.go#L35)
diff --git a/pkg/apis/scheduler/v1alpha1/container/resources/image.go b/pkg/apis/scheduler/v1alpha1/container/resources/image.go
index c29e81d10..4f06422e1 100644
--- a/pkg/apis/scheduler/v1alpha1/container/resources/image.go
+++ b/pkg/apis/scheduler/v1alpha1/container/resources/image.go
@@ -28,8 +28,6 @@ import (
"github.com/arangodb/kube-arangodb/pkg/util"
)
-type ImagePullSecrets []string
-
var _ interfaces.Container[Image] = &Image{}
type Image struct {
@@ -39,9 +37,6 @@ type Image struct {
// ImagePullPolicy define Image pull policy
// +doc/default: IfNotPresent
ImagePullPolicy *core.PullPolicy `json:"imagePullPolicy,omitempty"`
-
- // ImagePullSecrets define Secrets used to pull Image from registry
- ImagePullSecrets ImagePullSecrets `json:"imagePullSecrets,omitempty"`
}
func (i *Image) Apply(pod *core.PodTemplateSpec, container *core.Container) error {
@@ -52,16 +47,6 @@ func (i *Image) Apply(pod *core.PodTemplateSpec, container *core.Container) erro
container.Image = util.WithDefault(i.Image)
container.ImagePullPolicy = util.WithDefault(i.ImagePullPolicy)
- for _, secret := range i.ImagePullSecrets {
- if hasImagePullSecret(pod.Spec.ImagePullSecrets, secret) {
- continue
- }
-
- pod.Spec.ImagePullSecrets = append(pod.Spec.ImagePullSecrets, core.LocalObjectReference{
- Name: secret,
- })
- }
-
return nil
}
@@ -93,16 +78,5 @@ func (i *Image) Validate() error {
return shared.WithErrors(
shared.PrefixResourceErrors("image", shared.ValidateRequired(i.Image, shared.ValidateImage)),
shared.PrefixResourceErrors("imagePullPolicy", shared.ValidateOptional(i.ImagePullPolicy, shared.ValidatePullPolicy)),
- shared.PrefixResourceErrors("pullSecrets", shared.ValidateList(i.ImagePullSecrets, shared.ValidateResourceName)),
)
}
-
-func hasImagePullSecret(secrets []core.LocalObjectReference, secret string) bool {
- for _, sec := range secrets {
- if sec.Name == secret {
- return true
- }
- }
-
- return false
-}
diff --git a/pkg/apis/scheduler/v1alpha1/container/resources/image_test.go b/pkg/apis/scheduler/v1alpha1/container/resources/image_test.go
index eb1316859..47082a9f0 100644
--- a/pkg/apis/scheduler/v1alpha1/container/resources/image_test.go
+++ b/pkg/apis/scheduler/v1alpha1/container/resources/image_test.go
@@ -92,29 +92,18 @@ func Test_Image(t *testing.T) {
applyImage(t, &core.PodTemplateSpec{}, &core.Container{}, &Image{
Image: util.NewType("image"),
ImagePullPolicy: util.NewType(core.PullAlways),
- ImagePullSecrets: []string{
- "secret",
- },
})(func(t *testing.T, pod *core.PodTemplateSpec, container *core.Container) {
require.EqualValues(t, "image", container.Image)
require.EqualValues(t, core.PullAlways, container.ImagePullPolicy)
- require.Len(t, pod.Spec.ImagePullSecrets, 1)
- require.Equal(t, "secret", pod.Spec.ImagePullSecrets[0].Name)
})
})
t.Run("With PS2", func(t *testing.T) {
applyImage(t, &core.PodTemplateSpec{}, &core.Container{}, &Image{
Image: util.NewType("image"),
ImagePullPolicy: util.NewType(core.PullAlways),
- ImagePullSecrets: []string{
- "secret",
- "secret",
- },
})(func(t *testing.T, pod *core.PodTemplateSpec, container *core.Container) {
require.EqualValues(t, "image", container.Image)
require.EqualValues(t, core.PullAlways, container.ImagePullPolicy)
- require.Len(t, pod.Spec.ImagePullSecrets, 1)
- require.Equal(t, "secret", pod.Spec.ImagePullSecrets[0].Name)
})
})
}
diff --git a/pkg/apis/scheduler/v1alpha1/container/resources/zz_generated.deepcopy.go b/pkg/apis/scheduler/v1alpha1/container/resources/zz_generated.deepcopy.go
index 22d0ea7e1..1a201856b 100644
--- a/pkg/apis/scheduler/v1alpha1/container/resources/zz_generated.deepcopy.go
+++ b/pkg/apis/scheduler/v1alpha1/container/resources/zz_generated.deepcopy.go
@@ -98,11 +98,6 @@ func (in *Image) DeepCopyInto(out *Image) {
*out = new(v1.PullPolicy)
**out = **in
}
- if in.ImagePullSecrets != nil {
- in, out := &in.ImagePullSecrets, &out.ImagePullSecrets
- *out = make(ImagePullSecrets, len(*in))
- copy(*out, *in)
- }
return
}
@@ -116,26 +111,6 @@ func (in *Image) DeepCopy() *Image {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in ImagePullSecrets) DeepCopyInto(out *ImagePullSecrets) {
- {
- in := &in
- *out = make(ImagePullSecrets, len(*in))
- copy(*out, *in)
- return
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePullSecrets.
-func (in ImagePullSecrets) DeepCopy() ImagePullSecrets {
- if in == nil {
- return nil
- }
- out := new(ImagePullSecrets)
- in.DeepCopyInto(out)
- return *out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Lifecycle) DeepCopyInto(out *Lifecycle) {
*out = *in
diff --git a/pkg/crd/crds/ml-extension.schema.generated.yaml b/pkg/crd/crds/ml-extension.schema.generated.yaml
index ca6fbae51..18679f7dc 100644
--- a/pkg/crd/crds/ml-extension.schema.generated.yaml
+++ b/pkg/crd/crds/ml-extension.schema.generated.yaml
@@ -522,10 +522,6 @@ v1alpha1:
type: string
imagePullPolicy:
type: string
- imagePullSecrets:
- items:
- type: string
- type: array
lifecycle:
properties:
postStart:
@@ -1017,10 +1013,6 @@ v1alpha1:
type: string
imagePullPolicy:
type: string
- imagePullSecrets:
- items:
- type: string
- type: array
lifecycle:
properties:
postStart:
@@ -1550,10 +1542,6 @@ v1alpha1:
type: string
imagePullPolicy:
type: string
- imagePullSecrets:
- items:
- type: string
- type: array
lifecycle:
properties:
postStart:
diff --git a/pkg/crd/crds/ml-storage.schema.generated.yaml b/pkg/crd/crds/ml-storage.schema.generated.yaml
index 9ba39ef85..cd0decec5 100644
--- a/pkg/crd/crds/ml-storage.schema.generated.yaml
+++ b/pkg/crd/crds/ml-storage.schema.generated.yaml
@@ -151,10 +151,6 @@ v1alpha1:
type: string
imagePullPolicy:
type: string
- imagePullSecrets:
- items:
- type: string
- type: array
lifecycle:
properties:
postStart:
diff --git a/pkg/crd/crds/scheduler-profile.schema.generated.yaml b/pkg/crd/crds/scheduler-profile.schema.generated.yaml
index 0b5b01b49..6dda17df0 100644
--- a/pkg/crd/crds/scheduler-profile.schema.generated.yaml
+++ b/pkg/crd/crds/scheduler-profile.schema.generated.yaml
@@ -202,10 +202,6 @@ v1alpha1:
type: string
imagePullPolicy:
type: string
- imagePullSecrets:
- items:
- type: string
- type: array
lifecycle:
properties:
postStart: