Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(traits): deprecate registry #5222

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions docs/modules/ROOT/pages/cli/cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,3 @@ $ kamel <command> --help

Some command options in the CLI can be also specified as modeline in the source file, take a look at the xref:cli/modeline.adoc[Modeline] section
for more information.

[[image-registry]]
== Image Registry

The CLI can be used to xref:configuration/dependencies.adoc#local-remote-dependencies[upload] Maven dependencies and user data to the Image Registry. To do so, the CLI and the Operator have to be configured correctly.

For the Operator part, have a look at the xref:installation/registry/registry.adoc[installation] documentation.

For the CLI, in most cases, executing `docker login REGISTRY_URL` successfully will suffice.
If the Image Registry uses a custom certificate authority then it needs to be trusted, see
link:https://go.dev/src/crypto/x509/root_unix.go[SSL_CERT_FILE].



31 changes: 0 additions & 31 deletions docs/modules/ROOT/pages/configuration/dependencies.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,37 +74,6 @@ kamel run -d mvn:com.google.guava:guava:26.0-jre Integration.java
```
Note that if your dependencies belong to a private repository, this repository needs to be defined. See xref:installation/advanced/maven.adoc[Configure maven].

[[local-remote-dependencies]]
=== Local and remote dependencies

*Local dependencies* can be added using the `-d` flag and the `file://` prefix:
```
kamel run -d file://path/to/integration-dep.jar Integration.java
```

You can also specify data files and directories which will be mounted in the running container relative to the working directory:

```
kamel run -d file://path/to/data.csv?targetPath=/in/container/data.csv Integration.java
```

If the data files needs to be present at build time, you can also set `classpath` option to `true`:

```
kamel run -d file://path/to/data.csv?targetPath=/in/container/data.csv&classpath=true Integration.java
```

Similarly, *remote dependencies* can be added with the `http(s)://` prefix:

```
kamel run -d https://raw.githubusercontent.com/example/data.csv|targetPath=/tmp/foo&classpath=true Integration.java
```

For a full list of options checkout `kamel run --help`.


*Important note*: this will upload the dependencies and data files to the Image Registry. The CLI and Operator need to be setup xref:cli/cli.adoc[correctly], especially if authentication or custom certificates are required.

[[dependencies-kind-jitpack]]
=== Jitpack dependencies

Expand Down
4 changes: 4 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2655,6 +2655,7 @@ NOTE: Compiling to a native executable, requires at least 4GiB of memory, so the
|


Deprecated: use jvm trait or read documentation.
The Registry trait sets up Maven to use the Image registry as a Maven repository.

|`addons` +
Expand Down Expand Up @@ -5883,6 +5884,7 @@ The configuration of Quarkus trait
|


Deprecated: use jvm trait or read documentation.
The configuration of Registry trait

|`route` +
Expand Down Expand Up @@ -8173,6 +8175,8 @@ Deprecated: for backward compatibility.
* <<#_camel_apache_org_v1_IntegrationKitTraits, IntegrationKitTraits>>
* <<#_camel_apache_org_v1_Traits, Traits>>

WARNING: The Registry trait is **deprecated** and will removed in future release versions.

The Registry trait sets up Maven to use the Image registry
as a Maven repository.

Expand Down
2 changes: 2 additions & 0 deletions docs/modules/traits/pages/registry.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
= Registry Trait

// Start of autogenerated code - DO NOT EDIT! (description)
WARNING: The Registry trait is **deprecated** and will removed in future release versions.

The Registry trait sets up Maven to use the Image registry
as a Maven repository.

