Skip to content

Commit

Permalink
s/RELATED_IMAGES_/RELATED_IMAGE_/ (#711)
Browse files Browse the repository at this point in the history
Co-authored-by: Quentin Barrand <quba@redhat.com>
  • Loading branch information
k8s-infra-cherrypick-robot and qbarrand authored Jan 23, 2024
1 parent 07b7b29 commit 515aa59
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ci/install-ci-hub/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ patches:
- name: manager
imagePullPolicy: Never
env:
- name: RELATED_IMAGES_SIGN
- name: RELATED_IMAGE_SIGN
value: host.minikube.internal:5000/kmm/signimage:local
2 changes: 1 addition & 1 deletion ci/install-ci-spoke/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ patches:
env:
- name: KMM_MANAGED
value: "1"
- name: RELATED_IMAGES_WORKER
- name: RELATED_IMAGE_WORKER
value: host.minikube.internal:5000/kmm/worker:local
4 changes: 2 additions & 2 deletions ci/install-ci/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ patches:
- name: manager
imagePullPolicy: Never
env:
- name: RELATED_IMAGES_SIGN
- name: RELATED_IMAGE_SIGN
value: host.minikube.internal:5000/kmm/signimage:local
- name: RELATED_IMAGES_WORKER
- name: RELATED_IMAGE_WORKER
value: host.minikube.internal:5000/kmm/worker:local
2 changes: 1 addition & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func main() {
commit = "<undefined>"
}

workerImage := cmd.GetEnvOrFatalError("RELATED_IMAGES_WORKER", setupLogger)
workerImage := cmd.GetEnvOrFatalError("RELATED_IMAGE_WORKER", setupLogger)

managed, err := GetBoolEnv("KMM_MANAGED")
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions config/manager-base/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: RELATED_IMAGES_BUILD
- name: RELATED_IMAGE_BUILD
value: gcr.io/kaniko-project/executor:latest
- name: RELATED_IMAGES_SIGN
- name: RELATED_IMAGE_SIGN
value: signer
imagePullPolicy: Always
securityContext:
Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager_worker_image_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ spec:
containers:
- name: manager
env:
- name: RELATED_IMAGES_WORKER
- name: RELATED_IMAGE_WORKER
value: worker
2 changes: 1 addition & 1 deletion internal/build/pod/maker.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (m *maker) MakePodTemplate(
func (m *maker) podSpec(mld *api.ModuleLoaderData, containerImage string, pushImage bool) v1.PodSpec {

buildConfig := mld.Build
kanikoImage := os.Getenv("RELATED_IMAGES_BUILD")
kanikoImage := os.Getenv("RELATED_IMAGE_BUILD")

if buildConfig.KanikoParams != nil && buildConfig.KanikoParams.Tag != "" {
if idx := strings.IndexAny(kanikoImage, "@:"); idx != -1 {
Expand Down
2 changes: 1 addition & 1 deletion internal/build/pod/maker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var _ = Describe("MakePodTemplate", func() {
kernelVersion = "1.2.3"
moduleName = "module-name"
namespace = "some-namespace"
relatedImageEnvVar = "RELATED_IMAGES_BUILD"
relatedImageEnvVar = "RELATED_IMAGE_BUILD"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions internal/sign/pod/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (s *signer) MakePodTemplate(

td := TemplateData{
FilesToSign: mld.Sign.FilesToSign,
SignImage: os.Getenv("RELATED_IMAGES_SIGN"),
SignImage: os.Getenv("RELATED_IMAGE_SIGN"),
}

args := make([]string, 0)
Expand Down Expand Up @@ -181,7 +181,7 @@ func (s *signer) MakePodTemplate(
Containers: []v1.Container{
{
Name: "kaniko",
Image: os.Getenv("RELATED_IMAGES_BUILD"),
Image: os.Getenv("RELATED_IMAGE_BUILD"),
Args: args,
VolumeMounts: volumeMounts,
},
Expand Down
4 changes: 2 additions & 2 deletions internal/sign/pod/signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ COPY --from=signimage /tmp/signroot/modules/simple-procfs-kmod.ko /modules/simpl
privateSignData := map[string][]byte{constants.PrivateSignDataKey: []byte(privateKey)}

DescribeTable("should set fields correctly", func(imagePullSecret *v1.LocalObjectReference) {
GinkgoT().Setenv("RELATED_IMAGES_BUILD", buildImage)
GinkgoT().Setenv("RELATED_IMAGES_SIGN", "some-sign-image:some-tag")
GinkgoT().Setenv("RELATED_IMAGE_BUILD", buildImage)
GinkgoT().Setenv("RELATED_IMAGE_SIGN", "some-sign-image:some-tag")

ctx := context.Background()
nodeSelector := map[string]string{"arch": "x64"}
Expand Down

0 comments on commit 515aa59

Please sign in to comment.