Skip to content

Commit

Permalink
fix(ctrl): unsupported API message change
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Aug 31, 2023
1 parent 330c53f commit 6a1238b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions e2e/knative/kamelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func TestKameletChange(t *testing.T) {
Expect(CreateKnativeChannel(ns, knChannel)()).To(Succeed())
// Consumer route that will read from the KNative channel
Expect(KamelRunWithID(operatorID, ns, "files/test-kamelet-display.groovy", "-w").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "test-kamelet-display")).Should(Equal(corev1.PodRunning))

// Create the Pipe
Expect(KamelBindWithID(operatorID, ns,
Expand All @@ -58,9 +59,9 @@ func TestKameletChange(t *testing.T) {
"--annotation", "trait.camel.apache.org/health.readiness-initial-delay=10",
"--name", timerPipe,
).Execute()).To(Succeed())

Eventually(IntegrationPodPhase(ns, timerPipe), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationPodPhase(ns, timerPipe)).Should(Equal(corev1.PodRunning))
Eventually(IntegrationConditionStatus(ns, timerPipe, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
// Consume the message
Eventually(IntegrationLogs(ns, "test-kamelet-display"), TestTimeoutShort).Should(ContainSubstring("HelloKNative!"))

Eventually(PipeCondition(ns, timerPipe, v1.PipeConditionReady), TestTimeoutMedium).Should(And(
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/kubernetes/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ import "strings"
// IsUnknownAPIError checks if the given error is due to some missing APIs in the cluster.
// Apparently there's no such method in Kubernetes Go API.
func IsUnknownAPIError(err error) bool {
return err != nil && strings.HasPrefix(err.Error(), "no matches for kind")
return err != nil && (strings.HasPrefix(err.Error(), "no matches for kind") || strings.HasPrefix(err.Error(), "failed to get API group resources"))
}

0 comments on commit 6a1238b

Please sign in to comment.