mertdotcc opened a new issue, #4175:
URL: https://github.com/apache/camel-k/issues/4175

   I am working on [#4146](https://github.com/apache/camel-k/issues/4146) and 
when I run `make generate` to build my CRDs and all other auto-generated files, 
I get the following output:
   ```
   go install sigs.k8s.io/controller-tools/cmd/[email protected]
   Installing k8s.io/code-generator tools with version v0.25.6
   #go install k8s.io/code-generator/cmd/[email protected]
   go install 
github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144-install
   go install k8s.io/code-generator/cmd/[email protected]
   go install k8s.io/code-generator/cmd/[email protected]
   go install k8s.io/code-generator/cmd/[email protected]
   ./script/gen_client.sh
   Generating Go client code...
   ./script/gen_crd.sh
   sed: 1: "/creationTimestamp:/a\  ...": extra characters after \ at the end 
of a command
   make: *** [generate] Error 1
   ```
   
   When I look at the auto-generated files, I notice this:
   <img width="1485" alt="image" 
src="https://user-images.githubusercontent.com/41954671/228136974-1b8579c6-e53d-4e45-92ee-a4018459b3bf.png";>
   - It doesn't include the comments regarding the license
   - It adds the unnecessary `---`
   - `creationTimestamp` colored-out, not sure what that means
   - `labels` not included
   
   I change the following code in `gen_crd.sh`
   ```
     sed -n '/^---/,/^status/p;/^status/q' "${source}.orig" \
       | sed '1d;$d' \
       | sed '/creationTimestamp:/a\  labels:\n    app: camel-k' >> "$source"
   ```
   to the following one-liner:
   ```
   sed -n '/^---/,/^status/p;/^status/q' "${source}.orig" '1d;$d' 
'/creationTimestamp:/a\ labels:\n app: camel-k' >> "$source"
   ```
   
   Which helps with the issue I face when running `make generate`. The output 
with the one-liner change:
   ```
   go install sigs.k8s.io/controller-tools/cmd/[email protected]
   Installing k8s.io/code-generator tools with version v0.25.6
   #go install k8s.io/code-generator/cmd/[email protected]
   go install 
github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144-install
   go install k8s.io/code-generator/cmd/[email protected]
   go install k8s.io/code-generator/cmd/[email protected]
   go install k8s.io/code-generator/cmd/[email protected]
   ./script/gen_client.sh
   Generating Go client code...
   ./script/gen_crd.sh
   ./script/gen_doc.sh
   Generating API documentation...
   Generating CRD API documentation...
   I0328 07:35:37.555490   33758 main.go:136] parsing go packages in directory 
github.com/apache/camel-k/v2/pkg/apis/camel/v1
   I0328 07:35:39.506643   33758 main.go:240] using 
package=github.com/apache/camel-k/v2/pkg/apis/camel/v1
   I0328 07:35:39.506666   33758 main.go:240] using 
package=github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait
   W0328 07:35:39.525619   33758 main.go:469] not found external link source 
for type encoding/xml.Name
   I0328 07:35:39.529658   33758 main.go:176] written to 
./script/gen_crd/../../docs/modules/ROOT/partials/apis/camel-k-crds.adoc
   I0328 07:35:40.300064   33850 main.go:136] parsing go packages in directory 
github.com/apache/camel-k/v2/pkg/apis/camel/v1alpha1
   I0328 07:35:42.243031   33850 main.go:240] using 
package=github.com/apache/camel-k/v2/pkg/apis/camel/v1alpha1
   W0328 07:35:42.255036   33850 main.go:469] not found external link source 
for type encoding/json.Number
   W0328 07:35:42.255111   33850 main.go:469] not found external link source 
for type encoding/json.Number
   W0328 07:35:42.255200   33850 main.go:469] not found external link source 
for type encoding/json.Number
   W0328 07:35:42.255542   33850 main.go:469] not found external link source 
for type github.com/apache/camel-k/v2/pkg/apis/camel/v1.PodCondition
   W0328 07:35:42.255616   33850 main.go:469] not found external link source 
for type github.com/apache/camel-k/v2/pkg/apis/camel/v1.IntegrationSpec
   W0328 07:35:42.256015   33850 main.go:469] not found external link source 
for type github.com/apache/camel-k/v2/pkg/apis/camel/v1.SourceSpec
   I0328 07:35:42.256471   33850 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...
   Generating traits documentation... done!
   cd pkg/apis/camel && /Users/mert/go/bin/controller-gen paths="./..." object
   cd addons/keda/duck && /Users/mert/go/bin/controller-gen paths="./..." object
   cd addons/strimzi/duck && /Users/mert/go/bin/controller-gen paths="./..." 
object
   ./script/gen_client_strimzi.sh
   Generating Go client code for Strimzi addon...
   ```
   
   So it seems to work. No errors at least. But when I look at the 
auto-generated files, they are still not 100% correctly generated.
   <img width="1480" alt="image" 
src="https://user-images.githubusercontent.com/41954671/228138920-619e1a74-a484-42d4-93c5-f7dd461eab59.png";>
   Still, the `labels` is missing.
   
   Any idea why? Any Mac users who are able to run the Makefile scripts with no 
issues? If so, did you do any Mac-specific configurations?
   
   Many thanks in advance!


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to