Skip to content

Commit

Permalink
fix(trait): fix misconfigurations for traits
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Jul 2, 2022
1 parent efe9e7d commit a65ab58
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 6 deletions.
14 changes: 14 additions & 0 deletions config/crd/bases/camel.apache.org_integrationkits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,20 @@ spec:
type: string
type: array
type: object
registry:
description: The Registry trait sets up Maven to use the Image
registry as a Maven repository.
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
type: object
x-kubernetes-preserve-unknown-fields: true
enabled:
description: Can be used to enable or disable a trait. All
traits share this common property.
type: boolean
type: object
type: object
type: object
status:
Expand Down
14 changes: 14 additions & 0 deletions helm/camel-k/crds/crd-integration-kit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,20 @@ spec:
type: string
type: array
type: object
registry:
description: The Registry trait sets up Maven to use the Image
registry as a Maven repository.
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
type: object
x-kubernetes-preserve-unknown-fields: true
enabled:
description: Can be used to enable or disable a trait. All
traits share this common property.
type: boolean
type: object
type: object
type: object
status:
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/camel/v1/integrationkit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ type IntegrationKitTraits struct {
// It's enabled by default.
// NOTE: Compiling to a native executable, i.e. when using `package-type=native`, is only supported for kamelets, as well as YAML and XML integrations. It also requires at least 4GiB of memory, so the Pod running the native build, that is either the operator Pod, or the build Pod (depending on the build strategy configured for the platform), must have enough memory available.
Quarkus *trait.QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
// The Registry trait sets up Maven to use the Image registry as a Maven repository.
Registry *trait.RegistryTrait `property:"registry" json:"registry,omitempty"`

// The collection of addon trait configurations
Addons map[string]AddonTrait `json:"addons,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/camel/v1/zz_generated.deepcopy.go

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

4 changes: 2 additions & 2 deletions pkg/resources/resources.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/trait/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const flowsInternalSourceName = "camel-k-embedded-flow.yaml"

type initTrait struct {
BaseTrait
traitv1.Trait
traitv1.Trait `property:",squash"`
}

func NewInitTrait() Trait {
Expand Down
5 changes: 3 additions & 2 deletions pkg/trait/quarkus.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ func (t *quarkusTrait) newIntegrationKit(e *Environment, packageType traitv1.Qua
Dependencies: e.Integration.Status.Dependencies,
Repositories: e.Integration.Spec.Repositories,
Traits: v1.IntegrationKitTraits{
Builder: e.Integration.Spec.Traits.Builder,
Quarkus: e.Integration.Spec.Traits.Quarkus,
Builder: e.Integration.Spec.Traits.Builder,
Quarkus: e.Integration.Spec.Traits.Quarkus,
Registry: e.Integration.Spec.Traits.Registry,
},
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/trait/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (

type registryTrait struct {
BaseTrait
traitv1.RegistryTrait
traitv1.RegistryTrait `property:",squash"`
}

func newRegistryTrait() Trait {
Expand Down

0 comments on commit a65ab58

Please sign in to comment.