Skip to content

Commit

Permalink
Merge pull request #2089 from tecarter94/remove-deprecated-code-from-crd
Browse files Browse the repository at this point in the history
Remove deprecated code in CRD
  • Loading branch information
tecarter94 committed Sep 17, 2024
2 parents bba2231 + fa39a99 commit 5ee6476
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 220 deletions.
14 changes: 0 additions & 14 deletions deploy/crds/base/jvmbuildservice.io_dependencybuilds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ spec:
url:
type: string
type: object
hermeticBuildImage:
description: |-
Deprecated
The hermetic build image produced by the build
type: string
image:
description: the image resulting from the run
type: string
Expand Down Expand Up @@ -210,9 +205,6 @@ spec:
type: string
javaVersion:
type: string
pipeline:
description: Deprecated
type: string
postBuildScript:
type: string
preBuildScript:
Expand Down Expand Up @@ -366,9 +358,6 @@ spec:
type: object
failedVerification:
type: boolean
hermetic:
description: Deprecated
type: boolean
message:
type: string
pipelineRetries:
Expand Down Expand Up @@ -422,9 +411,6 @@ spec:
type: string
javaVersion:
type: string
pipeline:
description: Deprecated
type: string
postBuildScript:
type: string
preBuildScript:
Expand Down
33 changes: 0 additions & 33 deletions deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ spec:
url:
type: string
type: object
hermeticBuilds:
description: Deprecated
type: string
mavenBaseLocations:
additionalProperties:
type: string
Expand Down Expand Up @@ -148,36 +145,6 @@ spec:
secretName:
type: string
type: object
relocationPatterns:
description: Deprecated
items:
properties:
relocationPattern:
properties:
buildPolicy:
type: string
patterns:
items:
properties:
pattern:
properties:
from:
type: string
to:
type: string
required:
- from
- to
type: object
required:
- pattern
type: object
type: array
type: object
required:
- relocationPattern
type: object
type: array
requireArtifactVerification:
description: |-
If this is true then the build will fail if artifact verification fails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ spec:
url:
type: string
type: object
hermeticBuildImage:
description: |-
Deprecated
The hermetic build image produced by the build
type: string
image:
description: the image resulting from the run
type: string
Expand Down Expand Up @@ -210,9 +205,6 @@ spec:
type: string
javaVersion:
type: string
pipeline:
description: Deprecated
type: string
postBuildScript:
type: string
preBuildScript:
Expand Down Expand Up @@ -366,9 +358,6 @@ spec:
type: object
failedVerification:
type: boolean
hermetic:
description: Deprecated
type: boolean
message:
type: string
pipelineRetries:
Expand Down Expand Up @@ -422,9 +411,6 @@ spec:
type: string
javaVersion:
type: string
pipeline:
description: Deprecated
type: string
postBuildScript:
type: string
preBuildScript:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ spec:
url:
type: string
type: object
hermeticBuilds:
description: Deprecated
type: string
mavenBaseLocations:
additionalProperties:
type: string
Expand Down Expand Up @@ -148,36 +145,6 @@ spec:
secretName:
type: string
type: object
relocationPatterns:
description: Deprecated
items:
properties:
relocationPattern:
properties:
buildPolicy:
type: string
patterns:
items:
properties:
pattern:
properties:
from:
type: string
to:
type: string
required:
- from
- to
type: object
required:
- pattern
type: object
type: array
type: object
required:
- relocationPattern
type: object
type: array
requireArtifactVerification:
description: |-
If this is true then the build will fail if artifact verification fails
Expand Down
29 changes: 11 additions & 18 deletions pkg/apis/jvmbuildservice/v1alpha1/dependencybuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,16 @@ type DependencyBuildStatus struct {
Message string `json:"message,omitempty"`
Contaminants []*Contaminant `json:"contaminates,omitempty"`
// PotentialBuildRecipes additional recipes to try if the current recipe fails
PotentialBuildRecipes []*BuildRecipe `json:"potentialBuildRecipes,omitempty"`
PotentialBuildRecipesIndex int `json:"potentialBuildRecipesIndex,omitempty"`
CommitTime int64 `json:"commitTime,omitempty"`
DeployedArtifacts []string `json:"deployedArtifacts,omitempty"`
FailedVerification bool `json:"failedVerification,omitempty"`
// Deprecated
Hermetic bool `json:"hermetic,omitempty"`
PipelineRetries int `json:"pipelineRetries,omitempty"`
BuildAttempts []*BuildAttempt `json:"buildAttempts,omitempty"`
DiscoveryPipelineResults *PipelineResults `json:"discoveryPipelineResults,omitempty"`
DeployPipelineResults *PipelineResults `json:"deployPipelineResults,omitempty"`
PreBuildImages []PreBuildImage `json:"builderImages,omitempty"`
PotentialBuildRecipes []*BuildRecipe `json:"potentialBuildRecipes,omitempty"`
PotentialBuildRecipesIndex int `json:"potentialBuildRecipesIndex,omitempty"`
CommitTime int64 `json:"commitTime,omitempty"`
DeployedArtifacts []string `json:"deployedArtifacts,omitempty"`
FailedVerification bool `json:"failedVerification,omitempty"`
PipelineRetries int `json:"pipelineRetries,omitempty"`
BuildAttempts []*BuildAttempt `json:"buildAttempts,omitempty"`
DiscoveryPipelineResults *PipelineResults `json:"discoveryPipelineResults,omitempty"`
DeployPipelineResults *PipelineResults `json:"deployPipelineResults,omitempty"`
PreBuildImages []PreBuildImage `json:"builderImages,omitempty"`
}

