You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2023/01/13 17:33:40 UTC

[GitHub] [camel-k] lburgazzoli opened a new pull request, #3977: feat: Render error message condition as json/structured message

lburgazzoli opened a new pull request, #3977:
URL: https://github.com/apache/camel-k/pull/3977

   <!-- Description -->
   
   
   
   
   <!--
   Enter your extended release note in the below block. If the PR requires
   additional action from users switching to the new release, include the string
   "action required". If no release note is required, write "NONE". 
   
   You can (optionally) mark this PR with labels "kind/bug" or "kind/feature" to make sure
   the text is added to the right section of the release notes. 
   -->
   
   **Release Note**
   ```release-note
   NONE
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by "astefanutti (via GitHub)" <gi...@apache.org>.
astefanutti commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1401541531

   > @astefanutti opened #4003 (it is actually made by 3 commits, I can squash them if needed)
   
   Awesome! Let's wait CI to pass for #4003, so we can merge it and have that one rebased on top.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "astefanutti (via GitHub)" <gi...@apache.org>.
astefanutti commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1084112088


##########
pkg/controller/integration/monitor.go:
##########
@@ -435,45 +442,100 @@ func (action *monitorAction) probeReadiness(
 		if container == nil {
 			return fmt.Errorf("integration container not found in Pod %s/%s", pod.Namespace, pod.Name)
 		}
+
+		readyCondition.Pods[i].Name = pod.Name
+
+		for p := range pod.Status.Conditions {
+			if pod.Status.Conditions[p].Type == corev1.PodReady {
+				readyCondition.Pods[i].Condition = pod.Status.Conditions[p]
+				break
+			}
+		}
 		if probe := container.ReadinessProbe; probe != nil && probe.HTTPGet != nil {
 			body, err := proxyGetHTTPProbe(ctx, action.client, probe, pod, container)
+
+			// When invoking the HTTp probe, the kubernetes client exposes a very

Review Comment:
   nit: `HTTp` -> `HTTP`



##########
script/gen_client_strimzi.sh:
##########
@@ -20,7 +20,7 @@ set -e
 location=$(dirname $0)
 rootdir=$location/..
 
-unset GOPATH
+#unset GOPATH

Review Comment:
   Can be removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1082589295


##########
script/Makefile:
##########
@@ -212,7 +212,8 @@ codegen-tools-install: controller-gen
 	@# We must force the installation to make sure we are using the correct version
 	@# Note: as there is no --version in the tools, we cannot rely on cached local versions
 	@echo "Installing k8s.io/code-generator tools with version $(CODEGEN_VERSION)"
-	go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
+	#go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
+	go install github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144-install

Review Comment:
   I think @astefanutti has prepared a pr to fix this upstream



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "astefanutti (via GitHub)" <gi...@apache.org>.
astefanutti commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083909224


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   Maybe -re-naming the field to `Readiness` or `Ready` would make it clear it's the ready condition from the Pod that's provided?



##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   Maybe re-naming the field to `Readiness` or `Ready` would make it clear it's the ready condition from the Pod that's provided?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083857904


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   As an alternative I can replace the struct with an custom one with the same fields and explicit copy of fields.
   Both are fine with me, @astefanutti @squakez cast your vote :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1383803908

   mh , looks like it did not help 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1383850078

   This is what I see:
   
   ```
   ➜ make generate
   Installing k8s.io/code-generator tools with version v0.25.2
   #go install k8s.io/code-generator/cmd/applyconfiguration-gen@v0.25.2
   go install github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144
   go: finding module for package k8s.io/code-generator/cmd/applyconfiguration-gen/generators
   go: finding module for package k8s.io/code-generator/cmd/applyconfiguration-gen/args
   go: found k8s.io/code-generator/cmd/applyconfiguration-gen/args in k8s.io/code-generator v0.26.0
   go: found k8s.io/code-generator/cmd/applyconfiguration-gen/generators in k8s.io/code-generator v0.26.0
   go install k8s.io/code-generator/cmd/client-gen@v0.25.2
   go install k8s.io/code-generator/cmd/lister-gen@v0.25.2
   go install k8s.io/code-generator/cmd/informer-gen@v0.25.2
   ./script/gen_client.sh
   Generating Go client code...
   F0116 11:45:08.040686   39309 main.go:51] Error: Failed executing generator: some packages had errors:
   template: /Users/luca-rh/.cache/go/pkg/mod/k8s.io/code-generator@v0.26.0/cmd/applyconfiguration-gen/generators/applyconfiguration.go:220:1:28: executing "/Users/luca-rh/.cache/go/pkg/mod/k8s.io/code-generator@v0.26.0/cmd/applyconfiguration-gen/generators/applyconfiguration.go:220" at <raw>: error calling raw: runtime error: invalid memory address or nil pointer dereference
   template: /Users/luca-rh/.cache/go/pkg/mod/k8s.io/code-generator@v0.26.0/cmd/applyconfiguration-gen/generators/applyconfiguration.go:220:1:28: executing "/Users/luca-rh/.cache/go/pkg/mod/k8s.io/code-generator@v0.26.0/cmd/applyconfiguration-gen/generators/applyconfiguration.go:220" at <raw>: error calling raw: runtime error: invalid memory address or nil pointer dereference
   ./script/gen_crd.sh
   ./script/gen_doc.sh
   Generating API documentation...
   Generating CRD API documentation...
   I0116 11:45:21.152511   39774 main.go:136] parsing go packages in directory github.com/apache/camel-k/pkg/apis/camel/v1
   I0116 11:45:24.586035   39774 main.go:240] using package=github.com/apache/camel-k/pkg/apis/camel/v1
   I0116 11:45:24.586054   39774 main.go:240] using package=github.com/apache/camel-k/pkg/apis/camel/v1/trait
   W0116 11:45:24.612611   39774 main.go:469] not found external link source for type encoding/xml.Name
   I0116 11:45:24.616375   39774 main.go:176] written to ./script/gen_crd/../../docs/modules/ROOT/partials/apis/camel-k-crds.adoc
   I0116 11:45:25.044803   39872 main.go:136] parsing go packages in directory github.com/apache/camel-k/pkg/apis/camel/v1alpha1
   I0116 11:45:28.453325   39872 main.go:240] using package=github.com/apache/camel-k/pkg/apis/camel/v1alpha1
   W0116 11:45:28.462888   39872 main.go:469] not found external link source for type encoding/json.Number
   W0116 11:45:28.462939   39872 main.go:469] not found external link source for type encoding/json.Number
   W0116 11:45:28.463025   39872 main.go:469] not found external link source for type encoding/json.Number
   I0116 11:45:28.464208   39872 main.go:176] written to ./script/gen_crd/../../docs/modules/ROOT/partials/apis/kamelets-crds.adoc
   Generating CRD API documentation... Done.
   Generating API documentation... done!
   Generating traits documentation...
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "astefanutti (via GitHub)" <gi...@apache.org>.
astefanutti commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083792275


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   I agree it's not ideal to have all these types duplicated. I've giving this another cycle, and it seems there is issues with both embedding and cross-referencing.
   
   @lburgazzoli I know I've been suggesting to embed `corev1.PodCondition`, but maybe it's not needed in the short term so we can look into those issues. WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083899273


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   done, please have a look at the latest commits (it is a little bit weird as there is a Pod nested field in the PodCondition  (if you have better names, please suggest)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
astefanutti commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1384143503

   Could you add `--input-dirs k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1` to the arguments passed to `applyconfiguration-gen` in `gen_client.sh`, as the changes to the Integration types import those packages, and regenerate the client packages?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
squakez commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1082701027


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   I think this is some issue with the autogen. We should not have kubernetes resources here I guess. @astefanutti fyi



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1401538823

   @astefanutti opened https://github.com/apache/camel-k/pull/4003 (it is actually made by 3 commits, I can squash them if needed)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
astefanutti commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1383880900

   @lburgazzoli Could you please try with:
   
   ```
   go install github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144-install
   ```
   
   I've done the required change in that new branch to overcome golang/go#50278, and tested it locally successfully.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1400393654

   Note, a number of tests are failing because of:
   
   ```  slim: Pulling from adoptopenjdk/openjdk11
     no matching manifest for linux/amd64 in the manifest list entries
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1084118691


##########
script/gen_client_strimzi.sh:
##########
@@ -20,7 +20,7 @@ set -e
 location=$(dirname $0)
 rootdir=$location/..
 
-unset GOPATH
+#unset GOPATH

Review Comment:
   done



##########
pkg/controller/integration/monitor.go:
##########
@@ -435,45 +442,100 @@ func (action *monitorAction) probeReadiness(
 		if container == nil {
 			return fmt.Errorf("integration container not found in Pod %s/%s", pod.Namespace, pod.Name)
 		}
+
+		readyCondition.Pods[i].Name = pod.Name
+
+		for p := range pod.Status.Conditions {
+			if pod.Status.Conditions[p].Type == corev1.PodReady {
+				readyCondition.Pods[i].Condition = pod.Status.Conditions[p]
+				break
+			}
+		}
 		if probe := container.ReadinessProbe; probe != nil && probe.HTTPGet != nil {
 			body, err := proxyGetHTTPProbe(ctx, action.client, probe, pod, container)
+
+			// When invoking the HTTp probe, the kubernetes client exposes a very

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083940478


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "astefanutti (via GitHub)" <gi...@apache.org>.
astefanutti commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083792275


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   I agree it's not ideal to have all these types duplicated. I've giving this another cycle, and it seems there are issues with both embedding and cross-referencing.
   
   @lburgazzoli I know I've been suggesting to embed `corev1.PodCondition`, but maybe it's not needed in the short term so we can look into those issues. WDYT?



##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   I agree it's not ideal to have all these types duplicated. I've giving this another cycle, and it seems there are issues with both embedding and cross-referencing.
   
   @lburgazzoli I know I've been suggesting to embed `corev1.PodCondition`, but maybe it's not needed in the short term, so we can look into those issues. WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1082588522


##########
e2e/global/common/traits/health_test.go:
##########
@@ -104,20 +106,190 @@ func TestHealthTrait(t *testing.T) {
 			//
 			Eventually(IntegrationCondition(ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(And(
 				WithTransform(IntegrationConditionReason, Equal(v1.IntegrationConditionRuntimeNotReadyReason)),
-				WithTransform(IntegrationConditionMessage, HavePrefix(
-					fmt.Sprintf(
-						"[Pod %s runtime is not ready: map[check.kind:READINESS route.id:route1 route.status:Stopped]",
-						pod.Name))),
-			))
+				WithTransform(IntegrationConditionMessage, Equal("1/1 pods are not ready"))))
+
+			Eventually(IntegrationCondition(ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(
+				Satisfy(func(c *v1.IntegrationCondition) bool {
+					if c.Status != corev1.ConditionFalse {
+						return false
+					}
+					if len(c.Pods) != 1 {
+						return false
+					}
+
+					var r *v1.HealthCheckResponse
+
+					for h := range c.Pods[0].Health {
+						if c.Pods[0].Health[h].Name == "camel-routes" {
+							r = &c.Pods[0].Health[h]
+						}
+					}
+
+					if r == nil {
+						return false
+					}
+
+					if r.Data == nil {
+						return false
+					}
+
+					var data map[string]interface{}
+					if err := json.Unmarshal(r.Data, &data); err != nil {
+						return false
+					}
+
+					return data["check.kind"].(string) == "READINESS" && data["route.status"].(string) == "Stopped"
+				}))
+
 			// Check the Integration is still in running phase

Review Comment:
   done



##########
pkg/apis/camel/v1/integration_types.go:
##########
@@ -262,6 +262,8 @@ type IntegrationCondition struct {
 	Reason string `json:"reason,omitempty"`
 	// A human-readable message indicating details about the transition.
 	Message string `json:"message,omitempty"`
+	// TODO: add documentation

Review Comment:
   done



##########
pkg/apis/camel/v1alpha1/kamelet_binding_types.go:
##########
@@ -120,6 +120,8 @@ type KameletBindingCondition struct {
 	Reason string `json:"reason,omitempty"`
 	// A human readable message indicating details about the transition.
 	Message string `json:"message,omitempty"`
+	// TODO: add documentation

Review Comment:
   done



##########
script/gen_client.sh:
##########
@@ -26,7 +26,7 @@ cd $location/../pkg/client/camel
 echo "Generating Go client code..."
 
 $(go env GOPATH)/bin/applyconfiguration-gen \
-	--input-dirs=github.com/apache/camel-k/pkg/apis/camel/v1,github.com/apache/camel-k/pkg/apis/camel/v1alpha1 \
+	--input-dirs=github.com/apache/camel-k/pkg/apis/camel/v1,github.com/apache/camel-k/pkg/apis/camel/v1alpha1i,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1 \

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by "astefanutti (via GitHub)" <gi...@apache.org>.
astefanutti commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1401529498

   > @squakez @astefanutti anything missing or ok to merge ?
   
   I'd be inclined to have the change to temurin as default base image (131915bccd32b625adabc543be4b7298b5694b2a) done in a separate PR to make it more visible in the release note and ease backport. Other than that, it's good to go 👍🏼.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1383894279

   Seems to break some other stuffs
   
   ```
   go test ./...
   # github.com/apache/camel-k/pkg/client/camel/applyconfiguration/camel/v1
   pkg/client/camel/applyconfiguration/camel/v1/podcondition.go:45:11: cannot use &value (value of type *"k8s.io/api/core/v1".PodConditionType) as type "k8s.io/api/core/v1".PodConditionType in assignment
   pkg/client/camel/applyconfiguration/camel/v1/podcondition.go:53:13: cannot use &value (value of type *"k8s.io/api/core/v1".ConditionStatus) as type "k8s.io/api/core/v1".ConditionStatus in assignment
   pkg/client/camel/applyconfiguration/camel/v1/podcondition.go:61:20: cannot use &value (value of type *"k8s.io/apimachinery/pkg/apis/meta/v1".Time) as type "k8s.io/apimachinery/pkg/apis/meta/v1".Time in assignment
   pkg/client/camel/applyconfiguration/camel/v1/podcondition.go:69:25: cannot use &value (value of type *"k8s.io/apimachinery/pkg/apis/meta/v1".Time) as type "k8s.io/apimachinery/pkg/apis/meta/v1".Time in assignment
   pkg/client/camel/applyconfiguration/camel/v1/podcondition.go:77:13: cannot use &value (value of type *string) as type string in assignment
   pkg/client/camel/applyconfiguration/camel/v1/podcondition.go:85:14: cannot use &value (value of type *string) as type string in assignment
   ```
   
   And lints:
   
   ```
   addons/master/master.go:98:65                                     typecheck      t.Client undefined (type *masterTrait has no field or method Client)
   addons/master/master.go:232:45                                    typecheck      t.Client undefined (type *masterTrait has no field or method Client)
   addons/resume/resume.go:88:75                                     typecheck      r.Client undefined (type *resumeTrait has no field or method Client)
   pkg/controller/build/build_controller.go:165:5                    typecheck      a.InjectClient undefined (type Action has no field or method InjectClient)
   pkg/controller/build/build_controller.go:167:5                    typecheck      a.InjectRecorder undefined (type Action has no field or method InjectRecorder)
   pkg/controller/integrationkit/integrationkit_controller.go:263:5  typecheck      a.InjectClient undefined (type Action has no field or method InjectClient)
   pkg/controller/kamelet/kamelet_controller.go:159:5                typecheck      a.InjectClient undefined (type Action has no field or method InjectClient)
   addons/tracing/tracing.go:94:52                                   typecheck      t.Client undefined (type *tracingTrait has no field or method Client)
   addons/tracing/tracing.go:99:8                                    typecheck      t.L undefined (type *tracingTrait has no field or method L)
   pkg/cmd/root.go:231:24                                            typecheck      invalid operation: cannot compare command._client != nil (operator != not defined on untyped nil)
   pkg/controller/integrationplatform/create_test.go:50:4            typecheck      h.InjectClient undefined (type Action has no field or method InjectClient)
   pkg/controller/integrationplatform/initialize_test.go:50:4        typecheck      h.InjectClient undefined (type Action has no field or method InjectClient)
   pkg/controller/integrationplatform/initialize_test.go:80:4        typecheck      h.InjectClient undefined (type Action has no field or method InjectClient)
   pkg/metadata/metadata_capabilities_test.go:50:8                   typecheck      meta.Dependencies undefined (type IntegrationMetadata has no field or method Dependencies)
   pkg/metadata/metadata_capabilities_test.go:57:8                   typecheck      meta.RequiredCapabilities undefined (type IntegrationMetadata has no field or method RequiredCapabilities)
   pkg/metadata/metadata_dependencies_test.go:62:8                   typecheck      meta.Dependencies undefined (type IntegrationMetadata has no field or method Dependencies)
   pkg/metadata/metadata_dependencies_test.go:95:8                   typecheck      meta.Dependencies undefined (type IntegrationMetadata has no field or method Dependencies)
   pkg/metadata/metadata_dependencies_test.go:219:22                 typecheck      meta.RequiredCapabilities undefined (type IntegrationMetadata has no field or method RequiredCapabilities)
   pkg/metadata/metadata_dependencies_test.go:376:22                 typecheck      meta.RequiredCapabilities undefined (type IntegrationMetadata has no field or method RequiredCapabilities)
   pkg/metadata/metadata_http_test.go:48:22                          typecheck      meta.ExposesHTTPServices undefined (type IntegrationMetadata has no field or method ExposesHTTPServices)
   pkg/metadata/metadata_http_test.go:49:23                          typecheck      meta.PassiveEndpoints undefined (type IntegrationMetadata has no field or method PassiveEndpoints)
   pkg/metadata/metadata_http_test.go:73:22                          typecheck      meta.ExposesHTTPServices undefined (type IntegrationMetadata has no field or method ExposesHTTPServices)
   pkg/metadata/metadata_http_test.go:74:22                          typecheck      meta.PassiveEndpoints undefined (type IntegrationMetadata has no field or method PassiveEndpoints)
   pkg/metadata/metadata_http_test.go:95:22                          typecheck      meta.ExposesHTTPServices undefined (type IntegrationMetadata has no field or method ExposesHTTPServices)
   pkg/metadata/metadata_http_test.go:96:22                          typecheck      meta.PassiveEndpoints undefined (type IntegrationMetadata has no field or method PassiveEndpoints)
   pkg/metadata/metadata_uri_test.go:56:30                           typecheck      metadata.FromURIs undefined (type IntegrationMetadata has no field or method FromURIs)
   pkg/metadata/metadata_uri_test.go:57:25                           typecheck      metadata.FromURIs undefined (type IntegrationMetadata has no field or method FromURIs)
   pkg/metadata/metadata_uri_test.go:58:30                           typecheck      metadata.ToURIs undefined (type IntegrationMetadata has no field or method ToURIs)
   pkg/metadata/metadata_uri_test.go:59:25                           typecheck      metadata.ToURIs undefined (type IntegrationMetadata has no field or method ToURIs)
   pkg/metadata/metadata_uri_test.go:94:30                           typecheck      metadata.FromURIs undefined (type IntegrationMetadata has no field or method FromURIs)
   pkg/metadata/metadata_uri_test.go:96:30                           typecheck      metadata.ToURIs undefined (type IntegrationMetadata has no field or method ToURIs)
   pkg/trait/pull_secret.go:74:19                                    typecheck      invalid operation: cannot compare t.Client != nil (operator != not defined on untyped nil)
   pkg/trait/trait_catalog.go:59:6                                   typecheck      t.InjectClient undefined (type Trait has no field or method InjectClient)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1382842890

   @astefanutti I'm experiencing some issues as part of the ci build:
   
   ```
   cd pkg/client/camel && go test ./...
   # github.com/apache/camel-k/pkg/client/camel/applyconfiguration
   Error: applyconfiguration/utils.go:82:19: undefined: v1.HealthCheckResponseApplyConfiguration
   Error: applyconfiguration/utils.go:126:19: undefined: v1.PodConditionApplyConfiguration
   ```
   
   What is the proper way to generate the client & apply config ? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
astefanutti commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1383705124

   > @astefanutti I'm experiencing some issues as part of the ci build:
   > 
   > ```
   > cd pkg/client/camel && go test ./...
   > # github.com/apache/camel-k/pkg/client/camel/applyconfiguration
   > Error: applyconfiguration/utils.go:82:19: undefined: v1.HealthCheckResponseApplyConfiguration
   > Error: applyconfiguration/utils.go:126:19: undefined: v1.PodConditionApplyConfiguration
   > ```
   > 
   > What is the proper way to generate the client & apply config ?
   
   Could you please try generating the client locally by replacing `applyconfiguration-gen` in the `codegen-tools-install` target of the Makefile with:
   
   ```
   go install github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144
   ```
   
   That should generate the missing types.
   
   This is a temporary "glitch" as a fix is required in code-generator, which will go away as soon as it lands upstream.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "astefanutti (via GitHub)" <gi...@apache.org>.
astefanutti commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083789075


##########
script/Makefile:
##########
@@ -212,7 +212,8 @@ codegen-tools-install: controller-gen
 	@# We must force the installation to make sure we are using the correct version
 	@# Note: as there is no --version in the tools, we cannot rely on cached local versions
 	@echo "Installing k8s.io/code-generator tools with version $(CODEGEN_VERSION)"
-	go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
+	#go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
+	go install github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144-install

Review Comment:
   The fix upstream kubernetes/kubernetes#114920 will be picked up once we upgrade our dependency on code-generator.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "astefanutti (via GitHub)" <gi...@apache.org>.
astefanutti commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083872955


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   One alternative that seems to work is to not inline the `corev1.PodCondition`, i.e. adding a field, and remove `metav1` and `corev1` from the code-generator input dirs. That way the API still has the corresponding info, but the generated apply configurations do no contain any duplicate, and instead refer to the API rather than the apply configurations, which is acceptable IMO.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
squakez commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1398432246

   > @astefanutti @squakez @tadayosi @claudio4j it lacks a test for integration that are scaled > 1, let me know if the test should be part of this pr or can wait for a second iteration.
   
   Feel free to track it in a follow up issue and work it later.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1082588838


##########
script/gen_client.sh:
##########
@@ -17,7 +17,7 @@
 
 location=$(dirname $0)
 
-unset GOPATH
+#unset GOPATH

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1401461079

   @squakez @astefanutti anything missing or ok to merge ? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] astefanutti commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
