From 5d6510ca1337ae3c3c9a4e1003ec0584e5bc7abc Mon Sep 17 00:00:00 2001 From: Sascha Schwarze Date: Wed, 6 Sep 2023 22:47:11 +0200 Subject: [PATCH] Add missing spec.output.insecure flag to beta API --- deploy/crds/shipwright.io_buildruns.yaml | 11 +++++++++++ deploy/crds/shipwright.io_builds.yaml | 3 +++ pkg/apis/build/v1beta1/build_conversion.go | 4 ++-- pkg/apis/build/v1beta1/build_types.go | 5 +++++ pkg/apis/build/v1beta1/zz_generated.deepcopy.go | 5 +++++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/deploy/crds/shipwright.io_buildruns.yaml b/deploy/crds/shipwright.io_buildruns.yaml index be6a9cf136..d29e03082e 100644 --- a/deploy/crds/shipwright.io_buildruns.yaml +++ b/deploy/crds/shipwright.io_buildruns.yaml @@ -6380,6 +6380,10 @@ spec: image: description: Image is the reference of the image. type: string + insecure: + description: Insecure defines whether the registry is + not secure + type: boolean labels: additionalProperties: type: string @@ -8452,6 +8456,9 @@ spec: image: description: Image is the reference of the image. type: string + insecure: + description: Insecure defines whether the registry is not secure + type: boolean labels: additionalProperties: type: string @@ -10242,6 +10249,10 @@ spec: image: description: Image is the reference of the image. type: string + insecure: + description: Insecure defines whether the registry is not + secure + type: boolean labels: additionalProperties: type: string diff --git a/deploy/crds/shipwright.io_builds.yaml b/deploy/crds/shipwright.io_builds.yaml index 3cf17a7864..bfa8e8c74e 100644 --- a/deploy/crds/shipwright.io_builds.yaml +++ b/deploy/crds/shipwright.io_builds.yaml @@ -2257,6 +2257,9 @@ spec: image: description: Image is the reference of the image. type: string + insecure: + description: Insecure defines whether the registry is not secure + type: boolean labels: additionalProperties: type: string diff --git a/pkg/apis/build/v1beta1/build_conversion.go b/pkg/apis/build/v1beta1/build_conversion.go index 4d3e138dbc..acc756221b 100644 --- a/pkg/apis/build/v1beta1/build_conversion.go +++ b/pkg/apis/build/v1beta1/build_conversion.go @@ -130,6 +130,7 @@ func (dest *BuildSpec) ConvertFrom(orig *v1alpha1.BuildSpec) error { // Handle BuildSpec Output dest.Output.Image = orig.Output.Image + dest.Output.Insecure = orig.Output.Insecure if orig.Output.Credentials != nil { dest.Output.PushSecret = &orig.Output.Credentials.Name } @@ -205,9 +206,8 @@ func (dest *BuildSpec) ConvertTo(bs *v1alpha1.BuildSpec) error { } // Handle BuildSpec Output - // insecure := false - // bs.Output.Insecure = &insecure bs.Output.Image = dest.Output.Image + bs.Output.Insecure = dest.Output.Insecure if dest.Output.PushSecret != nil { bs.Output.Credentials = &corev1.LocalObjectReference{} bs.Output.Credentials.Name = *dest.Output.PushSecret diff --git a/pkg/apis/build/v1beta1/build_types.go b/pkg/apis/build/v1beta1/build_types.go index 03e48c5448..8fbe4c4104 100644 --- a/pkg/apis/build/v1beta1/build_types.go +++ b/pkg/apis/build/v1beta1/build_types.go @@ -177,6 +177,11 @@ type Image struct { // Image is the reference of the image. Image string `json:"image"` + // Insecure defines whether the registry is not secure + // + // +optional + Insecure *bool `json:"insecure,omitempty"` + // Describes the secret name for pushing a container image. // // +optional diff --git a/pkg/apis/build/v1beta1/zz_generated.deepcopy.go b/pkg/apis/build/v1beta1/zz_generated.deepcopy.go index 0311ee3b43..fda4d61dea 100644 --- a/pkg/apis/build/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/build/v1beta1/zz_generated.deepcopy.go @@ -760,6 +760,11 @@ func (in *GitSourceResult) DeepCopy() *GitSourceResult { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Image) DeepCopyInto(out *Image) { *out = *in + if in.Insecure != nil { + in, out := &in.Insecure, &out.Insecure + *out = new(bool) + **out = **in + } if in.PushSecret != nil { in, out := &in.PushSecret, &out.PushSecret *out = new(string)