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

[Backport 2.3.x] fix(trait): compute cm after catalog #5427

Merged
merged 2 commits into from
Apr 26, 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
4 changes: 2 additions & 2 deletions e2e/common/misc/pipe_with_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestPipeWithImage(t *testing.T) {
)))
g.Eventually(IntegrationStatusImage(t, ctx, ns, bindingID)).
Should(Equal(expectedImage))
g.Eventually(IntegrationPodPhase(t, ctx, ns, bindingID), TestTimeoutLong).
g.Eventually(IntegrationPodPhase(t, ctx, ns, bindingID), TestTimeoutShort).
Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationPodImage(t, ctx, ns, bindingID)).
Should(Equal(expectedImage))
Expand All @@ -79,7 +79,7 @@ func TestPipeWithImage(t *testing.T) {
)))
g.Eventually(IntegrationStatusImage(t, ctx, ns, bindingID)).
Should(Equal(expectedImage))
g.Eventually(IntegrationPodPhase(t, ctx, ns, bindingID), TestTimeoutLong).
g.Eventually(IntegrationPodPhase(t, ctx, ns, bindingID), TestTimeoutShort).
Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationPodImage(t, ctx, ns, bindingID)).
Should(Equal(expectedImage))
Expand Down
11 changes: 5 additions & 6 deletions pkg/trait/camel.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ func (t *camelTrait) Configure(e *Environment) (bool, *TraitCondition, error) {
}

func (t *camelTrait) Apply(e *Environment) error {
if e.IntegrationKitInPhase(v1.IntegrationKitPhaseReady) && e.IntegrationInRunningPhases() {
// Get all resources
maps := t.computeConfigMaps(e)
e.Resources.AddAll(maps)
}
if e.IntegrationKit != nil && e.IntegrationKit.IsSynthetic() {
// This is required as during init phase, the trait set by default these values
// which are widely used in the platform for different purposese.
Expand All @@ -107,7 +102,11 @@ func (t *camelTrait) Apply(e *Environment) error {
e.IntegrationKit.Status.RuntimeVersion = e.CamelCatalog.Runtime.Version
e.IntegrationKit.Status.RuntimeProvider = e.CamelCatalog.Runtime.Provider
}

if e.IntegrationKitInPhase(v1.IntegrationKitPhaseReady) && e.IntegrationInRunningPhases() {
// Get all resources
maps := t.computeConfigMaps(e)
e.Resources.AddAll(maps)
}
return nil
}

Expand Down
6 changes: 4 additions & 2 deletions pkg/trait/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ func (t *mountTrait) Apply(e *Environment) error {
}

if visited {
// Volumes declared in the Integration resources
e.configureVolumesAndMounts(volumes, &container.VolumeMounts)
// Volumes declared in the Integration resources (we skip for synthetic kits)
if e.IntegrationKit == nil || !e.IntegrationKit.IsSynthetic() {
e.configureVolumesAndMounts(volumes, &container.VolumeMounts)
}
// Volumes declared in the trait config/resource options
err := t.configureVolumesAndMounts(volumes, &container.VolumeMounts)
if err != nil {
Expand Down
Loading