Skip to content
Draft
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
515 changes: 40 additions & 475 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion e2e/advanced/operator_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func TestMetrics(t *testing.T) {
}
g.Expect(ts1).NotTo(BeZero())
// The end time is reported into the ready condition first truthy time
ts2 = it.Status.GetCondition(v1.IntegrationConditionReady).FirstTruthyTime.Time
ts2 = it.Status.FirstReadyTimestamp.Time
g.Expect(ts2).NotTo(BeZero())

duration := ts2.Sub(ts1)
Expand Down
69 changes: 35 additions & 34 deletions e2e/common/traits/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"time"

camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

. "github.com/onsi/gomega"
"github.com/onsi/gomega/gstruct"
Expand Down Expand Up @@ -101,17 +102,17 @@ func TestHealthTrait(t *testing.T) {
}

g.Eventually(IntegrationCondition(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(
Satisfy(func(c *v1.IntegrationCondition) bool {
if c.Status != corev1.ConditionFalse {
Satisfy(func(c *metav1.Condition) bool {
if c.Status != metav1.ConditionFalse {
return false
}
if len(c.DeprecatedPods) != 3 {
if len(Integration(t, ctx, ns, name)().Status.DeprecatedPods) != 3 {
return false
}

var r *v1.HealthCheckResponse

for _, pod := range c.DeprecatedPods {
for _, pod := range Integration(t, ctx, ns, name)().Status.DeprecatedPods {
for h := range pod.Health {
if pod.Health[h].Name == "camel-routes" {
r = &pod.Health[h]
Expand Down Expand Up @@ -193,19 +194,19 @@ func TestHealthTrait(t *testing.T) {
WithTransform(IntegrationConditionMessage, Equal("1/1 pods are not ready"))))

g.Eventually(IntegrationCondition(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(
Satisfy(func(c *v1.IntegrationCondition) bool {
if c.Status != corev1.ConditionFalse {
Satisfy(func(c *metav1.Condition) bool {
if c.Status != metav1.ConditionFalse {
return false
}
if len(c.DeprecatedPods) != 1 {
if len(Integration(t, ctx, ns, name)().Status.DeprecatedPods) != 1 {
return false
}

var r *v1.HealthCheckResponse

for h := range c.DeprecatedPods[0].Health {
if c.DeprecatedPods[0].Health[h].Name == "camel-routes" {
r = &c.DeprecatedPods[0].Health[h]
for h := range Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health {
if Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h].Name == "camel-routes" {
r = &Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h]
}
}

Expand Down Expand Up @@ -278,19 +279,19 @@ func TestHealthTrait(t *testing.T) {
WithTransform(IntegrationConditionMessage, Equal("1/1 pods are not ready"))))

g.Eventually(IntegrationCondition(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(
Satisfy(func(c *v1.IntegrationCondition) bool {
if c.Status != corev1.ConditionFalse {
Satisfy(func(c *metav1.Condition) bool {
if c.Status != metav1.ConditionFalse {
return false
}
if len(c.DeprecatedPods) != 1 {
if len(Integration(t, ctx, ns, name)().Status.DeprecatedPods) != 1 {
return false
}

var r *v1.HealthCheckResponse

for h := range c.DeprecatedPods[0].Health {
if c.DeprecatedPods[0].Health[h].Name == "camel-routes" {
r = &c.DeprecatedPods[0].Health[h]
for h := range Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health {
if Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h].Name == "camel-routes" {
r = &Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h]
}
}

Expand All @@ -311,19 +312,19 @@ func TestHealthTrait(t *testing.T) {
}))

g.Eventually(PipeCondition(t, ctx, ns, name, camelv1.PipeConditionReady), TestTimeoutLong).Should(
Satisfy(func(c *camelv1.PipeCondition) bool {
if c.Status != corev1.ConditionFalse {
Satisfy(func(c *metav1.Condition) bool {
if c.Status != metav1.ConditionFalse {
return false
}
if len(c.DeprecatedPods) != 1 {
if len(Integration(t, ctx, ns, name)().Status.DeprecatedPods) != 1 {
return false
}

var r *v1.HealthCheckResponse

for h := range c.DeprecatedPods[0].Health {
if c.DeprecatedPods[0].Health[h].Name == "camel-routes" {
r = &c.DeprecatedPods[0].Health[h]
for h := range Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health {
if Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h].Name == "camel-routes" {
r = &Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h]
}
}

Expand Down Expand Up @@ -363,19 +364,19 @@ func TestHealthTrait(t *testing.T) {
WithTransform(IntegrationConditionMessage, Equal("1/1 pods are not ready"))))

g.Eventually(IntegrationCondition(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(
Satisfy(func(c *v1.IntegrationCondition) bool {
if c.Status != corev1.ConditionFalse {
Satisfy(func(c *metav1.Condition) bool {
if c.Status != metav1.ConditionFalse {
return false
}
if len(c.DeprecatedPods) != 1 {
if len(Integration(t, ctx, ns, name)().Status.DeprecatedPods) != 1 {
return false
}

var r *v1.HealthCheckResponse

for h := range c.DeprecatedPods[0].Health {
if c.DeprecatedPods[0].Health[h].Name == "never-ready" {
r = &c.DeprecatedPods[0].Health[h]
for h := range Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health {
if Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h].Name == "never-ready" {
r = &Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h]
}
}

Expand Down Expand Up @@ -413,19 +414,19 @@ func TestHealthTrait(t *testing.T) {
WithTransform(IntegrationConditionMessage, Equal("1/1 pods are not ready"))))

g.Eventually(IntegrationCondition(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(
Satisfy(func(c *v1.IntegrationCondition) bool {
if c.Status != corev1.ConditionFalse {
Satisfy(func(c *metav1.Condition) bool {
if c.Status != metav1.ConditionFalse {
return false
}
if len(c.DeprecatedPods) != 1 {
if len(Integration(t, ctx, ns, name)().Status.DeprecatedPods) != 1 {
return false
}

var r *v1.HealthCheckResponse

for h := range c.DeprecatedPods[0].Health {
if c.DeprecatedPods[0].Health[h].Name == "never-ready" && c.DeprecatedPods[0].Health[h].Status == "DOWN" {
r = &c.DeprecatedPods[0].Health[h]
for h := range Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health {
if Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h].Name == "never-ready" && Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h].Status == "DOWN" {
r = &Integration(t, ctx, ns, name)().Status.DeprecatedPods[0].Health[h]
}
}

Expand Down
34 changes: 17 additions & 17 deletions e2e/support/test_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@ func IntegrationStatusImage(t *testing.T, ctx context.Context, ns string, name s
}
}

func IntegrationCondition(t *testing.T, ctx context.Context, ns string, name string, conditionType v1.IntegrationConditionType) func() *v1.IntegrationCondition {
return func() *v1.IntegrationCondition {
func IntegrationCondition(t *testing.T, ctx context.Context, ns string, name string, conditionType v1.IntegrationConditionType) func() *metav1.Condition {
return func() *metav1.Condition {
it := Integration(t, ctx, ns, name)()
if it == nil {
return nil
Expand All @@ -602,14 +602,14 @@ func IntegrationCondition(t *testing.T, ctx context.Context, ns string, name str
}
}

func IntegrationConditionReason(c *v1.IntegrationCondition) string {
func IntegrationConditionReason(c *metav1.Condition) string {
if c == nil {
return ""
}
return c.Reason
}

func IntegrationConditionMessage(c *v1.IntegrationCondition) string {
func IntegrationConditionMessage(c *metav1.Condition) string {
if c == nil {
return ""
}
Expand All @@ -622,7 +622,7 @@ func IntegrationConditionStatus(t *testing.T, ctx context.Context, ns string, na
if c == nil {
return "Unknown"
}
return c.Status
return corev1.ConditionStatus(c.Status)
}
}

Expand Down Expand Up @@ -1034,8 +1034,8 @@ func PipeStatusReplicas(t *testing.T, ctx context.Context, ns string, name strin
}
}

func PipeCondition(t *testing.T, ctx context.Context, ns string, name string, conditionType v1.PipeConditionType) func() *v1.PipeCondition {
return func() *v1.PipeCondition {
func PipeCondition(t *testing.T, ctx context.Context, ns string, name string, conditionType v1.PipeConditionType) func() *metav1.Condition {
return func() *metav1.Condition {
kb := Pipe(t, ctx, ns, name)()
if kb == nil {
return nil
Expand All @@ -1048,21 +1048,21 @@ func PipeCondition(t *testing.T, ctx context.Context, ns string, name string, co
}
}

func PipeConditionStatusExtract(c *v1.PipeCondition) corev1.ConditionStatus {
func PipeConditionStatusExtract(c *metav1.Condition) corev1.ConditionStatus {
if c == nil {
return ""
}
return c.Status
return corev1.ConditionStatus(c.Status)
}

func PipeConditionReason(c *v1.PipeCondition) string {
func PipeConditionReason(c *metav1.Condition) string {
if c == nil {
return ""
}
return c.Reason
}

func PipeConditionMessage(c *v1.PipeCondition) string {
func PipeConditionMessage(c *metav1.Condition) string {
if c == nil {
return ""
}
Expand All @@ -1079,7 +1079,7 @@ func PipeConditionStatus(t *testing.T, ctx context.Context, ns string, name stri
if c == nil {
return "ConditionMissing"
}
return c.Status
return corev1.ConditionStatus(c.Status)
}
}

Expand Down Expand Up @@ -1569,8 +1569,8 @@ func BuildPhase(t *testing.T, ctx context.Context, ns, name string) func() v1.Bu
}
}

func BuildConditions(t *testing.T, ctx context.Context, ns, name string) func() []v1.BuildCondition {
return func() []v1.BuildCondition {
func BuildConditions(t *testing.T, ctx context.Context, ns, name string) func() []metav1.Condition {
return func() []metav1.Condition {
build := Build(t, ctx, ns, name)()
if build != nil && build.Status.Conditions != nil {
return build.Status.Conditions
Expand All @@ -1579,13 +1579,13 @@ func BuildConditions(t *testing.T, ctx context.Context, ns, name string) func()
}
}

func BuildCondition(t *testing.T, ctx context.Context, ns string, name string, conditionType v1.BuildConditionType) func() *v1.BuildCondition {
return func() *v1.BuildCondition {
func BuildCondition(t *testing.T, ctx context.Context, ns string, name string, conditionType v1.BuildConditionType) func() *metav1.Condition {
return func() *metav1.Condition {
build := Build(t, ctx, ns, name)()
if build != nil && build.Status.Conditions != nil {
return build.Status.GetCondition(conditionType)
}
return &v1.BuildCondition{}
return &metav1.Condition{}
}
}

Expand Down
Loading
Loading