Expand Down
10 changes: 6 additions & 4 deletions helm/camel-k/crds/crd-integration-kit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,9 @@ spec:
type: array
type: object
registry:
description: The Registry trait sets up Maven to use the Image
registry as a Maven repository.
description: 'Deprecated: use jvm trait or read documentation.
The Registry trait sets up Maven to use the Image registry as
a Maven repository.'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down Expand Up @@ -755,8 +756,9 @@ spec:
type: array
type: object
registry:
description: The Registry trait sets up Maven to use the Image
registry as a Maven repository.
description: 'Deprecated: use jvm trait or read documentation.
The Registry trait sets up Maven to use the Image registry as
a Maven repository.'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
6 changes: 4 additions & 2 deletions helm/camel-k/crds/crd-integration-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down Expand Up @@ -3600,7 +3601,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
6 changes: 4 additions & 2 deletions helm/camel-k/crds/crd-integration-profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down Expand Up @@ -3371,7 +3372,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
6 changes: 4 additions & 2 deletions helm/camel-k/crds/crd-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7619,7 +7619,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down Expand Up @@ -9348,7 +9349,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
3 changes: 2 additions & 1 deletion helm/camel-k/crds/crd-kamelet-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7921,7 +7921,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
3 changes: 2 additions & 1 deletion helm/camel-k/crds/crd-pipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7919,7 +7919,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/camel/v1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ type Traits struct {
PullSecret *trait.PullSecretTrait `property:"pull-secret" json:"pull-secret,omitempty"`
// The configuration of Quarkus trait
Quarkus *trait.QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
// Deprecated: use jvm trait or read documentation.
// The configuration of Registry trait
Registry *trait.RegistryTrait `property:"registry" json:"registry,omitempty"`
// The configuration of Route trait
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/camel/v1/integrationkit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ type IntegrationKitTraits struct {
// It's enabled by default.
// NOTE: Compiling to a native executable, requires at least 4GiB of memory, so the Pod running the native build must have enough memory available.
Quarkus *trait.QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
// Deprecated: use jvm trait or read documentation.
// 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
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/camel/v1/trait/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.

package trait

// WARNING: The Registry trait is **deprecated** and will removed in future release versions.
//
// The Registry trait sets up Maven to use the Image registry
// as a Maven repository.
//
Expand Down
4 changes: 1 addition & 3 deletions pkg/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ import (
"github.com/apache/camel-k/v2/pkg/util/watch"
)

const usageDependency = `A dependency that should be included, e.g., "-d camel:mail" for a Camel component, "-d mvn:org.my:app:1.0" for a Maven dependency, "-d http(s)://my-repo/my-dependency.jar|targetPath=<path>&registry=<registry_URL>&skipChecksums=<true>&skipPOM=<true>&classpath=<true>" for custom dependencies located on an http server or "file://localPath[?targetPath=<path>&registry=<registry_URL>&skipChecksums=<true>&skipPOM=<true>&classpath=<true>]" for local files`

func newCmdRun(rootCmdOptions *RootCmdOptions) (*cobra.Command, *runCmdOptions) {
options := runCmdOptions{
RootCmdOptions: rootCmdOptions,
Expand All @@ -98,7 +96,7 @@ func newCmdRun(rootCmdOptions *RootCmdOptions) (*cobra.Command, *runCmdOptions)
cmd.Flags().String("name", "", "The integration name")
cmd.Flags().String("image", "", "An image built externally (ie, via CICD). Enabling it will skip the Integration build phase.")
cmd.Flags().StringArrayP("connect", "c", nil, "A Service that the integration should bind to, specified as [[apigroup/]version:]kind:[namespace/]name")
cmd.Flags().StringArrayP("dependency", "d", nil, usageDependency)
cmd.Flags().StringArrayP("dependency", "d", nil, `A dependency that should be included, e.g., "-d camel:mail" for a Camel component, "-d mvn:org.my:app:1.0" for a Maven dependency`)
cmd.Flags().BoolP("wait", "w", false, "Wait for the integration to be running")
cmd.Flags().StringP("kit", "k", "", "The kit used to run the integration")
cmd.Flags().StringArrayP("property", "p", nil, "Add a runtime property or properties file from a path, a config map or a secret (syntax: [my-key=my-value|file:/path/to/my-conf.properties|[configmap|secret]:name])")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,9 @@ spec:
type: array
type: object
registry:
description: The Registry trait sets up Maven to use the Image
registry as a Maven repository.
description: 'Deprecated: use jvm trait or read documentation.
The Registry trait sets up Maven to use the Image registry as
a Maven repository.'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down Expand Up @@ -755,8 +756,9 @@ spec:
type: array
type: object
registry:
description: The Registry trait sets up Maven to use the Image
registry as a Maven repository.
description: 'Deprecated: use jvm trait or read documentation.
The Registry trait sets up Maven to use the Image registry as
a Maven repository.'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down Expand Up @@ -3600,7 +3601,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down Expand Up @@ -3371,7 +3372,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7619,7 +7619,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down Expand Up @@ -9348,7 +9349,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7921,7 +7921,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
3 changes: 2 additions & 1 deletion pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7919,7 +7919,8 @@ spec:
type: array
type: object
registry:
description: The configuration of Registry trait
description: 'Deprecated: use jvm trait or read documentation.
The configuration of Registry trait'
properties:
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
Expand Down
7 changes: 4 additions & 3 deletions pkg/trait/quarkus.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ func propagateKitTraits(e *Environment) v1.IntegrationKitTraits {

func propagate(traitSource string, traits v1.Traits, kitTraits *v1.IntegrationKitTraits, e *Environment) {
ikt := v1.IntegrationKitTraits{
Builder: traits.Builder.DeepCopy(),
Camel: traits.Camel.DeepCopy(),
Quarkus: traits.Quarkus.DeepCopy(),
Builder: traits.Builder.DeepCopy(),
Camel: traits.Camel.DeepCopy(),
Quarkus: traits.Quarkus.DeepCopy(),
// nolint: staticcheck
Registry: traits.Registry.DeepCopy(),
}

Expand Down
13 changes: 11 additions & 2 deletions pkg/trait/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,17 @@ func (t *registryTrait) Configure(e *Environment) (bool, *TraitCondition, error)
if e.IntegrationKit == nil || !pointer.BoolDeref(t.Enabled, false) {
return false, nil, nil
}

return e.IntegrationKitInPhase(v1.IntegrationKitPhaseBuildSubmitted), nil, nil
enabled := e.IntegrationKitInPhase(v1.IntegrationKitPhaseBuildSubmitted)
if enabled {
condition := NewIntegrationCondition(
v1.IntegrationConditionTraitInfo,
corev1.ConditionTrue,
traitConfigurationReason,
"Registry trait is deprecated. It may be removed in future version. Read documentation to find alternatives (likely JVM trait).",
)
return true, condition, nil
}
return false, nil, nil
}

func (t *registryTrait) Apply(e *Environment) error {
Expand Down
Loading