-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
CRD system for OpenShift resources not interpreted as expected #1531
Comments
@mjovanovic0 The is linked to the fact that JMP is invoked instead of StrategicMergePatch. Have a look at #1510 #1510. |
@mjovanovic0: Have a look at that environment; CRDRegister By using the kustomize v3 external go plugin, you can kind of solve your issue kustomize build overlay/ --enable_alpha_plugins apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
labels:
app: app
name: test-image-name
namespace: test-namespace-name
spec:
lookupPolicy:
local: false
tags:
- from:
kind: DockerImage
name: docker.io/hello-world
name: image-name
referencePolicy:
type: Source We will most likely have to write to KEP to do that efficiently |
I'm having trouble compile-ing
Are you able to instruct what I need to do to compile it properly? |
@mjovanovic0 Thanks, one more section to put in the KEP: How to compile a plugin which go module dependencies are overlapping with the default kustomize modules I just realized that if I try to build outside my GOPATH, it is does not work for me either, and I have the same issue that you listed. But if you build from your GOPATH as described bellow, it seems to work: myuserid@airship:~$ echo $GOPATH
/home/myuserid
myuserid@airship:~$ cd src
myuserid@airship:~/src$ cd sigs.k8s.io/
myuserid@airship:~/src/sigs.k8s.io$ git clone -b armadacrd https://github.com/keleustes/kustomize
Cloning into 'kustomize'...
remote: Enumerating objects: 439, done.
remote: Counting objects: 100% (439/439), done.
remote: Compressing objects: 100% (217/217), done.
remote: Total 25845 (delta 255), reused 373 (delta 214), pack-reused 25406
Receiving objects: 100% (25845/25845), 25.59 MiB | 1.67 MiB/s, done.
Resolving deltas: 100% (12726/12726), done.
Checking connectivity... done.
myuserid@airship:~/src/sigs.k8s.io$ cd kustomize myuserid@airship:~/src/sigs.k8s.io/kustomize$ make install build-plugins
go install /home/myuserid/src/sigs.k8s.io/kustomize/cmd/kustomize
./plugin/buildPlugins.sh /home/myuserid
Generating linkable plugins...
plugin/armada.airshipit.org/v1alpha1/armadacrdregister/ArmadaCRDRegister
plugin/rollouts.argoproj.io/v1alpha1/rolloutcrdregister/RolloutCRDRegister
plugin/api.openshift.io/v1/openshiftcrdregister/OpenShiftCRDRegister
plugin/argo.argoproj.io/v1alpha1/workflowcrdregister/WorkflowCRDRegister
plugin/networking.istio.io/v1alpha3/networkingcrdregister/NetworkingCRDRegister
All done. myuserid@airship:~/src/sigs.k8s.io/kustomize$ cd examples/crds/openshift-api/
myuserid@airship:~/src/sigs.k8s.io/kustomize/examples/crds/openshift-api$ which kustomize
/home/myuserid/bin/kustomize
myuserid@airship:~/src/sigs.k8s.io/kustomize/examples/crds/openshift-api$ ls -lt /home/myuserid/.config/kustomize/plugin/
total 20
drwxr-xr-x 3 myuserid alemax 4096 Sep 14 11:39 networking.istio.io
drwxr-xr-x 3 myuserid alemax 4096 Sep 14 11:39 argo.argoproj.io
drwxr-xr-x 3 myuserid alemax 4096 Sep 14 11:39 api.openshift.io
drwxr-xr-x 3 myuserid alemax 4096 Sep 14 11:39 rollouts.argoproj.io
drwxr-xr-x 3 myuserid alemax 4096 Sep 14 11:39 armada.airshipit.org myuserid@airship:~/src/sigs.k8s.io/kustomize/examples/crds/openshift-api$ kustomize build overlay/ --enable_alpha_plugins
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
labels:
app: app
name: test-image-name
namespace: test-namespace-name
spec:
lookupPolicy:
local: false
tags:
- from:
kind: DockerImage
name: docker.io/hello-world
name: image-name
referencePolicy:
type: Source |
Awesome man. Thank you very much :) |
Hi all,
I have the following structure:
├── base │ ├── 001-image-stream.yaml │ ├── crd │ │ ├── imagestream.json │ └── kustomization.yaml └── test ├── 001-image-stream.yaml └── kustomization.yaml
base/001-image-stream.yaml:
base/kustomization.yaml:
test/001-image-stream.yaml:
base/kustomization.yaml:
base/crd/imagestream.json: (Extracted and coverted parts from OpenShift Swagger API)
And when I execute:
kustomize build test
This is output:
While expected output is:
Now if I understand CRD mechanism in Kustomize, for him to know how to merge in CRD definitions needs to be annotations:
"x-kubernetes-patch-merge-key": "tag"
"x-kubernetes-patch-strategy": "merge"
Which are defined in
imagestream.json
CRD.Can someone say me what I'm doing wrong or if this is not supported or is it a bug?
Thanks
The text was updated successfully, but these errors were encountered: