This is an automated email from the ASF dual-hosted git repository.
squakez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new ea7e62c1a chore(e2e): don't configure platform
ea7e62c1a is described below
commit ea7e62c1ab1600807518a63f2dbee6e15ccd1036
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Wed May 20 08:54:46 2026 +0200
chore(e2e): don't configure platform
---
.github/workflows/common.yml | 1 +
.github/workflows/gateway.yml | 1 -
.github/workflows/kafka.yml | 1 -
.github/workflows/knative.yml | 4 +-
.github/workflows/native.yml | 4 +-
.github/workflows/telemetry.yml | 1 -
docs/modules/ROOT/pages/installation/builds.adoc | 4 +-
.../ROOT/pages/installation/installation.adoc | 5 +
docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 2 +
docs/modules/traits/pages/builder.adoc | 2 +
e2e/advanced/build_max_pipelines_test.go | 34 +--
e2e/advanced/build_order_strategy_test.go | 33 +--
e2e/advanced/builder_test.go | 103 +--------
e2e/advanced/catalog_builder_test.go | 7 -
e2e/advanced/debug_test.go | 1 +
e2e/advanced/integration_profile_test.go | 5 +-
e2e/advanced/kamelet_repo_test.go | 68 ------
e2e/advanced/maven_http_proxy_test.go | 2 -
e2e/advanced/operator_id_filtering_test.go | 2 -
e2e/advanced/operator_metrics_test.go | 63 ------
e2e/advanced/operator_restart_test.go | 8 +-
e2e/advanced/promote_test.go | 2 -
e2e/advanced/tekton_test.go | 78 -------
e2e/install/kustomize/setup_test.go | 45 +---
e2e/install/olm/olm_install_test.go | 11 -
e2e/install/upgrade/upgrade_test.go | 38 +++-
e2e/knative/knative_pipes_test.go | 1 -
e2e/support/test_support.go | 249 +--------------------
e2e/support/test_util.go | 4 +-
helm/camel-k/crds/camel-k-crds.yaml | 18 ++
helm/camel-k/templates/rbacs-common.yaml | 9 -
pkg/apis/camel/v1/camelcatalog_types_support.go | 10 +
pkg/apis/camel/v1/integration_types_support.go | 5 +
pkg/apis/camel/v1/integrationkit_types_support.go | 5 +
.../camel/v1/integrationplatform_types_support.go | 5 +
pkg/apis/camel/v1/trait/builder.go | 2 +
pkg/controller/integration/platform_setup.go | 23 +-
pkg/controller/integrationplatform/create.go | 2 +-
.../bases/camel.apache.org_integrationkits.yaml | 2 +
.../camel.apache.org_integrationplatforms.yaml | 4 +
.../camel.apache.org_integrationprofiles.yaml | 4 +
.../crd/bases/camel.apache.org_integrations.yaml | 4 +
.../config/crd/bases/camel.apache.org_pipes.yaml | 4 +
.../config/manager/operator-deployment.yaml | 8 +
.../bases/camel-k.clusterserviceversion.yaml | 20 +-
pkg/resources/config/rbac/builder-role.yaml | 9 -
pkg/trait/builder.go | 1 +
pkg/trait/camel.go | 24 +-
pkg/trait/pull_secret.go | 29 +--
pkg/util/camel/camel_runtime.go | 6 +-
pkg/util/camel/camel_runtime_test.go | 1 +
script/Makefile | 19 +-
52 files changed, 204 insertions(+), 789 deletions(-)
diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml
index 58dc6d586..65710e118 100644
--- a/.github/workflows/common.yml
+++ b/.github/workflows/common.yml
@@ -75,6 +75,7 @@ jobs:
run: |
kubectl create ns camel-k
make install-k8s-global
+ make install-registry
kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n
camel-k --timeout=60s
- name: Run test
diff --git a/.github/workflows/gateway.yml b/.github/workflows/gateway.yml
index 052efde3a..dcc3ae153 100644
--- a/.github/workflows/gateway.yml
+++ b/.github/workflows/gateway.yml
@@ -77,7 +77,6 @@ jobs:
run: |
kubectl create ns camel-k
make install-k8s-global
- kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n
camel-k --timeout=60s
- name: Run test
shell: bash
diff --git a/.github/workflows/kafka.yml b/.github/workflows/kafka.yml
index 43bc16702..bd40c72b1 100644
--- a/.github/workflows/kafka.yml
+++ b/.github/workflows/kafka.yml
@@ -77,7 +77,6 @@ jobs:
run: |
kubectl create ns camel-k
make install-k8s-global
- kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n
camel-k --timeout=60s
- name: Run test
shell: bash
diff --git a/.github/workflows/knative.yml b/.github/workflows/knative.yml
index 7df43db32..c215ec5c6 100644
--- a/.github/workflows/knative.yml
+++ b/.github/workflows/knative.yml
@@ -77,7 +77,9 @@ jobs:
run: |
kubectl create ns camel-k
make install-k8s-global
- kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n
camel-k --timeout=60s
+ # Install Apache Kamelets catalog
+ mvn -q dependency:copy
-Dartifact=org.apache.camel.kamelets:camel-kamelets:4.18.1:jar
-Dmdep.useBaseVersion=true -DoutputDirectory=/tmp
+ unzip /tmp/camel-kamelets-4.18.1.jar -d /tmp && kubectl apply -f
/tmp/kamelets -n camel-k
- name: Run test
shell: bash
diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml
index 622b3ba82..a825acec6 100644
--- a/.github/workflows/native.yml
+++ b/.github/workflows/native.yml
@@ -78,7 +78,9 @@ jobs:
run: |
kubectl create ns camel-k
make install-k8s-global
- kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n
camel-k --timeout=60s
+ # Install Apache Kamelets catalog
+ mvn -q dependency:copy
-Dartifact=org.apache.camel.kamelets:camel-kamelets:4.18.1:jar
-Dmdep.useBaseVersion=true -DoutputDirectory=/tmp
+ unzip /tmp/camel-kamelets-4.18.1.jar -d /tmp && kubectl apply -f
/tmp/kamelets -n camel-k
- name: Run test
shell: bash
diff --git a/.github/workflows/telemetry.yml b/.github/workflows/telemetry.yml
index 97fc811d2..1cd717370 100644
--- a/.github/workflows/telemetry.yml
+++ b/.github/workflows/telemetry.yml
@@ -72,7 +72,6 @@ jobs:
run: |
kubectl create ns camel-k
make install-k8s-global
- kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n
camel-k --timeout=60s
- name: Install OTLP Collector
uses: ./.github/actions/install-otlp-collector
diff --git a/docs/modules/ROOT/pages/installation/builds.adoc
b/docs/modules/ROOT/pages/installation/builds.adoc
index fa28e5064..296f465f9 100644
--- a/docs/modules/ROOT/pages/installation/builds.adoc
+++ b/docs/modules/ROOT/pages/installation/builds.adoc
@@ -54,11 +54,11 @@ Beside the values above, you can also configure
specifically Maven using the fol
| Name | Description | Default
| MAVEN_SETTINGS
-| Configmap or Secret Maven `settings.xml` configuration used to define
repositories, mirrors, and credentials.
+| Configmap or Secret Maven `settings.xml` configuration used to define
repositories, mirrors, and credentials. Format expected
`configmap|secret:my-resource`.
|
| MAVEN_SETTINGS_SECURITY
-| Configmap or Secret Maven `settings-security.xml` configuration used for
decrypting encrypted credentials in `settings.xml`.
+| Configmap or Secret Maven `settings-security.xml` configuration used for
decrypting encrypted credentials in `settings.xml`. Format expected
`configmap|secret:my-resource`.
|
| MAVEN_CA_SECRETS
diff --git a/docs/modules/ROOT/pages/installation/installation.adoc
b/docs/modules/ROOT/pages/installation/installation.adoc
index 4a1bfc815..b848ec1c8 100644
--- a/docs/modules/ROOT/pages/installation/installation.adoc
+++ b/docs/modules/ROOT/pages/installation/installation.adoc
@@ -43,6 +43,11 @@ You can edit the `Subscription` custom resource, setting the
channel you want to
NOTE: Some Kubernetes clusters such as Openshift may let you to perform the
same operation from a GUI as well. Refer to the cluster instruction to learn
how to perform such action from user interface.
+[[bootstrap-configuration]]
+== Setup the operator configuration
+
+Each installation method have its proper way to setup configuration. A common
one is the creation of a `Configmap` named
`camel-k-operator-configmap-configuration` and a `Secret` named
`camel-k-operator-secret-configuration` in the same namespace where the
operator is installed. If available, the operator will read the environment
variable from these resources.
+
[[container-registry]]
== Setup the container registry
diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
index 97efb43c0..18646c705 100644
--- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
+++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
@@ -6646,6 +6646,8 @@ This configmap/secret is a resource of the IntegrationKit
created, therefore it
The content of the maven profile is expected to be a text containing a valid
maven profile starting with `<profile>` and ending with `</profile>` that will
be integrated as an inline profile in the POM.
Syntax: [configmap{vbar}secret]:name[/key], where name represents the resource
name, key optionally represents the resource key to be filtered (default key
value = profile.xml).
+Deprecated: will be removed in future versions.
+
|`tasks` +
[]string
|
diff --git a/docs/modules/traits/pages/builder.adoc
b/docs/modules/traits/pages/builder.adoc
index ae4f23471..50a61f1b9 100755
--- a/docs/modules/traits/pages/builder.adoc
+++ b/docs/modules/traits/pages/builder.adoc
@@ -88,6 +88,8 @@ This configmap/secret is a resource of the IntegrationKit
created, therefore it
The content of the maven profile is expected to be a text containing a valid
maven profile starting with `<profile>` and ending with `</profile>` that will
be integrated as an inline profile in the POM.
Syntax: [configmap\|secret]:name[/key], where name represents the resource
name, key optionally represents the resource key to be filtered (default key
value = profile.xml).
+Deprecated: will be removed in future versions.
+
| builder.tasks
| []string
| A list of tasks to be executed (available only when using `pod` strategy)
with format `<name>;<container-image>;<container-command>`.
diff --git a/e2e/advanced/build_max_pipelines_test.go
b/e2e/advanced/build_max_pipelines_test.go
index 836974a71..f7b1814d8 100644
--- a/e2e/advanced/build_max_pipelines_test.go
+++ b/e2e/advanced/build_max_pipelines_test.go
@@ -24,6 +24,7 @@ package advanced
import (
"context"
+ "strconv"
"testing"
"time"
@@ -41,21 +42,10 @@ type kitOptions struct {
func kitMaxBuildLimit(t *testing.T, maxRunningBuilds int32, condition
func(runningBuilds int) bool, buildOrderStrategy v1.BuildOrderStrategy) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- InstallOperator(t, ctx, g, ns)
-
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutShort).Should(Equal(v1.IntegrationPlatformPhaseReady))
- pl := Platform(t, ctx, ns)()
- // set maximum number of running builds and order strategy
- pl.Spec.Build.MaxRunningBuilds = maxRunningBuilds
- pl.Spec.Build.BuildConfiguration.OrderStrategy =
buildOrderStrategy
- if err := TestClient(t).Update(ctx, pl); err != nil {
- t.Error(err)
- t.FailNow()
- }
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutShort).Should(Equal(v1.IntegrationPlatformPhaseReady))
- g.Eventually(PlatformHas(t, ctx, ns, func(pl
*v1.IntegrationPlatform) bool {
- return pl.Status.Build.MaxRunningBuilds ==
maxRunningBuilds
- }), TestTimeoutShort).Should(BeTrue())
+ InstallOperatorWithConf(t, ctx, g, ns, "", false,
map[string]string{
+ "MAX_RUNNING_BUILDS":
strconv.FormatInt(int64(maxRunningBuilds), 10),
+ "BUILD_ORDER_STRATEGY": string(buildOrderStrategy),
+ })
buildA := "integration-a"
buildB := "integration-b"
@@ -134,16 +124,10 @@ func TestKitMaxBuildLimitDependencies(t *testing.T) {
func TestMaxBuildLimitWaitingBuilds(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- InstallOperator(t, ctx, g, ns)
-
- pl := Platform(t, ctx, ns)()
- // set maximum number of running builds and order strategy
- pl.Spec.Build.MaxRunningBuilds = 1
- pl.Spec.Build.BuildConfiguration.OrderStrategy =
v1.BuildOrderStrategyFIFO
- if err := TestClient(t).Update(ctx, pl); err != nil {
- t.Error(err)
- t.FailNow()
- }
+ InstallOperatorWithConf(t, ctx, g, ns, "", false,
map[string]string{
+ "MAX_RUNNING_BUILDS": "1",
+ "BUILD_ORDER_STRATEGY":
string(v1.BuildOrderStrategyFIFO),
+ })
buildA := "integration-a"
buildB := "integration-b"
diff --git a/e2e/advanced/build_order_strategy_test.go
b/e2e/advanced/build_order_strategy_test.go
index 401d08bbe..65dbeb1e5 100644
--- a/e2e/advanced/build_order_strategy_test.go
+++ b/e2e/advanced/build_order_strategy_test.go
@@ -37,18 +37,10 @@ import (
func TestRunBuildOrderStrategyMatchingDependencies(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- InstallOperator(t, ctx, g, ns)
-
- // Update platform with parameters required by this test
- pl := Platform(t, ctx, ns)()
- pl.Spec.Build.MaxRunningBuilds = 4
- pl.Spec.Build.BuildConfiguration.OrderStrategy =
v1.BuildOrderStrategyDependencies
- if err := TestClient(t).Update(ctx, pl); err != nil {
- t.Error(err)
- t.FailNow()
- }
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutShort).Should(Equal(v1.IntegrationPlatformPhaseReady))
-
+ InstallOperatorWithConf(t, ctx, g, ns, "", false,
map[string]string{
+ "MAX_RUNNING_BUILDS": "4",
+ "BUILD_ORDER_STRATEGY":
string(v1.BuildOrderStrategyDependencies),
+ })
integrationA := RandomizedSuffixName("java-a")
g.Expect(KamelRun(t, ctx, ns, "files/Java.java", "--name",
integrationA).Execute()).To(Succeed())
@@ -63,7 +55,7 @@ func TestRunBuildOrderStrategyMatchingDependencies(t
*testing.T) {
g.Expect(KamelRun(t, ctx, ns, "files/Java.java", "--name",
integrationC, "-d", "camel:cron", "-d",
"camel:zipfile").Execute()).To(Succeed())
integrationZ := RandomizedSuffixName("yaml-z")
- g.Expect(KamelRun(t, ctx, ns, "files/timer-source.yaml",
"--name", integrationZ).Execute()).To(Succeed())
+ g.Expect(KamelRun(t, ctx, ns, "files/yaml.yaml", "--name",
integrationZ).Execute()).To(Succeed())
g.Eventually(IntegrationKitName(t, ctx, ns, integrationB),
TestTimeoutMedium).ShouldNot(BeEmpty())
g.Eventually(IntegrationKitName(t, ctx, ns, integrationC),
TestTimeoutMedium).ShouldNot(BeEmpty())
@@ -112,16 +104,9 @@ func TestRunBuildOrderStrategyMatchingDependencies(t
*testing.T) {
func TestRunBuildOrderStrategyFIFO(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- InstallOperator(t, ctx, g, ns)
- // Update platform with parameters required by this test
- pl := Platform(t, ctx, ns)()
- pl.Spec.Build.BuildConfiguration.OrderStrategy =
v1.BuildOrderStrategyFIFO
- if err := TestClient(t).Update(ctx, pl); err != nil {
- t.Error(err)
- t.FailNow()
- }
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutShort).Should(Equal(v1.IntegrationPlatformPhaseReady))
-
+ InstallOperatorWithConf(t, ctx, g, ns, "", false,
map[string]string{
+ "BUILD_ORDER_STRATEGY":
string(v1.BuildOrderStrategyFIFO),
+ })
integrationA := RandomizedSuffixName("java-a")
g.Expect(KamelRun(t, ctx, ns, "files/Java.java",
"--name", integrationA,
@@ -135,7 +120,7 @@ func TestRunBuildOrderStrategyFIFO(t *testing.T) {
).Execute()).To(Succeed())
integrationZ := RandomizedSuffixName("yaml-z")
- g.Expect(KamelRun(t, ctx, ns, "files/timer-source.yaml",
+ g.Expect(KamelRun(t, ctx, ns, "files/yaml.yaml",
"--name", integrationZ,
).Execute()).To(Succeed())
diff --git a/e2e/advanced/builder_test.go b/e2e/advanced/builder_test.go
index 4b29faaab..7082f2948 100644
--- a/e2e/advanced/builder_test.go
+++ b/e2e/advanced/builder_test.go
@@ -26,11 +26,9 @@ import (
"context"
"fmt"
"testing"
- "time"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
. "github.com/apache/camel-k/v2/e2e/support"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
@@ -40,21 +38,7 @@ func TestBuilderTimeout(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- InstallOperator(t, ctx, g, ns)
-
- g.Eventually(Platform(t, ctx, ns)).ShouldNot(BeNil())
- pl := Platform(t, ctx, ns)()
- // set a short timeout to simulate the build timeout
- pl.Spec.Build.Timeout = &metav1.Duration{
- Duration: 10 * time.Second,
- }
- TestClient(t).Update(ctx, pl)
- g.Eventually(Platform(t, ctx, ns)).ShouldNot(BeNil())
- g.Eventually(PlatformTimeout(t, ctx, ns)).Should(Equal(
- &metav1.Duration{
- Duration: 10 * time.Second,
- },
- ))
+ InstallOperatorWithConf(t, ctx, g, ns, "", false,
map[string]string{"BUILD_TIMEOUT_SECONDS": "10"})
operatorPod := OperatorPod(t, ctx, ns)()
operatorPodImage := operatorPod.Spec.Containers[0].Image
@@ -64,6 +48,7 @@ func TestBuilderTimeout(t *testing.T) {
g.Expect(KamelRun(t, ctx, ns, "files/yaml.yaml",
"--name", name, "-t", "builder.strategy=pod").Execute()).To(Succeed())
// As the build hits timeout, it keeps trying building
g.Eventually(IntegrationPhase(t, ctx, ns,
name)).Should(Equal(v1.IntegrationPhaseBuildingKit))
+ g.Eventually(IntegrationKitName(t, ctx, ns,
name)).ShouldNot(BeEmpty())
integrationKitName := IntegrationKitName(t, ctx, ns,
name)()
builderKitName := fmt.Sprintf("camel-k-%s-builder",
integrationKitName)
g.Eventually(BuilderPodPhase(t, ctx, ns,
builderKitName)).Should(Equal(corev1.PodPending))
@@ -78,87 +63,3 @@ func TestBuilderTimeout(t *testing.T) {
})
})
}
-
-func TestMavenProfile(t *testing.T) {
- t.Parallel()
-
- WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- InstallOperator(t, ctx, g, ns)
- t.Run("Run maven profile", func(t *testing.T) {
- name := RandomizedSuffixName("java-maven-profile")
-
- mavenProfile1Cm := newMavenProfileConfigMap(ns,
"maven-profile-owasp", "owasp-profile")
- g.Expect(TestClient(t).Create(ctx,
mavenProfile1Cm)).To(Succeed())
- mavenProfile2Cm := newMavenProfileConfigMap(ns,
"maven-profile-dependency", "dependency-profile")
- g.Expect(TestClient(t).Create(ctx,
mavenProfile2Cm)).To(Succeed())
-
- g.Expect(KamelRun(t, ctx, ns, "files/Java.java",
"--name", name, "-t",
"builder.maven-profiles=configmap:maven-profile-owasp/owasp-profile", "-t",
"builder.maven-profiles=configmap:maven-profile-dependency/dependency-profile",
"-t", "builder.tasks=custom1;alpine;cat maven/pom.xml", "-t",
"builder.strategy=pod").Execute()).To(Succeed())
-
- g.Eventually(IntegrationPodPhase(t, ctx, ns, name),
TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ctx, ns,
name, v1.IntegrationConditionReady),
TestTimeoutLong).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, ctx, ns, name),
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
-
- integrationKitName := IntegrationKitName(t, ctx, ns,
name)()
- integrationKitNamespace := IntegrationKitNamespace(t,
ctx, ns, name)()
- builderKitName := fmt.Sprintf("camel-k-%s-builder",
integrationKitName)
- g.Eventually(BuilderPod(t, ctx,
integrationKitNamespace, builderKitName), TestTimeoutShort).ShouldNot(BeNil())
- g.Eventually(len(BuilderPod(t, ctx,
integrationKitNamespace, builderKitName)().Spec.InitContainers),
TestTimeoutShort).Should(Equal(3))
- g.Eventually(BuilderPod(t, ctx,
integrationKitNamespace, builderKitName)().Spec.InitContainers[0].Name,
TestTimeoutShort).Should(Equal("builder"))
- g.Eventually(BuilderPod(t, ctx,
integrationKitNamespace, builderKitName)().Spec.InitContainers[1].Name,
TestTimeoutShort).Should(Equal("custom1"))
- g.Eventually(BuilderPod(t, ctx,
integrationKitNamespace, builderKitName)().Spec.InitContainers[2].Name,
TestTimeoutShort).Should(Equal("package"))
-
- // Check containers conditions
- g.Eventually(Build(t, ctx, integrationKitNamespace,
integrationKitName), TestTimeoutShort).ShouldNot(BeNil())
- g.Eventually(
- Build(t, ctx, integrationKitNamespace,
integrationKitName)().Status.GetCondition(v1.BuildConditionType("Containercustom1Succeeded")).Status,
-
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
- g.Eventually(
- Build(t, ctx, integrationKitNamespace,
integrationKitName)().Status.GetCondition(v1.BuildConditionType("Containercustom1Succeeded")).Message,
-
TestTimeoutShort).Should(ContainSubstring("</project>"))
-
- // Check logs
- g.Eventually(Logs(t, ctx, integrationKitNamespace,
builderKitName, corev1.PodLogOptions{Container:
"custom1"})).Should(ContainSubstring(`<id>owasp-profile</id>`))
- g.Eventually(Logs(t, ctx, integrationKitNamespace,
builderKitName, corev1.PodLogOptions{Container:
"custom1"})).Should(ContainSubstring(`<id>dependency-profile</id>`))
-
- g.Expect(TestClient(t).Delete(ctx,
mavenProfile1Cm)).To(Succeed())
- g.Expect(TestClient(t).Delete(ctx,
mavenProfile2Cm)).To(Succeed())
- })
- })
-}
-
-func newMavenProfileConfigMap(ns, name, key string) *corev1.ConfigMap {
- return &corev1.ConfigMap{
- TypeMeta: metav1.TypeMeta{
- Kind: "ConfigMap",
- APIVersion: corev1.SchemeGroupVersion.String(),
- },
- ObjectMeta: metav1.ObjectMeta{
- Namespace: ns,
- Name: name,
- },
- Data: map[string]string{
- key: fmt.Sprintf(`
-<profile>
- <id>%s</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.owasp</groupId>
- <artifactId>dependency-check-maven</artifactId>
- <version>5.3.0</version>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</profile>
-`, key,
- ),
- },
- }
-}
diff --git a/e2e/advanced/catalog_builder_test.go
b/e2e/advanced/catalog_builder_test.go
index f38e02aa4..2f9329a05 100644
--- a/e2e/advanced/catalog_builder_test.go
+++ b/e2e/advanced/catalog_builder_test.go
@@ -24,7 +24,6 @@ package advanced
import (
"context"
- "fmt"
"strings"
"testing"
@@ -33,7 +32,6 @@ import (
. "github.com/apache/camel-k/v2/e2e/support"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
- "github.com/apache/camel-k/v2/pkg/util/defaults"
)
func TestCamelCatalogBuilder(t *testing.T) {
@@ -41,11 +39,6 @@ func TestCamelCatalogBuilder(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
InstallOperator(t, ctx, g, ns)
- g.Eventually(OperatorPod(t, ctx, ns)).ShouldNot(BeNil())
- g.Eventually(PlatformPhase(t, ctx,
ns)).Should(Equal(v1.IntegrationPlatformPhaseReady))
- catalogName := fmt.Sprintf("camel-catalog-%s",
strings.ToLower(defaults.DefaultRuntimeVersion))
- g.Eventually(CamelCatalog(t, ctx, ns,
catalogName)).ShouldNot(BeNil())
- g.Eventually(CamelCatalogPhase(t, ctx, ns, catalogName),
TestTimeoutMedium).Should(Equal(v1.CamelCatalogPhaseReady))
// Run an integration with a catalog not compatible
// The operator should create the catalog, but fail on
reconciliation as it is not compatible
diff --git a/e2e/advanced/debug_test.go b/e2e/advanced/debug_test.go
index 7b54a63c4..b53df3024 100644
--- a/e2e/advanced/debug_test.go
+++ b/e2e/advanced/debug_test.go
@@ -39,6 +39,7 @@ func TestKamelCLIDebug(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
InstallOperator(t, ctx, g, ns)
+ g.Eventually(OperatorPodPhase(t, ctx,
ns)).Should(Equal(corev1.PodRunning))
t.Run("debug local default port check", func(t *testing.T) {
g.Expect(KamelRun(t, ctx, ns,
"files/yaml.yaml").Execute()).To(Succeed())
diff --git a/e2e/advanced/integration_profile_test.go
b/e2e/advanced/integration_profile_test.go
index 73a7ec32b..0df2d72d3 100644
--- a/e2e/advanced/integration_profile_test.go
+++ b/e2e/advanced/integration_profile_test.go
@@ -26,7 +26,6 @@ import (
"context"
"testing"
- "github.com/apache/camel-k/v2/pkg/util/defaults"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
@@ -34,6 +33,7 @@ import (
. "github.com/apache/camel-k/v2/e2e/support"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
traitv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait"
+ "github.com/apache/camel-k/v2/pkg/util/defaults"
)
func TestIntegrationProfile(t *testing.T) {
@@ -61,7 +61,8 @@ func TestIntegrationProfile(t *testing.T) {
g.Expect(CreateIntegrationProfile(t, ctx,
&integrationProfile)).To(Succeed())
t.Run("Run integration with global integration
profile", func(t *testing.T) {
- g.Expect(KamelRunWithID(t, ctx, operatorID,
ns1, "--name", "limited", "--integration-profile", "ipr-global",
"files/yaml.yaml").Execute()).To(Succeed())
+ g.Expect(KamelRunWithID(t, ctx, operatorID, ns1,
+ "--name", "limited",
"--integration-profile", "ipr-global",
"files/yaml.yaml").Execute()).To(Succeed())
g.Eventually(IntegrationPod(t, ctx, ns1,
"limited"), TestTimeoutMedium).Should(Not(BeNil()))
g.Eventually(IntegrationPodHas(t, ctx, ns1,
"limited", func(pod *corev1.Pod) bool {
diff --git a/e2e/advanced/kamelet_repo_test.go
b/e2e/advanced/kamelet_repo_test.go
deleted file mode 100644
index f47713a4f..000000000
--- a/e2e/advanced/kamelet_repo_test.go
+++ /dev/null
@@ -1,68 +0,0 @@
-//go:build integration
-// +build integration
-
-// To enable compilation of this file in Goland, go to "Settings -> Go ->
Vendoring & Build Tags -> Custom Tags" and add "integration"
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package advanced
-
-import (
- "context"
- "testing"
-
- . "github.com/onsi/gomega"
- corev1 "k8s.io/api/core/v1"
-
- . "github.com/apache/camel-k/v2/e2e/support"
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
-)
-
-func TestKameletFromCustomRepository(t *testing.T) {
- t.Parallel()
-
- WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- InstallOperator(t, ctx, g, ns)
-
- kameletName := "timer-custom-source"
- removeKamelet(t, ctx, kameletName, ns)
- g.Eventually(Kamelet(t, ctx, kameletName, ns)).Should(BeNil())
-
- g.Eventually(Platform(t, ctx, ns)).ShouldNot(BeNil())
- pl := Platform(t, ctx, ns)()
- pl.Spec.Kamelet.Repositories = []v1.KameletRepositorySpec{
- {URI: "github:squakez/ck-kamelet-test-repo/kamelets"},
- }
- TestClient(t).Update(ctx, pl)
- g.Eventually(Platform(t, ctx, ns)).ShouldNot(BeNil())
- g.Eventually(PlatformHas(t, ctx, ns, func(pl
*v1.IntegrationPlatform) bool {
- return len(pl.Status.Kamelet.Repositories) > 0 &&
pl.Status.Kamelet.Repositories[0].URI ==
"github:squakez/ck-kamelet-test-repo/kamelets"
- }), TestTimeoutShort).Should(BeTrue())
-
- // Add the custom repository
- g.Expect(KamelRun(t, ctx, ns,
"files/TimerCustomKameletIntegration.java").Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ctx, ns,
"timer-custom-kamelet-integration"), TestTimeoutMedium).
- Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationLogs(t, ctx, ns,
"timer-custom-kamelet-integration")).Should(ContainSubstring("hello world"))
- })
-}
-
-func removeKamelet(t *testing.T, ctx context.Context, name string, ns string) {
- kamelet := Kamelet(t, ctx, name, ns)()
- TestClient(t).Delete(ctx, kamelet)
-}
diff --git a/e2e/advanced/maven_http_proxy_test.go
b/e2e/advanced/maven_http_proxy_test.go
index b19385513..bf5d6437d 100644
--- a/e2e/advanced/maven_http_proxy_test.go
+++ b/e2e/advanced/maven_http_proxy_test.go
@@ -213,8 +213,6 @@ func TestMavenProxyNotPresent(t *testing.T) {
// Should not be able to build
g.Eventually(IntegrationPhase(t, ctx, ns, name),
TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseError))
- g.Eventually(IntegrationConditionStatus(t, ctx, ns, name,
v1.IntegrationConditionKitAvailable), TestTimeoutShort).
- Should(Equal(corev1.ConditionFalse))
})
}
diff --git a/e2e/advanced/operator_id_filtering_test.go
b/e2e/advanced/operator_id_filtering_test.go
index c9f5869db..4e2d71412 100644
--- a/e2e/advanced/operator_id_filtering_test.go
+++ b/e2e/advanced/operator_id_filtering_test.go
@@ -42,12 +42,10 @@ func TestOperatorIDFiltering(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT,
nsop1 string) {
operator1 := "operator-1"
InstallOperatorWithConf(t, ctx, g, nsop1, operator1,
true, nil)
- g.Eventually(PlatformPhase(t, ctx, nsop1),
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
WithNewTestNamespace(t, func(ctx context.Context, g
*WithT, nsop2 string) {
operator2 := "operator-2"
InstallOperatorWithConf(t, ctx, g, nsop2,
operator2, true, nil)
- g.Eventually(PlatformPhase(t, ctx, nsop2),
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Operators ignore non-scoped
integrations", func(t *testing.T) {
g.Expect(KamelRunWithID(t, ctx,
"operator-x", ns, "files/yaml.yaml", "--name",
"untouched").Execute()).To(Succeed())
diff --git a/e2e/advanced/operator_metrics_test.go
b/e2e/advanced/operator_metrics_test.go
index e578dc53a..ab49843ff 100644
--- a/e2e/advanced/operator_metrics_test.go
+++ b/e2e/advanced/operator_metrics_test.go
@@ -42,7 +42,6 @@ import (
. "github.com/apache/camel-k/v2/e2e/support"
. "github.com/apache/camel-k/v2/e2e/support/util"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
- "github.com/apache/camel-k/v2/pkg/platform"
"github.com/prometheus/common/model"
)
@@ -198,68 +197,6 @@ func TestMetrics(t *testing.T) {
counter := NewLogCounter(&logs)
- // Count the number of IntegrationPlatform
reconciliations
- platformReconciliations, err :=
counter.Count(MatchFields(IgnoreExtras, Fields{
- "LoggerName":
Equal("camel-k.controller.integrationplatform"),
- "Message": Equal("Reconciling
IntegrationPlatform"),
- "RequestNamespace": Equal(ns),
- "RequestName":
Equal(platform.DefaultPlatformName),
- }))
- g.Expect(err).To(BeNil())
-
- // Check it matches the observation in the
corresponding metric
- platformReconciled :=
getMetric(metrics["camel_k_reconciliation_duration_seconds"],
- MatchFieldsP(IgnoreExtras, Fields{
- "Label": ConsistOf(
- label("group",
v1.SchemeGroupVersion.Group),
- label("version",
v1.SchemeGroupVersion.Version),
- label("kind",
"IntegrationPlatform"),
- label("namespace", ns),
- label("result", "Reconciled"),
- label("tag", ""),
- ),
- }))
- g.Expect(platformReconciled).NotTo(BeNil())
- platformReconciledCount :=
*platformReconciled.Histogram.SampleCount
- g.Expect(platformReconciledCount).To(BeNumerically(">",
0))
-
- platformRequeued :=
getMetric(metrics["camel_k_reconciliation_duration_seconds"],
- MatchFieldsP(IgnoreExtras, Fields{
- "Label": ConsistOf(
- label("group",
v1.SchemeGroupVersion.Group),
- label("version",
v1.SchemeGroupVersion.Version),
- label("kind",
"IntegrationPlatform"),
- label("namespace", ns),
- label("result", "Requeued"),
- label("tag", ""),
- ),
- }))
- platformRequeuedCount := uint64(0)
- if platformRequeued != nil {
- platformRequeuedCount =
*platformRequeued.Histogram.SampleCount
- }
-
- platformErrored :=
getMetric(metrics["camel_k_reconciliation_duration_seconds"],
- MatchFieldsP(IgnoreExtras, Fields{
- "Label": ConsistOf(
- label("group",
v1.SchemeGroupVersion.Group),
- label("version",
v1.SchemeGroupVersion.Version),
- label("kind",
"IntegrationPlatform"),
- label("namespace", ns),
- label("result", "Errored"),
- label("tag", "PlatformError"),
- ),
- }))
- platformErroredCount := uint64(0)
- if platformErrored != nil {
- platformErroredCount =
*platformErrored.Histogram.SampleCount
- }
-
- t.Logf("duration metric (integration platform)
platformReconciliations=%d, platformReconciledCount=%d,
platformRequeuedCount=%d platformErroredCount=%d",
- platformReconciliations,
platformReconciledCount, platformRequeuedCount, platformErroredCount)
-
-
g.Expect(platformReconciliations).To(BeNumerically("==",
platformReconciledCount+platformRequeuedCount+platformErroredCount))
-
// Count the number of Integration reconciliations
integrationReconciliations, err :=
counter.Count(MatchFields(IgnoreExtras, Fields{
"LoggerName":
Equal("camel-k.controller.integration"),
diff --git a/e2e/advanced/operator_restart_test.go
b/e2e/advanced/operator_restart_test.go
index 007f06ebb..5811b75ff 100644
--- a/e2e/advanced/operator_restart_test.go
+++ b/e2e/advanced/operator_restart_test.go
@@ -42,8 +42,7 @@ func TestOperatorRestart(t *testing.T) {
t.Run("Operator started", func(t *testing.T) {
InstallOperator(t, ctx, g, ns)
- g.Eventually(OperatorPod(t, ctx,
ns)).Should(Not(BeNil()))
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutShort).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
g.Expect(KamelRun(t, ctx, ns, "files/yaml.yaml",
"--name", name).Execute()).To(Succeed())
g.Eventually(IntegrationPhase(t, ctx, ns, name),
TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
g.Eventually(IntegrationConditionStatus(t, ctx, ns,
name, v1.IntegrationConditionReady),
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
@@ -55,8 +54,8 @@ func TestOperatorRestart(t *testing.T) {
t.Run("Operator uninstalled", func(t *testing.T) {
UninstallOperator(t, ctx, g, ns, "../../")
+
g.Eventually(OperatorPod(t, ctx, ns)).Should(BeNil())
- g.Eventually(Platform(t, ctx, ns)).Should(BeNil())
g.Eventually(IntegrationPhase(t, ctx, ns, name),
TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
g.Eventually(IntegrationConditionStatus(t, ctx, ns,
name, v1.IntegrationConditionReady),
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationPodPhase(t, ctx, ns, name),
TestTimeoutShort).Should(Equal(corev1.PodRunning))
@@ -72,8 +71,7 @@ func TestOperatorRestart(t *testing.T) {
"KAMEL_INSTALL_DEFAULT_KAMELETS":
"false",
},
)
- g.Eventually(OperatorPod(t, ctx,
ns)).Should(Not(BeNil()))
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutShort).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
g.Consistently(OperatorLogs(t, ctx, ns), 1*time.Minute,
3*time.Second).Should(Not(ContainSubstring("error")))
g.Eventually(IntegrationPhase(t, ctx, ns, name),
TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
g.Eventually(IntegrationConditionStatus(t, ctx, ns,
name, v1.IntegrationConditionReady),
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
diff --git a/e2e/advanced/promote_test.go b/e2e/advanced/promote_test.go
index 5e5c060f5..a37b6788f 100644
--- a/e2e/advanced/promote_test.go
+++ b/e2e/advanced/promote_test.go
@@ -43,7 +43,6 @@ func TestKamelCLIPromote(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, nsDev
string) {
operatorDevID := "camel-k-cli-promote-dev"
InstallOperatorWithConf(t, ctx, g, nsDev, operatorDevID, false,
nil)
- g.Eventually(SelectedPlatformPhase(t, ctx, nsDev,
operatorDevID),
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
// Dev content configmap
var cmData = make(map[string]string)
@@ -89,7 +88,6 @@ func TestKamelCLIPromote(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT,
nsProd string) {
operatorProdID := "camel-k-cli-promote-prod"
InstallOperatorWithConf(t, ctx, g, nsProd,
operatorProdID, false, nil)
- g.Eventually(PlatformPhase(t, ctx, nsProd),
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
// Prod content configmap
var cmData = make(map[string]string)
diff --git a/e2e/advanced/tekton_test.go b/e2e/advanced/tekton_test.go
deleted file mode 100644
index 86f8e0557..000000000
--- a/e2e/advanced/tekton_test.go
+++ /dev/null
@@ -1,78 +0,0 @@
-//go:build integration
-// +build integration
-
-// To enable compilation of this file in Goland, go to "Settings -> Go ->
Vendoring & Build Tags -> Custom Tags" and add "integration"
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package advanced
-
-import (
- "context"
- "os"
- "testing"
-
- . "github.com/onsi/gomega"
- "github.com/stretchr/testify/require"
-
- . "github.com/apache/camel-k/v2/e2e/support"
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
- corev1 "k8s.io/api/core/v1"
-)
-
-// TestTektonLikeBehavior verifies that the kamel binary can be invoked from
within the Camel K image.
-// This feature is used in Tekton pipelines.
-func TestTektonLikeBehavior(t *testing.T) {
- t.Parallel()
-
- WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- InstallOperator(t, ctx, g, ns)
-
- // Store a configmap holding an integration source
- var cmData = make(map[string][]byte)
- source, err := os.ReadFile("./files/Java.java")
- require.NoError(t, err)
- cmData["Java.java"] = source
- err = CreateBinaryConfigmap(t, ctx, ns, "integration-file",
cmData)
- require.NoError(t, err)
- integration := v1.ValueSource{
- ConfigMapKeyRef: &corev1.ConfigMapKeySelector{
- LocalObjectReference:
corev1.LocalObjectReference{
- Name: "integration-file",
- },
- Key: "Java.java",
- },
- }
- t.Run("Run tekton task like delegate build and run to
operator", func(t *testing.T) {
- name := RandomizedSuffixName("java-tekton-basic")
- g.Expect(CreateKamelPodWithIntegrationSource(t, ctx,
ns, "tekton-task-basic", integration, "run", "/tmp/Java.java", "--name",
name)).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ctx, ns, name),
TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ctx, ns,
name, v1.IntegrationConditionReady),
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, ctx, ns, name),
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
- })
- t.Run("Run tekton task like delegate run to operator", func(t
*testing.T) {
- name := RandomizedSuffixName("java-tekton-run")
- // Use an external image as source
- externalImage := "quay.io/fuse_qe/echo-server:0.3.3"
- g.Expect(CreateKamelPodWithIntegrationSource(t, ctx,
ns, "tekton-task-run", integration, "run", "/tmp/Java.java", "-t",
"container.image="+externalImage, "--name", name)).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ctx, ns, name),
TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ctx, ns,
name, v1.IntegrationConditionReady),
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, ctx, ns, name),
TestTimeoutShort).Should(ContainSubstring("Echo"))
- })
- })
-}
diff --git a/e2e/install/kustomize/setup_test.go
b/e2e/install/kustomize/setup_test.go
index d477e3c43..e5740b9d3 100644
--- a/e2e/install/kustomize/setup_test.go
+++ b/e2e/install/kustomize/setup_test.go
@@ -25,7 +25,6 @@ package kustomize
import (
"context"
"fmt"
- "os"
"os/exec"
"testing"
@@ -39,13 +38,11 @@ import (
)
func TestKustomizeNamespaced(t *testing.T) {
- KAMEL_INSTALL_REGISTRY := os.Getenv("KAMEL_INSTALL_REGISTRY")
kustomizeDir := testutil.MakeTempCopyDir(t, "../../../install")
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
// Let's make sure no CRD is yet available in the cluster
// as we must make the procedure to install them accordingly
g.Eventually(CRDs(t)).Should(BeNil(), "No Camel K CRDs should
be previously installed for this test")
- g.Expect(KAMEL_INSTALL_REGISTRY).NotTo(Equal(""))
// We must change a few values in the Kustomize config
ExpectExecSucceed(t, g,
exec.Command(
@@ -60,21 +57,7 @@ func TestKustomizeNamespaced(t *testing.T) {
fmt.Sprintf("%s/overlays/kubernetes/namespaced",
kustomizeDir),
"--server-side",
))
- ExpectExecSucceed(t, g,
- exec.Command(
- "sed",
- "-i",
- fmt.Sprintf("s/address: .*/address: %s/",
KAMEL_INSTALL_REGISTRY),
-
fmt.Sprintf("%s/overlays/platform/integration-platform.yaml", kustomizeDir),
- ))
- ExpectExecSucceed(t, g, Kubectl(
- "apply",
- "-k",
- fmt.Sprintf("%s/overlays/platform", kustomizeDir),
- "--server-side",
- "-n",
- ns,
- ))
+
// Refresh the test client to account for the newly installed
CRDs
RefreshClient(t)
g.Eventually(OperatorPod(t, ctx, ns)).ShouldNot(BeNil())
@@ -93,11 +76,6 @@ func TestKustomizeNamespaced(t *testing.T) {
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.AllowPrivilegeEscalation).To(
Equal(DefaultOperatorSecurityContext().AllowPrivilegeEscalation),
)
- g.Eventually(Platform(t, ctx, ns)).ShouldNot(BeNil())
- g.Eventually(PlatformHas(t, ctx, ns, func(pl
*v1.IntegrationPlatform) bool {
- return pl.Status.Build.Registry.Address ==
KAMEL_INSTALL_REGISTRY
- }), TestTimeoutShort).Should(BeTrue())
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutShort).Should(Equal(v1.IntegrationPlatformPhaseReady))
// Test a simple integration is running
g.Expect(KamelRun(t, ctx, ns,
"files/yaml.yaml").Execute()).To(Succeed())
@@ -109,7 +87,6 @@ func TestKustomizeNamespaced(t *testing.T) {
UninstallOperator(t, ctx, g, ns, "../../../")
g.Eventually(OperatorPod(t, ctx, ns)).Should(BeNil())
- g.Eventually(Platform(t, ctx, ns)).Should(BeNil())
g.Eventually(Integration(t, ctx, ns, "yaml"),
TestTimeoutShort).ShouldNot(BeNil())
g.Eventually(IntegrationConditionStatus(t, ctx, ns, "yaml",
v1.IntegrationConditionReady),
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
@@ -122,13 +99,11 @@ func TestKustomizeNamespaced(t *testing.T) {
}
func TestKustomizeDescoped(t *testing.T) {
- KAMEL_INSTALL_REGISTRY := os.Getenv("KAMEL_INSTALL_REGISTRY")
kustomizeDir := testutil.MakeTempCopyDir(t, "../../../install")
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
// Let's make sure no CRD is yet available in the cluster
// as we must make the procedure to install them accordingly
g.Eventually(CRDs(t)).Should(BeNil(), "No Camel K CRDs should
be previously installed for this test")
- g.Expect(KAMEL_INSTALL_REGISTRY).NotTo(Equal(""))
// We must change a few values in the Kustomize config
ExpectExecSucceed(t, g,
exec.Command(
@@ -143,21 +118,6 @@ func TestKustomizeDescoped(t *testing.T) {
fmt.Sprintf("%s/overlays/kubernetes/descoped",
kustomizeDir),
"--server-side",
))
- ExpectExecSucceed(t, g,
- exec.Command(
- "sed",
- "-i",
- fmt.Sprintf("s/address: .*/address: %s/",
KAMEL_INSTALL_REGISTRY),
-
fmt.Sprintf("%s/overlays/platform/integration-platform.yaml", kustomizeDir),
- ))
- ExpectExecSucceed(t, g, Kubectl(
- "apply",
- "-k",
- fmt.Sprintf("%s/overlays/platform", kustomizeDir),
- "--server-side",
- "-n",
- ns,
- ))
// Refresh the test client to account for the newly installed
CRDs
RefreshClient(t)
@@ -196,8 +156,6 @@ func TestKustomizeDescoped(t *testing.T) {
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.AllowPrivilegeEscalation).To(
Equal(DefaultOperatorSecurityContext().AllowPrivilegeEscalation),
)
- g.Eventually(Platform(t, ctx, ns)).ShouldNot(BeNil())
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutShort).Should(Equal(v1.IntegrationPlatformPhaseReady))
// We need a different namespace from the global operator
WithNewTestNamespace(t, func(ctx context.Context, g *WithT,
nsIntegration string) {
@@ -211,7 +169,6 @@ func TestKustomizeDescoped(t *testing.T) {
UninstallOperator(t, ctx, g, ns, "../../../")
g.Eventually(OperatorPod(t, ctx, ns)).Should(BeNil())
- g.Eventually(Platform(t, ctx, ns)).Should(BeNil())
g.Eventually(Integration(t, ctx, nsIntegration,
"yaml"), TestTimeoutShort).ShouldNot(BeNil())
g.Eventually(IntegrationConditionStatus(t, ctx,
nsIntegration, "yaml", v1.IntegrationConditionReady),
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
diff --git a/e2e/install/olm/olm_install_test.go
b/e2e/install/olm/olm_install_test.go
index 732081d41..48c955475 100644
--- a/e2e/install/olm/olm_install_test.go
+++ b/e2e/install/olm/olm_install_test.go
@@ -49,8 +49,6 @@ func TestOLMInstallation(t *testing.T) {
g.Eventually(CRDs(t)).Should(BeNil(), "No Camel K CRDs should
be previously installed for this test")
bundleImageName, ok := os.LookupEnv("BUNDLE_IMAGE_NAME")
g.Expect(ok).To(BeTrue(), "Missing bundle image: you need to
build and push to a container registry and set BUNDLE_IMAGE_NAME env var")
- containerRegistry, ok := os.LookupEnv("KAMEL_INSTALL_REGISTRY")
- g.Expect(ok).To(BeTrue(), "Missing local container registry:
you need to set it into KAMEL_INSTALL_REGISTRY env var")
os.Setenv("CAMEL_K_TEST_MAKE_DIR", "../../../")
// Install staged bundle (it must be available by building it
before running the test)
// You can build it locally via `make bundle-push` action
@@ -74,15 +72,6 @@ func TestOLMInstallation(t *testing.T) {
g.Eventually(OperatorPodPhase(t, ctx, ns),
TestTimeoutMedium).Should(Equal(corev1.PodRunning))
g.Eventually(OperatorImage(t, ctx, ns),
TestTimeoutShort).Should(Equal(operatorImage()))
- integrationPlatform := v1.NewIntegrationPlatform(ns, "camel-k")
- integrationPlatform.Spec.Build.Registry = v1.RegistrySpec{
- Address: containerRegistry,
- Insecure: true,
- }
- g.Expect(CreateIntegrationPlatform(t, ctx,
&integrationPlatform)).To(Succeed())
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
- g.Eventually(PlatformVersion(t, ctx, ns),
TestTimeoutMedium).Should(Equal(defaults.Version))
-
// Check if restricted security context has been applyed
operatorPod := OperatorPod(t, ctx, ns)()
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.RunAsNonRoot).To(Equal(DefaultOperatorSecurityContext().RunAsNonRoot))
diff --git a/e2e/install/upgrade/upgrade_test.go
b/e2e/install/upgrade/upgrade_test.go
index 2c9d71ac2..e924f77e2 100644
--- a/e2e/install/upgrade/upgrade_test.go
+++ b/e2e/install/upgrade/upgrade_test.go
@@ -47,6 +47,9 @@ func TestUpgrade(t *testing.T) {
// We start the test by installing previous version operator
lastVersion, ok := os.LookupEnv("LAST_RELEASED_VERSION")
g.Expect(ok).To(BeTrue(), "Missing last released version: you
need to set it into LAST_RELEASED_VERSION env var")
+
+ // Install previous version
+
lastVersionDir := fmt.Sprintf("/tmp/camel-k-v-%s", lastVersion)
// We clone and install the previous installed operator
// from source with tag
@@ -78,16 +81,37 @@ func TestUpgrade(t *testing.T) {
installPrevCmd.Dir = lastVersionDir
ExpectExecSucceed(t, g, installPrevCmd)
+ // TODO: In 2.11 we should move to this one instead
+ //
+ // kustomizeCmd := exec.Command(
+ // "kubectl",
+ // "kustomize",
+ //
"github.com/apache/camel-k/install/overlays/kubernetes/descoped?ref=v"+lastVersion,
+ // )
+ // output, err := kustomizeCmd.Output()
+ // g.Expect(err).To(BeNil())
+ // modified := strings.ReplaceAll(
+ // string(output),
+ // "namespace: camel-k",
+ // "namespace: "+ns,
+ // )
+ // applyCmd := exec.Command(
+ // "kubectl",
+ // "apply",
+ // "-f",
+ // "-",
+ // "--server-side",
+ // "--force-conflicts",
+ // )
+ // applyCmd.Stdin = strings.NewReader(modified)
+ // ExpectExecSucceed(t, g, applyCmd)
+
// Refresh the test client to account for the newly installed
CRDs
RefreshClient(t)
// Check the operator image is the previous one
g.Eventually(OperatorImage(t, ctx,
ns)).Should(ContainSubstring(lastVersion))
// Check the operator pod is running
g.Eventually(OperatorPodPhase(t, ctx, ns),
TestTimeoutMedium).Should(Equal(corev1.PodRunning))
- // Check the IntegrationPlatform has been reconciled
- g.Eventually(PlatformPhase(t, ctx,
ns)).Should(Equal(v1.IntegrationPlatformPhaseReady))
- g.Eventually(PlatformVersion(t, ctx,
ns)).Should(Equal(lastVersion))
- lastRuntimeVersion := PlatformRuntimeVersion(t, ctx, ns)()
// We need a different namespace from the global operator
WithNewTestNamespace(t, func(ctx context.Context, g *WithT,
nsIntegration string) {
@@ -99,6 +123,8 @@ func TestUpgrade(t *testing.T) {
Should(Equal(corev1.ConditionTrue))
// Check the Integration version
g.Eventually(IntegrationVersion(t, ctx, nsIntegration,
name)).Should(Equal(lastVersion))
+ // Get the info of the runtime, as we need for further
check later
+ lastRuntimeVersion := Integration(t, ctx,
nsIntegration, name)().Status.RuntimeVersion
// Let's upgrade the operator with the newer
installation
installNextCmd := exec.Command(
@@ -115,10 +141,6 @@ func TestUpgrade(t *testing.T) {
g.Eventually(OperatorImage(t, ctx,
ns)).Should(ContainSubstring(defaults.Version))
// Check the operator pod is running
g.Eventually(OperatorPodPhase(t, ctx, ns),
TestTimeoutMedium).Should(Equal(corev1.PodRunning))
- // Check the IntegrationPlatform has been reconciled
- g.Eventually(PlatformPhase(t, ctx, ns),
TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
- g.Eventually(PlatformVersion(t, ctx, ns),
TestTimeoutMedium).Should(Equal(defaults.Version))
- g.Eventually(PlatformRuntimeVersion(t, ctx, ns),
TestTimeoutMedium).Should(Equal(defaults.DefaultRuntimeVersion))
// Check the Integration hasn't been upgraded
g.Consistently(IntegrationVersion(t, ctx,
nsIntegration, name), 15*time.Second, 3*time.Second).
diff --git a/e2e/knative/knative_pipes_test.go
b/e2e/knative/knative_pipes_test.go
index 73811fac0..e1621ff8b 100644
--- a/e2e/knative/knative_pipes_test.go
+++ b/e2e/knative/knative_pipes_test.go
@@ -140,7 +140,6 @@ func TestRunBroker(t *testing.T) {
// This test require an adhoc operator to run properly
operatorID := fmt.Sprintf("camel-k-%s", ns)
InstallOperatorWithConf(t, ctx, g, ns, operatorID, false, nil)
- g.Eventually(SelectedPlatformPhase(t, ctx, ns, operatorID),
TestTimeoutMedium).Should(Equal(camelv1.IntegrationPlatformPhaseReady))
g.Expect(KamelRunWithID(t, ctx, operatorID, ns,
"files/knativeevt1.yaml").Execute()).To(Succeed())
g.Expect(KamelRunWithID(t, ctx, operatorID, ns,
"files/knativeevt2.yaml").Execute()).To(Succeed())
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index f446bed16..f12407b9b 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -1881,8 +1881,6 @@ func Build(t *testing.T, ctx context.Context, ns, name
string) func() *v1.Build
return nil
} else if err != nil && k8serrors.IsNotFound(err) &&
k8serrors.IsNotFound(err) {
return nil
- } else {
- log.Error(err, "Error while retrieving build "+name)
}
return build
@@ -1951,47 +1949,6 @@ func BuildsRunning(predicates ...func() v1.BuildPhase)
func() int {
}
}
-func HasPlatform(t *testing.T, ctx context.Context, ns string) func() bool {
- return func() bool {
- lst := v1.NewIntegrationPlatformList()
- if err := TestClient(t).List(ctx, &lst, ctrl.InNamespace(ns));
err != nil {
- return false
- }
- return len(lst.Items) > 0
- }
-}
-
-func Platform(t *testing.T, ctx context.Context, ns string) func()
*v1.IntegrationPlatform {
- return func() *v1.IntegrationPlatform {
- lst := v1.NewIntegrationPlatformList()
- if err := TestClient(t).List(ctx, &lst, ctrl.InNamespace(ns));
err != nil {
- return nil
- }
- if len(lst.Items) == 0 {
- return nil
- }
- if len(lst.Items) > 1 {
- failTest(t, fmt.Errorf("multiple integration platforms
found in namespace %q", ns))
- }
- return &lst.Items[0]
- }
-}
-
-func PlatformByName(t *testing.T, ctx context.Context, ns string, name string)
func() *v1.IntegrationPlatform {
- return func() *v1.IntegrationPlatform {
- lst := v1.NewIntegrationPlatformList()
- if err := TestClient(t).List(ctx, &lst, ctrl.InNamespace(ns));
err != nil {
- failTest(t, err)
- }
- for _, p := range lst.Items {
- if p.Name == name {
- return &p
- }
- }
- return nil
- }
-}
-
func IntegrationProfileByName(t *testing.T, ctx context.Context, ns string,
name string) func() *v1.IntegrationProfile {
return func() *v1.IntegrationProfile {
lst := newIntegrationProfileList()
@@ -2139,141 +2096,6 @@ func CamelCatalogList(t *testing.T, ctx
context.Context, ns string) func() []v1.
}
}
-func DeletePlatform(t *testing.T, ctx context.Context, ns string) func() bool {
- return func() bool {
- pl := Platform(t, ctx, ns)()
- if pl == nil {
- return true
- }
- if err := TestClient(t).Delete(ctx, pl); err != nil {
- log.Error(err, "Got error while deleting the platform")
- return false
- }
- return true
- }
-}
-
-func UpdatePlatform(t *testing.T, ctx context.Context, ns string, upd func(ip
*v1.IntegrationPlatform)) error {
- ip := PlatformByName(t, ctx, ns, platform.DefaultPlatformName)()
- if ip == nil {
- return fmt.Errorf("unable to locate Integration Platform %s in
%s", platform.DefaultPlatformName, ns)
- }
- target := ip.DeepCopy()
- upd(target)
- // For some reason, full patch fails on some clusters
- p, err := patch.MergePatch(ip, target)
- if err != nil {
- return err
- } else if len(p) == 0 {
- return nil
- }
- return TestClient(t).Patch(ctx, target,
ctrl.RawPatch(types.MergePatchType, p))
-}
-
-func CreateIntegrationPlatform(t *testing.T, ctx context.Context, ip
*v1.IntegrationPlatform) error {
- return TestClient(t).Create(ctx, ip)
-}
-
-func PlatformVersion(t *testing.T, ctx context.Context, ns string) func()
string {
- return func() string {
- p := Platform(t, ctx, ns)()
- if p == nil {
- return ""
- }
- return p.Status.Version
- }
-}
-
-func PlatformRuntimeVersion(t *testing.T, ctx context.Context, ns string)
func() string {
- return func() string {
- p := Platform(t, ctx, ns)()
- if p == nil {
- return ""
- }
- return p.Status.Build.RuntimeVersion
- }
-}
-
-func PlatformPhase(t *testing.T, ctx context.Context, ns string) func()
v1.IntegrationPlatformPhase {
- return func() v1.IntegrationPlatformPhase {
- p := Platform(t, ctx, ns)()
- if p == nil {
- return ""
- }
- return p.Status.Phase
- }
-}
-
-func SelectedPlatformPhase(t *testing.T, ctx context.Context, ns string, name
string) func() v1.IntegrationPlatformPhase {
- return func() v1.IntegrationPlatformPhase {
- p := PlatformByName(t, ctx, ns, name)()
- if p == nil {
- return ""
- }
- return p.Status.Phase
- }
-}
-
-func PlatformHas(t *testing.T, ctx context.Context, ns string, predicate
func(pl *v1.IntegrationPlatform) bool) func() bool {
- return func() bool {
- pl := Platform(t, ctx, ns)()
- if pl == nil {
- return false
- }
- return predicate(pl)
- }
-}
-
-func PlatformCondition(t *testing.T, ctx context.Context, ns string,
conditionType v1.IntegrationPlatformConditionType) func()
*v1.IntegrationPlatformCondition {
- return func() *v1.IntegrationPlatformCondition {
- p := Platform(t, ctx, ns)()
- if p == nil {
- return nil
- }
- return p.Status.GetCondition(conditionType)
- }
-}
-
-func PlatformConditionStatus(t *testing.T, ctx context.Context, ns string,
conditionType v1.IntegrationPlatformConditionType) func()
corev1.ConditionStatus {
- return func() corev1.ConditionStatus {
- c := PlatformCondition(t, ctx, ns, conditionType)()
- if c == nil {
- return "Unknown"
- }
- return c.Status
- }
-}
-
-func PlatformProfile(t *testing.T, ctx context.Context, ns string) func()
v1.TraitProfile {
- return func() v1.TraitProfile {
- p := Platform(t, ctx, ns)()
- if p == nil {
- return ""
- }
- return p.Status.Profile
- }
-}
-
-func PlatformTimeout(t *testing.T, ctx context.Context, ns string) func()
*metav1.Duration {
- return func() *metav1.Duration {
- p := Platform(t, ctx, ns)()
- if p == nil {
- return &metav1.Duration{}
- }
- return p.Status.Build.Timeout
- }
-}
-
-func AssignPlatformToOperator(t *testing.T, ctx context.Context, ns, operator
string) error {
- pl := Platform(t, ctx, ns)()
- if pl == nil {
- return errors.New("cannot assign platform to operator: no
platform found")
- }
-
- pl.SetOperatorID(operator)
- return TestClient(t).Update(ctx, pl)
-}
-
func CRDs(t *testing.T) func() []metav1.APIResource {
return func() []metav1.APIResource {
@@ -2560,78 +2382,9 @@ func ClusterDomainName(t *testing.T, ctx
context.Context) (string, error) {
return dns.Spec.BaseDomain, nil
}
-// CreateKamelPodWithIntegrationSource generates and deploy a Pod from current
Camel K controller image that will run a `kamel xxxx` command.
-// The integration parameter represent an Integration source file contained in
a ConfigMap or Secret defined and mounted on the as a Volume.
-func CreateKamelPodWithIntegrationSource(t *testing.T, ctx context.Context, ns
string, name string, integration v1.ValueSource, command ...string) error {
-
- var volumes []corev1.Volume
- if integration.SecretKeyRef != nil {
- volumes = []corev1.Volume{
- {
- Name: "integration-source-volume",
- VolumeSource: corev1.VolumeSource{
- Secret: &corev1.SecretVolumeSource{
- SecretName:
integration.SecretKeyRef.Name,
- },
- },
- },
- }
- } else {
- volumes = []corev1.Volume{
- {
- Name: "integration-source-volume",
- VolumeSource: corev1.VolumeSource{
- ConfigMap:
&corev1.ConfigMapVolumeSource{
- LocalObjectReference:
integration.ConfigMapKeyRef.LocalObjectReference,
- },
- },
- },
- }
- }
-
- var volumeMounts []corev1.VolumeMount
- volumeMounts = []corev1.VolumeMount{
- {
- Name: "integration-source-volume",
- MountPath: "/tmp/",
- ReadOnly: true,
- },
- }
-
- args := command
- for _, hook := range KamelHooks {
- args = hook(args)
- }
- pod := corev1.Pod{
- TypeMeta: metav1.TypeMeta{
- Kind: "Pod",
- APIVersion: corev1.SchemeGroupVersion.String(),
- },
- ObjectMeta: metav1.ObjectMeta{
- Namespace: ns,
- Name: name,
- },
- Spec: corev1.PodSpec{
- ServiceAccountName: "camel-k-operator",
- RestartPolicy: corev1.RestartPolicyNever,
- Containers: []corev1.Container{
- {
- Name: "kamel-runner",
- Image: TestImageName + ":" +
TestImageVersion,
- Command: append([]string{"kamel"},
args...),
- VolumeMounts: volumeMounts,
- },
- },
- Volumes: volumes,
- },
- }
- return TestClient(t).Create(ctx, &pod)
-}
-
/*
- Knative
+Knative
*/
-
func CreateKnativeChannel(t *testing.T, ctx context.Context, ns string, name
string) func() error {
return func() error {
channel := messaging.InMemoryChannel{
diff --git a/e2e/support/test_util.go b/e2e/support/test_util.go
index 574106283..3fa70301d 100644
--- a/e2e/support/test_util.go
+++ b/e2e/support/test_util.go
@@ -31,13 +31,13 @@ import (
"sync"
"testing"
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
. "github.com/onsi/gomega/gstruct"
"github.com/onsi/gomega/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ corev1 "k8s.io/api/core/v1"
)
var (
@@ -107,7 +107,7 @@ func InstallOperatorWithConf(t *testing.T, ctx
context.Context, g *WithT, ns, op
)
// Let's make sure the operator has been deployed and the platform ready
g.Eventually(OperatorPod(t, ctx, ns)).ShouldNot(BeNil())
- g.Eventually(PlatformPhase(t, ctx,
ns)).Should(Equal(v1.IntegrationPlatformPhaseReady))
+ g.Eventually(OperatorPodPhase(t, ctx,
ns)).Should(Equal(corev1.PodRunning))
}
// UninstallOperator will delete operator resources from namespace (keeps
CRDs).
diff --git a/helm/camel-k/crds/camel-k-crds.yaml
b/helm/camel-k/crds/camel-k-crds.yaml
index 942e5df90..91aa72c72 100644
--- a/helm/camel-k/crds/camel-k-crds.yaml
+++ b/helm/camel-k/crds/camel-k-crds.yaml
@@ -2970,6 +2970,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -3924,6 +3926,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -6452,6 +6456,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -8874,6 +8880,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -11282,6 +11290,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -20546,6 +20556,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -22915,6 +22927,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -33539,6 +33553,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to
be a text containing a valid maven profile starting with `<profile>` and ending
with `</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where
name represents the resource name, key optionally represents the resource key
to be filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -35833,6 +35849,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
diff --git a/helm/camel-k/templates/rbacs-common.yaml
b/helm/camel-k/templates/rbacs-common.yaml
index e4a784657..58f22d5b0 100644
--- a/helm/camel-k/templates/rbacs-common.yaml
+++ b/helm/camel-k/templates/rbacs-common.yaml
@@ -38,15 +38,6 @@ rules:
- get
- patch
- update
-- apiGroups:
- - ""
- resources:
- - configmaps
- - secrets
- verbs:
- - get
- - list
- - watch
- apiGroups:
- ""
- events.k8s.io
diff --git a/pkg/apis/camel/v1/camelcatalog_types_support.go
b/pkg/apis/camel/v1/camelcatalog_types_support.go
index fb73204f1..5a07bffbb 100644
--- a/pkg/apis/camel/v1/camelcatalog_types_support.go
+++ b/pkg/apis/camel/v1/camelcatalog_types_support.go
@@ -63,6 +63,16 @@ func NewCamelCatalogList() CamelCatalogList {
}
}
+// GetOperatorID returns the operator id as an annotation.
+func (c *CamelCatalog) GetOperatorID() string {
+ return GetAnnotation(OperatorIDAnnotation, c)
+}
+
+// SetOperatorID sets the given operator id as an annotation.
+func (c *CamelCatalog) SetOperatorID(operatorID string) {
+ SetAnnotation(&c.ObjectMeta, OperatorIDAnnotation, operatorID)
+}
+
// GetType --.
func (c *CamelCatalogCondition) GetType() string {
return string(c.Type)
diff --git a/pkg/apis/camel/v1/integration_types_support.go
b/pkg/apis/camel/v1/integration_types_support.go
index 2399b9e5b..bae4ee4fc 100644
--- a/pkg/apis/camel/v1/integration_types_support.go
+++ b/pkg/apis/camel/v1/integration_types_support.go
@@ -278,6 +278,11 @@ func NewSourceSpec(name string, content string, language
Language) SourceSpec {
}
}
+// GetOperatorID returns the operator id as an annotation.
+func (in *Integration) GetOperatorID() string {
+ return GetAnnotation(OperatorIDAnnotation, in)
+}
+
// SetOperatorID sets the given operator id as an annotation.
func (in *Integration) SetOperatorID(operatorID string) {
SetAnnotation(&in.ObjectMeta, OperatorIDAnnotation, operatorID)
diff --git a/pkg/apis/camel/v1/integrationkit_types_support.go
b/pkg/apis/camel/v1/integrationkit_types_support.go
index 623beb6e5..b791a1db7 100644
--- a/pkg/apis/camel/v1/integrationkit_types_support.go
+++ b/pkg/apis/camel/v1/integrationkit_types_support.go
@@ -60,6 +60,11 @@ func (in *IntegrationKitSpec) Configurations()
[]ConfigurationSpec {
return in.Configuration
}
+// GetOperatorID returns the operator id as an annotation.
+func (in *IntegrationKit) GetOperatorID() string {
+ return GetAnnotation(OperatorIDAnnotation, in)
+}
+
// SetOperatorID sets the given operator id as an annotation.
func (in *IntegrationKit) SetOperatorID(operatorID string) {
SetAnnotation(&in.ObjectMeta, OperatorIDAnnotation, operatorID)
diff --git a/pkg/apis/camel/v1/integrationplatform_types_support.go
b/pkg/apis/camel/v1/integrationplatform_types_support.go
index 0fb7ba58a..6aaf718a5 100644
--- a/pkg/apis/camel/v1/integrationplatform_types_support.go
+++ b/pkg/apis/camel/v1/integrationplatform_types_support.go
@@ -57,6 +57,11 @@ func (in *IntegrationPlatformSpec) Configurations()
[]ConfigurationSpec {
return in.Configuration
}
+// GetOperatorID returns the operator id as an annotation.
+func (in *IntegrationPlatform) GetOperatorID() string {
+ return GetAnnotation(OperatorIDAnnotation, in)
+}
+
// SetOperatorID sets the given operator id as an annotation.
func (in *IntegrationPlatform) SetOperatorID(operatorID string) {
SetAnnotation(&in.ObjectMeta, OperatorIDAnnotation, operatorID)
diff --git a/pkg/apis/camel/v1/trait/builder.go
b/pkg/apis/camel/v1/trait/builder.go
index aaf2723f9..9b771152a 100644
--- a/pkg/apis/camel/v1/trait/builder.go
+++ b/pkg/apis/camel/v1/trait/builder.go
@@ -63,6 +63,8 @@ type BuilderTrait struct {
// This configmap/secret is a resource of the IntegrationKit created,
therefore it needs to be present in the namespace where the operator is going
to create the IntegrationKit.
// The content of the maven profile is expected to be a text containing
a valid maven profile starting with `<profile>` and ending with `</profile>`
that will be integrated as an inline profile in the POM.
// Syntax: [configmap|secret]:name[/key], where name represents the
resource name, key optionally represents the resource key to be filtered
(default key value = profile.xml).
+ //
+ // Deprecated: will be removed in future versions.
MavenProfiles []string `json:"mavenProfiles,omitempty"
property:"maven-profiles"`
// A list of tasks to be executed (available only when using `pod`
strategy) with format `<name>;<container-image>;<container-command>`.
Tasks []string `json:"tasks,omitempty" property:"tasks"`
diff --git a/pkg/controller/integration/platform_setup.go
b/pkg/controller/integration/platform_setup.go
index 12c97cd44..0099a1669 100644
--- a/pkg/controller/integration/platform_setup.go
+++ b/pkg/controller/integration/platform_setup.go
@@ -63,14 +63,13 @@ func (action *platformSetupAction) Handle(ctx
context.Context, integration *v1.I
pl, err := platform.GetForResource(ctx, action.client, integration)
if err != nil && !k8serrors.IsNotFound(err) {
return nil, err
- } else if pl != nil {
- profile, err := determineBestTraitProfile(action.client,
integration, pl)
- if err != nil {
- return nil, err
- }
- //nolint:staticcheck
- integration.Status.Profile = profile
}
+ profile, err := determineBestTraitProfile(action.client, integration,
pl)
+ if err != nil {
+ return nil, err
+ }
+ //nolint:staticcheck
+ integration.Status.Profile = profile
// Change the integration phase to Initialization after traits have
been applied
// so that traits targeting Initialization phase don't get applied
unintentionally
@@ -93,11 +92,11 @@ func determineBestTraitProfile(c client.Client, integration
*v1.Integration, p *
// Integration already has a profile
return integration.Status.Profile, nil
}
- if p.Status.Profile != "" {
+ if p != nil && p.Status.Profile != "" {
// Use platform profile if set
return p.Status.Profile, nil
}
- if p.Spec.Profile != "" {
+ if p != nil && p.Spec.Profile != "" {
// Use platform spec profile if set
return p.Spec.Profile, nil
}
@@ -107,5 +106,9 @@ func determineBestTraitProfile(c client.Client, integration
*v1.Integration, p *
return v1.TraitProfileKnative, nil
}
- return platform.GetTraitProfile(p), nil
+ if p != nil {
+ return platform.GetTraitProfile(p), nil
+ }
+
+ return v1.TraitProfileKubernetes, nil
}
diff --git a/pkg/controller/integrationplatform/create.go
b/pkg/controller/integrationplatform/create.go
index 6643853c2..2e01dfec9 100644
--- a/pkg/controller/integrationplatform/create.go
+++ b/pkg/controller/integrationplatform/create.go
@@ -146,7 +146,7 @@ func (action *createAction) handleNewCatalog(ctx
context.Context, platform *v1.I
if catalog == nil {
cat, err := camel.CreateCatalog(
ctx, action.client, platform.Namespace,
platform.Status.Build.Maven,
- platform.Status.Build.GetTimeout().Duration,
runtimeSpec, nil)
+ platform.Status.Build.GetTimeout().Duration,
runtimeSpec, nil, platform.GetOperatorID())
if err != nil {
action.L.Error(err, "IntegrationPlatform unable to
create Camel catalog",
"runtime-version", runtimeSpec.Version,
"runtime-provider", runtimeSpec.Provider)
diff --git
a/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml
b/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml
index 914f204ef..53b69620e 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml
@@ -262,6 +262,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
diff --git
a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
index f639f7b5a..e128e6acd 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
@@ -625,6 +625,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -3153,6 +3155,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
diff --git
a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
index 9d90c840a..764f65c4d 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
@@ -483,6 +483,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -2891,6 +2893,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
index 782d66b9a..928b78e44 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
@@ -7328,6 +7328,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -9697,6 +9699,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
diff --git a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
index e6f42f5a7..a9a1b206f 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
@@ -7380,6 +7380,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to
be a text containing a valid maven profile starting with `<profile>` and ending
with `</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where
name represents the resource name, key optionally represents the resource key
to be filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
@@ -9674,6 +9676,8 @@ spec:
This configmap/secret is a resource of the
IntegrationKit created, therefore it needs to be present in the namespace where
the operator is going to create the IntegrationKit.
The content of the maven profile is expected to be a
text containing a valid maven profile starting with `<profile>` and ending with
`</profile>` that will be integrated as an inline profile in the POM.
Syntax: [configmap|secret]:name[/key], where name
represents the resource name, key optionally represents the resource key to be
filtered (default key value = profile.xml).
+
+ Deprecated: will be removed in future versions.
items:
type: string
type: array
diff --git a/pkg/resources/config/manager/operator-deployment.yaml
b/pkg/resources/config/manager/operator-deployment.yaml
index a4d822fdb..d395d64ab 100644
--- a/pkg/resources/config/manager/operator-deployment.yaml
+++ b/pkg/resources/config/manager/operator-deployment.yaml
@@ -77,6 +77,14 @@ spec:
# Note: remove the variable to disable the feature.
- name: CAMEL_MONITOR_OPERATOR_LABEL
value: "camel.apache.org/monitor"
+ # Attempt to read bootstrap configuration from configmap or secret
+ envFrom:
+ - configMapRef:
+ name: camel-k-operator-configmap-configuration
+ optional: true
+ - secretRef:
+ name: camel-k-operator-secret-configuration
+ optional: true
livenessProbe:
httpGet:
path: /healthz
diff --git
a/pkg/resources/config/manifests/bases/camel-k.clusterserviceversion.yaml
b/pkg/resources/config/manifests/bases/camel-k.clusterserviceversion.yaml
index 463b2a7a8..9c64883c5 100644
--- a/pkg/resources/config/manifests/bases/camel-k.clusterserviceversion.yaml
+++ b/pkg/resources/config/manifests/bases/camel-k.clusterserviceversion.yaml
@@ -86,22 +86,8 @@ spec:
## Installation
- You may need to specify the container registry where to store the
container images created for the Camel applications.
- To start using Camel K, install the operator and then create the following
`IntegrationPlatform`:
- ```
- apiVersion: camel.apache.org/v1
- kind: IntegrationPlatform
- metadata:
- name: camel-k
- labels:
- app: "camel-k"
- spec:
- build:
- registry:
- address: docker.io/my-org
- ```
-
- An `IntegrationPlatform` resource is automatically created by default on
OpenShift, so you can skip this step when using Openshift cluster.
+ Proceed to the Camel K operator installation via `Subscription` or via GUI.
+ See official Apache Camel K documentation to learn how to configure all
the available parameters.
## Running an Integration
@@ -110,8 +96,6 @@ spec:
apiVersion: camel.apache.org/v1
kind: Integration
metadata:
- annotations:
- camel.apache.org/operator.id: camel-k
name: test
spec:
flows:
diff --git a/pkg/resources/config/rbac/builder-role.yaml
b/pkg/resources/config/rbac/builder-role.yaml
index 301714e59..2fc57ed2c 100644
--- a/pkg/resources/config/rbac/builder-role.yaml
+++ b/pkg/resources/config/rbac/builder-role.yaml
@@ -39,15 +39,6 @@ rules:
- get
- patch
- update
-- apiGroups:
- - ""
- resources:
- - configmaps
- - secrets
- verbs:
- - get
- - list
- - watch
- apiGroups:
# Deprecated: this legacy group is replaced by events.k8s.io from version
2.10.0 onward
- ""
diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go
index 0aa1a2ce6..0ec620933 100644
--- a/pkg/trait/builder.go
+++ b/pkg/trait/builder.go
@@ -446,6 +446,7 @@ func (t *builderTrait) builderTask(e *Environment, taskConf
*v1.BuildConfigurati
}
// User provides a maven profile
+ //nolint:staticcheck
if t.MavenProfiles != nil {
mavenProfiles := make([]v1.ValueSource, 0)
for _, v := range t.MavenProfiles {
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 2bad26cb5..acb79c19e 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -29,6 +29,7 @@ import (
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
traitv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait"
+ "github.com/apache/camel-k/v2/pkg/platform"
"github.com/apache/camel-k/v2/pkg/util/camel"
"github.com/apache/camel-k/v2/pkg/util/defaults"
"github.com/apache/camel-k/v2/pkg/util/kubernetes"
@@ -181,14 +182,27 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment)
error {
if exactVersionRegexp.MatchString(t.runtimeVersion) {
mavenSpec := e.Platform.Maven.MavenSpec
var extraRepositories []string
- if e.Integration != nil &&
e.Integration.Spec.Repositories != nil {
- extraRepositories = append(extraRepositories,
e.Integration.Spec.Repositories...)
+ // If the resource is targeting a specific operator,
then, we must
+ // provide the same setting to the catalog
+ operatorId := ""
+ if e.Integration != nil {
+ if e.Integration.GetOperatorID() != "" {
+ operatorId =
e.Integration.GetOperatorID()
+ }
+ if e.Integration.Spec.Repositories != nil {
+ extraRepositories =
append(extraRepositories, e.Integration.Spec.Repositories...)
+ }
}
- if e.IntegrationKit != nil &&
e.IntegrationKit.Spec.Repositories != nil {
- extraRepositories = append(extraRepositories,
e.IntegrationKit.Spec.Repositories...)
+ if e.IntegrationKit != nil {
+ if e.IntegrationKit.GetOperatorID() != "" {
+ operatorId =
e.IntegrationKit.GetOperatorID()
+ }
+ if e.IntegrationKit.Spec.Repositories != nil {
+ extraRepositories =
append(extraRepositories, e.IntegrationKit.Spec.Repositories...)
+ }
}
catalog, err = camel.CreateCatalog(e.Ctx, e.Client,
catalogNamespace,
- mavenSpec, e.Platform.BuildTimeout, runtime,
extraRepositories)
+ mavenSpec, platform.DefaultBuildTimeout,
runtime, extraRepositories, operatorId)
if err != nil {
return err
}
diff --git a/pkg/trait/pull_secret.go b/pkg/trait/pull_secret.go
index be1cdf7c7..8028d2cd0 100644
--- a/pkg/trait/pull_secret.go
+++ b/pkg/trait/pull_secret.go
@@ -25,8 +25,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
- ctrl "sigs.k8s.io/controller-runtime/pkg/client"
-
traitv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/v2/pkg/platform"
"github.com/apache/camel-k/v2/pkg/util/kubernetes"
@@ -72,12 +70,8 @@ func (t *pullSecretTrait) Configure(e *Environment) (bool,
*TraitCondition, erro
}
func (t *pullSecretTrait) autoConfigure(e *Environment) error {
if t.SecretName == "" {
- s, err := t.resolveSecret(e)
- if err != nil {
- return err
- }
-
- t.SecretName = s
+ // By default, it uses the registry secret configuration
+ t.SecretName = e.Platform.Registry.Secret
}
//nolint:staticcheck
@@ -158,22 +152,3 @@ func (t *pullSecretTrait) newImagePullerRoleBinding(e
*Environment) *rbacv1.Role
},
}
}
-
-func (t *pullSecretTrait) resolveSecret(e *Environment) (string, error) {
- secret := e.Platform.Registry.Secret
- if secret == "" {
- return "", nil
- }
-
- key := ctrl.ObjectKey{Namespace: e.Platform.Registry.Organization,
Name: secret}
- obj := corev1.Secret{}
- if err := t.Client.Get(e.Ctx, key, &obj); err != nil {
- return "", err
- }
-
- if obj.Type != corev1.SecretTypeDockerConfigJson {
- return "", nil
- }
-
- return secret, nil
-}
diff --git a/pkg/util/camel/camel_runtime.go b/pkg/util/camel/camel_runtime.go
index 0c6a13994..5c534a504 100644
--- a/pkg/util/camel/camel_runtime.go
+++ b/pkg/util/camel/camel_runtime.go
@@ -35,7 +35,7 @@ import (
// CreateCatalog --.
func CreateCatalog(
ctx context.Context, client client.Client, namespace string,
- mavenSpec v1.MavenSpec, timeout time.Duration, runtime v1.RuntimeSpec,
extraRepositories []string) (*RuntimeCatalog, error) {
+ mavenSpec v1.MavenSpec, timeout time.Duration, runtime v1.RuntimeSpec,
extraRepositories []string, operatorId string) (*RuntimeCatalog, error) {
ctx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
catalog, err := GenerateCatalog(ctx, client, namespace, mavenSpec,
runtime, extraRepositories)
@@ -53,6 +53,10 @@ func CreateCatalog(
cx.Labels[kubernetes.CamelLabelRuntimeProvider] =
string(runtime.Provider)
cx.Labels["camel.apache.org/catalog.generated"] = "true"
+ if operatorId != "" {
+ cx.SetOperatorID(operatorId)
+ }
+
if err := client.Create(ctx, &cx); err != nil {
if k8serrors.IsAlreadyExists(err) {
// It's still possible that catalog wasn't yet found at
the time of loading
diff --git a/pkg/util/camel/camel_runtime_test.go
b/pkg/util/camel/camel_runtime_test.go
index 265a5e5af..8e431fb18 100644
--- a/pkg/util/camel/camel_runtime_test.go
+++ b/pkg/util/camel/camel_runtime_test.go
@@ -53,6 +53,7 @@ func TestCreateCatalog(t *testing.T) {
platform.SingletonPlatform.BuildTimeout,
v1.RuntimeSpec{Provider: v1.RuntimeProviderQuarkus, Version:
defaults.DefaultRuntimeVersion},
nil,
+ "",
)
require.NoError(t, err)
assert.NotNil(t, catalog)
diff --git a/script/Makefile b/script/Makefile
index f0f66b0bf..f997086da 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -804,7 +804,16 @@ endif
cd $(KUST_TMP)/install/overlays/platform && kustomize edit set
namespace $(NAMESPACE)
kubectl apply -k $(KUST_TMP)/$(KUSTOMIZE_DIR) --server-side
--force-conflicts
-install-registry:
+install-k8s-global: DEFAULT_NS="camel-k"
+install-k8s-global: KUSTOMIZE_DIR="install/overlays/kubernetes/descoped"
+install-k8s-global: clone-kustomize-dir set-operator-id set-operator-env
install-operator
+
+install-k8s-ns: DEFAULT_NS="default"
+install-k8s-ns: KUSTOMIZE_DIR="install/overlays/kubernetes/namespaced"
+install-k8s-ns: clone-kustomize-dir set-operator-id set-operator-env
install-operator
+
+install-registry: NAMESPACE="camel-k"
+install-registry: clone-kustomize-dir
@echo "####### Installing container registry..."
ifdef REGISTRY
@echo "INFO: Setting IntegrationPlatform container registry to
$(REGISTRY)"
@@ -819,14 +828,6 @@ ifneq ($(MINIKUBE_REGISTRY),"")
endif
endif
-install-k8s-global: DEFAULT_NS="camel-k"
-install-k8s-global: KUSTOMIZE_DIR="install/overlays/kubernetes/descoped"
-install-k8s-global: clone-kustomize-dir set-operator-id set-operator-env
install-operator install-registry
-
-install-k8s-ns: DEFAULT_NS="default"
-install-k8s-ns: KUSTOMIZE_DIR="install/overlays/kubernetes/namespaced"
-install-k8s-ns: clone-kustomize-dir set-operator-id set-operator-env
install-operator install-registry
-
uninstall:
ifdef NAMESPACE
kubectl delete deploy -l app=camel-k -n $(NAMESPACE)