// +genclient
Expand Down Expand Up @@ -103,9 +101,6 @@ type BuildPipelineRunResults struct {
VerificationResults string `json:"verificationFailures,omitempty"`
// The produced GAVs
Gavs []string `json:"gavs,omitempty"`
// Deprecated
// The hermetic build image produced by the build
HermeticBuildImage string `json:"hermeticBuildImage,omitempty"`
// The git archive source information
GitArchive GitArchive `json:"gitArchive,omitempty"`

Expand Down Expand Up @@ -150,9 +145,7 @@ func (r *DependencyBuildStatus) ProblemContaminates() []*Contaminant {
}

type BuildRecipe struct {
//Deprecated
Pipeline string `json:"pipeline,omitempty"`
Tool string `json:"tool,omitempty"`
Tool string `json:"tool,omitempty"`
// The base builder image (ubi7 / ubi8)
Image string `json:"image,omitempty"`
ContextPath string `json:"contextPath,omitempty"`
Expand Down
26 changes: 0 additions & 26 deletions pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type HermeticBuildType string

const (
JBSConfigName = "jvm-build-config"
DefaultImageSecretName = "jvm-build-image-secrets" //#nosec
Expand Down Expand Up @@ -33,8 +31,6 @@ const (
ConfigArtifactCacheWorkerThreadsDefault = "50"
ConfigArtifactCacheStorageDefault = "10Gi"

HermeticBuildTypeRequired HermeticBuildType = "Required"

KonfluxBuildDefinitions = "https://github.com/konflux-ci/build-definitions.git"
KonfluxBuildahPath = "task/buildah-oci-ta/0.2/buildah-oci-ta.yaml"
)
Expand All @@ -45,8 +41,6 @@ type JBSConfigSpec struct {
// If this is true then the build will fail if artifact verification fails
// otherwise deploy will happen as normal, but a field will be set on the DependencyBuild
RequireArtifactVerification bool `json:"requireArtifactVerification,omitempty"`
// Deprecated
HermeticBuilds HermeticBuildType `json:"hermeticBuilds,omitempty"`

AdditionalRecipes []string `json:"additionalRecipes,omitempty"`

Expand All @@ -58,8 +52,6 @@ type JBSConfigSpec struct {
GitSourceArchive GitSourceArchive `json:"gitSourceArchive,omitempty"`
CacheSettings CacheSettings `json:"cacheSettings,omitempty"`
BuildSettings BuildSettings `json:"buildSettings,omitempty"`
// Deprecated
RelocationPatterns []RelocationPatternElement `json:"relocationPatterns,omitempty"`

// Whether to use a standard build pipeline or build in a Docker container via buildah.
ContainerBuilds bool `json:"containerBuilds,omitempty"`
Expand Down Expand Up @@ -130,24 +122,6 @@ type GitSourceArchive struct {
DisableSSLVerification bool `json:"disableSSLVerification,omitempty"`
}

type RelocationPatternElement struct {
RelocationPattern RelocationPattern `json:"relocationPattern"`
}

type RelocationPattern struct {
BuildPolicy string `json:"buildPolicy,omitempty" default:"default"`
Patterns []PatternElement `json:"patterns,omitempty"`
}

type PatternElement struct {
Pattern Pattern `json:"pattern"`
}

type Pattern struct {
From string `json:"from"`
To string `json:"to"`
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:subresource:status
Expand Down
74 changes: 0 additions & 74 deletions pkg/apis/jvmbuildservice/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions pkg/reconciler/jbsconfig/jbsconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,6 @@ func (r *ReconcilerJBSConfig) Reconcile(ctx context.Context, request reconcile.R
return reconcile.Result{}, err
}
log.Info("reconciling JBSConfig")
if jbsConfig.Spec.RelocationPatterns != nil {
jbsConfig.Spec.RelocationPatterns = nil
return reconcile.Result{}, r.client.Update(ctx, &jbsConfig)
}
if jbsConfig.Spec.HermeticBuilds != "" {
jbsConfig.Spec.HermeticBuilds = ""
return reconcile.Result{}, r.client.Update(ctx, &jbsConfig)
}

// TODO: ### Should we add some sanity checking i.e. if ContainerBuilds are enabled, we need GIT_DEPLOY_TOKEN
// i.e. source archiving in DeployPreBuildSourceCommand
Expand Down

0 comments on commit 5ee6476

Please sign in to comment.