astefanutti commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1383819662

   > mh , looks like it did not help
   
   Hum, hasn't `make generate` created the new types in the `pkg/client/camel/applyconfiguration` Let me try on my side...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
squakez commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1082551286


##########
e2e/global/common/traits/health_test.go:
##########
@@ -104,20 +106,190 @@ func TestHealthTrait(t *testing.T) {
 			//
 			Eventually(IntegrationCondition(ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(And(
 				WithTransform(IntegrationConditionReason, Equal(v1.IntegrationConditionRuntimeNotReadyReason)),
-				WithTransform(IntegrationConditionMessage, HavePrefix(
-					fmt.Sprintf(
-						"[Pod %s runtime is not ready: map[check.kind:READINESS route.id:route1 route.status:Stopped]",
-						pod.Name))),
-			))
+				WithTransform(IntegrationConditionMessage, Equal("1/1 pods are not ready"))))
+
+			Eventually(IntegrationCondition(ns, name, v1.IntegrationConditionReady), TestTimeoutLong).Should(
+				Satisfy(func(c *v1.IntegrationCondition) bool {
+					if c.Status != corev1.ConditionFalse {
+						return false
+					}
+					if len(c.Pods) != 1 {
+						return false
+					}
+
+					var r *v1.HealthCheckResponse
+
+					for h := range c.Pods[0].Health {
+						if c.Pods[0].Health[h].Name == "camel-routes" {
+							r = &c.Pods[0].Health[h]
+						}
+					}
+
+					if r == nil {
+						return false
+					}
+
+					if r.Data == nil {
+						return false
+					}
+
+					var data map[string]interface{}
+					if err := json.Unmarshal(r.Data, &data); err != nil {
+						return false
+					}
+
+					return data["check.kind"].(string) == "READINESS" && data["route.status"].(string) == "Stopped"
+				}))
+
 			// Check the Integration is still in running phase

Review Comment:
   Misleading comment. According to the statement below, it should be in error phase.



##########
pkg/apis/camel/v1/integration_types.go:
##########
@@ -262,6 +262,8 @@ type IntegrationCondition struct {
 	Reason string `json:"reason,omitempty"`
 	// A human-readable message indicating details about the transition.
 	Message string `json:"message,omitempty"`
+	// TODO: add documentation

Review Comment:
   Nitpick... you know otherwise nobody will ever bother to fix it :)



##########
pkg/apis/camel/v1alpha1/kamelet_binding_types.go:
##########
@@ -120,6 +120,8 @@ type KameletBindingCondition struct {
 	Reason string `json:"reason,omitempty"`
 	// A human readable message indicating details about the transition.
 	Message string `json:"message,omitempty"`
+	// TODO: add documentation

Review Comment:
   Ditto



##########
script/gen_client.sh:
##########
@@ -17,7 +17,7 @@
 
 location=$(dirname $0)
 
-unset GOPATH
+#unset GOPATH

Review Comment:
   If it not required, we better remove even the comment IMO



##########
script/gen_client.sh:
##########
@@ -26,7 +26,7 @@ cd $location/../pkg/client/camel
 echo "Generating Go client code..."
 
 $(go env GOPATH)/bin/applyconfiguration-gen \
-	--input-dirs=github.com/apache/camel-k/pkg/apis/camel/v1,github.com/apache/camel-k/pkg/apis/camel/v1alpha1 \
+	--input-dirs=github.com/apache/camel-k/pkg/apis/camel/v1,github.com/apache/camel-k/pkg/apis/camel/v1alpha1i,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1 \

Review Comment:
   is `v1alpha1i` what we really need?



##########
script/Makefile:
##########
@@ -212,7 +212,8 @@ codegen-tools-install: controller-gen
 	@# We must force the installation to make sure we are using the correct version
 	@# Note: as there is no --version in the tools, we cannot rely on cached local versions
 	@echo "Installing k8s.io/code-generator tools with version $(CODEGEN_VERSION)"
-	go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
+	#go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
+	go install github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144-install

Review Comment:
   Do we already have a PR opened with those changes? My concern is that once we bump `CODEGEN_VERSION` we won't be aligned and potentially screw up things.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1398430359

   @astefanutti @squakez @tadayosi @claudio4j it lacks a test for integration that are scaled > 1, let me know if the test should be part of this pr or can wait for a second iteration.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1398452397

   > > @astefanutti @squakez @tadayosi @claudio4j it lacks a test for integration that are scaled > 1, let me know if the test should be part of this pr or can wait for a second iteration.
   > 
   > Feel free to track it in a follow up issue and work it later.
   
   https://github.com/apache/camel-k/issues/3997


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by GitBox <gi...@apache.org>.
squakez commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1082608404


##########
script/Makefile:
##########
@@ -212,7 +212,8 @@ codegen-tools-install: controller-gen
 	@# We must force the installation to make sure we are using the correct version
 	@# Note: as there is no --version in the tools, we cannot rely on cached local versions
 	@echo "Installing k8s.io/code-generator tools with version $(CODEGEN_VERSION)"
-	go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
+	#go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
+	go install github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144-install

Review Comment:
   Okey, please, let's track and make sure to follow up it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083860262


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   If we don't have all those bunch of duplicated types it would be more maintainable, so, I'd prefer that option.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on a diff in pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1083875470


##########
pkg/client/camel/applyconfiguration/core/v1/affinity.go:
##########
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use
+// with apply.
+type AffinityApplyConfiguration struct {

Review Comment:
   ok, will try that



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli commented on pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#issuecomment-1401533322

   let see if I can work on something
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] lburgazzoli merged pull request #3977: feat: Render error message condition as json/structured message

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli merged PR #3977:
URL: https://github.com/apache/camel-k/pull/3977


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org