From d8e8976d9889b5a07c54bf9f077e3ef859735928 Mon Sep 17 00:00:00 2001 From: Bohan Chen Date: Tue, 9 May 2023 15:05:28 -0400 Subject: [PATCH] inline the image source for cluster buildpacks this is what the Buildpack resource do and what the docs and rfc both say. Signed-off-by: Bohan Chen --- pkg/apis/build/v1alpha2/cluster_buildpack_types.go | 2 +- pkg/apis/build/v1alpha2/cluster_buildpack_validation.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/apis/build/v1alpha2/cluster_buildpack_types.go b/pkg/apis/build/v1alpha2/cluster_buildpack_types.go index b364e2084..e5b4b7dac 100644 --- a/pkg/apis/build/v1alpha2/cluster_buildpack_types.go +++ b/pkg/apis/build/v1alpha2/cluster_buildpack_types.go @@ -29,7 +29,7 @@ type ClusterBuildpack struct { // +k8s:openapi-gen=true type ClusterBuildpackSpec struct { // +listType - corev1alpha1.ImageSource `json:"source,omitempty"` + corev1alpha1.ImageSource `json:",inline"` ServiceAccountRef *corev1.ObjectReference `json:"serviceAccountRef,omitempty"` } diff --git a/pkg/apis/build/v1alpha2/cluster_buildpack_validation.go b/pkg/apis/build/v1alpha2/cluster_buildpack_validation.go index d120ba7fe..17248e458 100644 --- a/pkg/apis/build/v1alpha2/cluster_buildpack_validation.go +++ b/pkg/apis/build/v1alpha2/cluster_buildpack_validation.go @@ -24,5 +24,5 @@ func (s *ClusterBuildpackSpec) Validate(ctx context.Context) *apis.FieldError { } } - return validate.Image(s.Image).ViaField() + return validate.Image(s.Image) }