From bf9be66abe3f96df034ac432d27d09bca9502f17 Mon Sep 17 00:00:00 2001 From: Tobias Hodges Date: Fri, 9 Feb 2024 10:11:34 -0800 Subject: [PATCH] Fix #84: remove GitConfig from API spec (#141) * Fix #84: enum validation on gitConfigSpec.type * Formatting * Remove GitConfig from spec and build Signed-off-by: Toby Hodges --- api/v1alpha1/localbuild_types.go | 7 ------- api/v1alpha1/zz_generated.deepcopy.go | 16 ---------------- pkg/build/build.go | 4 ---- .../idpbuilder.cnoe.io_localbuilds.yaml | 8 -------- 4 files changed, 35 deletions(-) diff --git a/api/v1alpha1/localbuild_types.go b/api/v1alpha1/localbuild_types.go index 3dd93281..75f78f49 100644 --- a/api/v1alpha1/localbuild_types.go +++ b/api/v1alpha1/localbuild_types.go @@ -28,14 +28,7 @@ type EmbeddedArgoApplicationsPackageConfigSpec struct { Enabled bool `json:"enabled,omitempty"` } -// GitConfigSpec controls what git server to use for the idpbuilder -// It can take on the values of either gitea or gitserver -type GitConfigSpec struct { - Type string `json:"type,omitempty"` -} - type PackageConfigsSpec struct { - GitConfig GitConfigSpec `json:"gitConfig,omitempty"` Argo ArgoPackageConfigSpec `json:"argoPackageConfigs,omitempty"` EmbeddedArgoApplications EmbeddedArgoApplicationsPackageConfigSpec `json:"embeddedArgoApplicationsPackageConfigs,omitempty"` CustomPackageDirs []string `json:"customPackageDirs,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 8f7e5544..868402ec 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -196,21 +196,6 @@ func (in *EmbeddedArgoApplicationsPackageConfigSpec) DeepCopy() *EmbeddedArgoApp return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitConfigSpec) DeepCopyInto(out *GitConfigSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitConfigSpec. -func (in *GitConfigSpec) DeepCopy() *GitConfigSpec { - if in == nil { - return nil - } - out := new(GitConfigSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GitRepository) DeepCopyInto(out *GitRepository) { *out = *in @@ -459,7 +444,6 @@ func (in *ObjectRef) DeepCopy() *ObjectRef { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PackageConfigsSpec) DeepCopyInto(out *PackageConfigsSpec) { *out = *in - out.GitConfig = in.GitConfig out.Argo = in.Argo out.EmbeddedArgoApplications = in.EmbeddedArgoApplications if in.CustomPackageDirs != nil { diff --git a/pkg/build/build.go b/pkg/build/build.go index 18862b32..664d840b 100644 --- a/pkg/build/build.go +++ b/pkg/build/build.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "github.com/cnoe-io/idpbuilder/api/v1alpha1" - "github.com/cnoe-io/idpbuilder/globals" "github.com/cnoe-io/idpbuilder/pkg/controllers" "github.com/cnoe-io/idpbuilder/pkg/kind" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -164,9 +163,6 @@ func (b *Build) Run(ctx context.Context, recreateCluster bool) error { EmbeddedArgoApplications: v1alpha1.EmbeddedArgoApplicationsPackageConfigSpec{ Enabled: true, }, - GitConfig: v1alpha1.GitConfigSpec{ - Type: globals.GiteaResourceName(), - }, CustomPackageDirs: b.customPackageDirs, }, } diff --git a/pkg/controllers/resources/idpbuilder.cnoe.io_localbuilds.yaml b/pkg/controllers/resources/idpbuilder.cnoe.io_localbuilds.yaml index 3eab2e00..7eb08aed 100644 --- a/pkg/controllers/resources/idpbuilder.cnoe.io_localbuilds.yaml +++ b/pkg/controllers/resources/idpbuilder.cnoe.io_localbuilds.yaml @@ -56,14 +56,6 @@ spec: argo applications and the associated GitServer type: boolean type: object - gitConfig: - description: GitConfigSpec controls what git server to use for - the idpbuilder It can take on the values of either gitea or - gitserver - properties: - type: - type: string - type: object type: object type: object status: