Skip to content

Commit

Permalink
fix(trait): deprecate operator inspecting secrets
Browse files Browse the repository at this point in the history
Eventually remove this feature which is making the operator to inspect the list of namespaces secrets
  • Loading branch information
squakez committed Mar 1, 2024
1 parent 5b95cf8 commit 9746d6e
Show file tree
Hide file tree
Showing 19 changed files with 228 additions and 43 deletions.
10 changes: 10 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7706,6 +7706,16 @@ bool
Enable "hot reload" when a secret/configmap mounted is edited (default `false`). The configmap/secret must be
marked with `camel.apache.org/integration` label to be taken in account.
|`scanKameletsImplicitLabelSecrets` +
bool
|
Deprecated: include your properties in an explicit property file backed by a secret.
Let the operator to scan for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated as plain properties file with their key/value list
(ie .spec.data["camel.my-property"] = my-value) (default `true`).
|===
Expand Down
7 changes: 7 additions & 0 deletions docs/modules/traits/pages/mount.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ Syntax: [configmap\|secret]:name[/key][@path], where name represents the resourc
| Enable "hot reload" when a secret/configmap mounted is edited (default `false`). The configmap/secret must be
marked with `camel.apache.org/integration` label to be taken in account.

| mount.scan-kamelets-implicit-label-secrets
| bool
| Deprecated: include your properties in an explicit property file backed by a secret.
Let the operator to scan for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated as plain properties file with their key/value list
(ie .spec.data["camel.my-property"] = my-value) (default `true`).

|===

// End of autogenerated code - DO NOT EDIT! (configuration)
16 changes: 16 additions & 0 deletions helm/camel-k/crds/crd-integration-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down Expand Up @@ -3364,6 +3372,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down
16 changes: 16 additions & 0 deletions helm/camel-k/crds/crd-integration-profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down Expand Up @@ -3135,6 +3143,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down
16 changes: 16 additions & 0 deletions helm/camel-k/crds/crd-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7391,6 +7391,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down Expand Up @@ -9112,6 +9120,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down
10 changes: 10 additions & 0 deletions helm/camel-k/crds/crd-kamelet-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7688,6 +7688,16 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an
explicit property file backed by a secret. Let the operator
to scan for secret labeled with `camel.apache.org/kamelet`
and `camel.apache.org/kamelet.configuration`. These
secrets are mounted to the application and treated as
plain properties file with their key/value list (ie
.spec.data["camel.my-property"] = my-value) (default
`true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be
mounted. Syntax: [pvcname:/container/path]'
Expand Down
10 changes: 10 additions & 0 deletions helm/camel-k/crds/crd-pipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7686,6 +7686,16 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an
explicit property file backed by a secret. Let the operator
to scan for secret labeled with `camel.apache.org/kamelet`
and `camel.apache.org/kamelet.configuration`. These
secrets are mounted to the application and treated as
plain properties file with their key/value list (ie
.spec.data["camel.my-property"] = my-value) (default
`true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be
mounted. Syntax: [pvcname:/container/path]'
Expand Down
15 changes: 0 additions & 15 deletions pkg/apis/camel/v1/integration_types_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,6 @@ func (in *IntegrationStatus) AddOrReplaceGeneratedSources(sources ...SourceSpec)
in.GeneratedSources = append(in.GeneratedSources, newSources...)
}

func (in *IntegrationStatus) AddConfigurationsIfMissing(configurations ...ConfigurationSpec) {
for _, config := range configurations {
alreadyPresent := false
for _, r := range in.Configuration {
if r.Type == config.Type && r.Value == config.Value {
alreadyPresent = true
break
}
}
if !alreadyPresent {
in.Configuration = append(in.Configuration, config)
}
}
}

func (in *IntegrationSpec) Configurations() []ConfigurationSpec {
if in == nil {
return []ConfigurationSpec{}
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/camel/v1/trait/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ type MountTrait struct {
// Enable "hot reload" when a secret/configmap mounted is edited (default `false`). The configmap/secret must be
// marked with `camel.apache.org/integration` label to be taken in account.
HotReload *bool `property:"hot-reload" json:"hotReload,omitempty"`
// Deprecated: include your properties in an explicit property file backed by a secret.
// Let the operator to scan for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
// These secrets are mounted to the application and treated as plain properties file with their key/value list
// (ie .spec.data["camel.my-property"] = my-value) (default `true`).
ScanKameletsImplicitLabelSecrets *bool `property:"scan-kamelets-implicit-label-secrets" json:"scanKameletsImplicitLabelSecrets,omitempty"`
}
5 changes: 5 additions & 0 deletions pkg/apis/camel/v1/trait/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down Expand Up @@ -3364,6 +3372,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down Expand Up @@ -3135,6 +3143,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down
16 changes: 16 additions & 0 deletions pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7391,6 +7391,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down Expand Up @@ -9112,6 +9120,14 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an explicit
property file backed by a secret. Let the operator to scan
for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`.
These secrets are mounted to the application and treated
as plain properties file with their key/value list (ie .spec.data["camel.my-property"]
= my-value) (default `true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be mounted.
Syntax: [pvcname:/container/path]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7688,6 +7688,16 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an
explicit property file backed by a secret. Let the operator
to scan for secret labeled with `camel.apache.org/kamelet`
and `camel.apache.org/kamelet.configuration`. These
secrets are mounted to the application and treated as
plain properties file with their key/value list (ie
.spec.data["camel.my-property"] = my-value) (default
`true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be
mounted. Syntax: [pvcname:/container/path]'
Expand Down
10 changes: 10 additions & 0 deletions pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7686,6 +7686,16 @@ spec:
items:
type: string
type: array
scanKameletsImplicitLabelSecrets:
description: 'Deprecated: include your properties in an
explicit property file backed by a secret. Let the operator
to scan for secret labeled with `camel.apache.org/kamelet`
and `camel.apache.org/kamelet.configuration`. These
secrets are mounted to the application and treated as
plain properties file with their key/value list (ie
.spec.data["camel.my-property"] = my-value) (default
`true`).'
type: boolean
volumes:
description: 'A list of Persistent Volume Claims to be
mounted. Syntax: [pvcname:/container/path]'
Expand Down
Loading

0 comments on commit 9746d6e

Please sign in to comment.