Skip to content

Commit

Permalink
chore(api): deprecate PublishStrategyOptions
Browse files Browse the repository at this point in the history
It's no longer in use for some time now.
  • Loading branch information
squakez authored and gansheer committed Aug 19, 2024
1 parent 7486014 commit dd84adf
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 29 deletions.
2 changes: 1 addition & 1 deletion docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2833,7 +2833,7 @@ map[string]string
|
Generic options that can used by any publish strategy
Deprecated: no longer in use
|`maxRunningBuilds` +
int32
Expand Down
4 changes: 2 additions & 2 deletions helm/camel-k/crds/camel-k-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3238,7 +3238,7 @@ spec:
PublishStrategyOptions:
additionalProperties:
type: string
description: Generic options that can used by any publish strategy
description: 'Deprecated: no longer in use'
type: object
baseImage:
description: |-
Expand Down Expand Up @@ -5286,7 +5286,7 @@ spec:
PublishStrategyOptions:
additionalProperties:
type: string
description: Generic options that can used by any publish strategy
description: 'Deprecated: no longer in use'
type: object
baseImage:
description: |-
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/camel/v1/integrationplatform_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ type IntegrationPlatformBuildSpec struct {
Timeout *metav1.Duration `json:"timeout,omitempty"`
// Maven configuration used to build the Camel/Camel-Quarkus applications
Maven MavenSpec `json:"maven,omitempty"`
// Generic options that can used by any publish strategy
// Deprecated: no longer in use
PublishStrategyOptions map[string]string `json:"PublishStrategyOptions,omitempty"`
// the maximum amount of parallel running pipelines started by this operator instance
MaxRunningBuilds int32 `json:"maxRunningBuilds,omitempty"`
Expand Down
10 changes: 0 additions & 10 deletions pkg/apis/camel/v1/integrationplatform_types_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,6 @@ func (in *IntegrationPlatformStatus) RemoveCondition(condType IntegrationPlatfor
in.Conditions = newConditions
}

// AddOption add a publish strategy option.
func (b *IntegrationPlatformBuildSpec) AddOption(option string, value string) {
options := b.PublishStrategyOptions
if options == nil {
options = make(map[string]string)
b.PublishStrategyOptions = options
}
options[option] = value
}

// GetTimeout returns the specified duration or a default one.
func (b IntegrationPlatformBuildSpec) GetTimeout() metav1.Duration {
if b.Timeout == nil {
Expand Down
9 changes: 1 addition & 8 deletions pkg/platform/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,7 @@ func applyPlatformSpec(source *v1.IntegrationPlatform, target *v1.IntegrationPla
if target.Status.Build.PublishStrategy == "" {
target.Status.Build.PublishStrategy = source.Status.Build.PublishStrategy
}
if target.Status.Build.PublishStrategyOptions == nil {
log.Debugf("Integration Platform %s [%s]: setting publish strategy options", target.Name, target.Namespace)
target.Status.Build.PublishStrategyOptions = source.Status.Build.PublishStrategyOptions
}

if target.Status.Build.BuildConfiguration.Strategy == "" {
target.Status.Build.BuildConfiguration.Strategy = source.Status.Build.BuildConfiguration.Strategy
}
Expand Down Expand Up @@ -311,10 +308,6 @@ func applyPlatformSpec(source *v1.IntegrationPlatform, target *v1.IntegrationPla
}

func setPlatformDefaults(p *v1.IntegrationPlatform, verbose bool) error {
if p.Status.Build.PublishStrategyOptions == nil {
log.Debugf("Integration Platform %s [%s]: setting publish strategy options", p.Name, p.Namespace)
p.Status.Build.PublishStrategyOptions = map[string]string{}
}
if p.Status.Build.RuntimeVersion == "" {
log.Debugf("Integration Platform %s [%s]: setting runtime version", p.Name, p.Namespace)
p.Status.Build.RuntimeVersion = defaults.DefaultRuntimeVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
PublishStrategyOptions:
additionalProperties:
type: string
description: Generic options that can used by any publish strategy
description: 'Deprecated: no longer in use'
type: object
baseImage:
description: |-
Expand Down Expand Up @@ -2140,7 +2140,7 @@ spec:
PublishStrategyOptions:
additionalProperties:
type: string
description: Generic options that can used by any publish strategy
description: 'Deprecated: no longer in use'
type: object
baseImage:
description: |-
Expand Down
9 changes: 4 additions & 5 deletions pkg/trait/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,10 @@ func createBuilderTestEnv(cluster v1.IntegrationPlatformCluster, strategy v1.Int
Spec: v1.IntegrationPlatformSpec{
Cluster: cluster,
Build: v1.IntegrationPlatformBuildSpec{
PublishStrategy: strategy,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: defaults.DefaultRuntimeVersion,
RuntimeProvider: v1.RuntimeProviderQuarkus,
PublishStrategyOptions: map[string]string{},
PublishStrategy: strategy,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: defaults.DefaultRuntimeVersion,
RuntimeProvider: v1.RuntimeProviderQuarkus,
BuildConfiguration: v1.BuildConfiguration{
Strategy: buildStrategy,
},
Expand Down

0 comments on commit dd84adf

Please sign in to comment.