`kpt` functions do not work on M1 Mac
Expected behavior
kpt fn eval -i list-setters:v0.1.0 to list all setters in directory tree
Actual behavior
[RUNNING] "gcr.io/kpt-fn/apply-setters:v0.2.0"
[PASS] "gcr.io/kpt-fn/apply-setters:v0.2.0" in 1.2s
Results:
[info] spec.template.spec.containers[1].env[3].value: set field value to "cluster-name-test"
Stderr:
"WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested"
Information
kpt version v1.0.0-beta.13
Steps to reproduce the behavior
Try to run any kpt function on an M1 Mac
@mengqiy @yuwenma we are seeing an increase of issues reported for supporting Mac M1. I think we should be able to compile our Go based functions easily for linux/arm target, but I wonder what is idiomatic way to support the container images across different platforms.
Per @Pitta - looks like there is a flag that can be passed to the Docker runtime to make it execute the amd64 images on arm64
https://docs.docker.com/desktop/mac/apple-silicon/
Detailed here. And i tested this flag manually for running containers on amd64 machine with the flag --platform linux/amd64 and it ran fine.
I suspect if this is added to the call for docker run, it would solve this until native images are baked in the CI.
(a native arm compiles binary would be nice too, not a show stopper like the function container architecture)
I also want to note - this will only get worse if not addressed. Apple doesnt sell intel macs anymore. Multi architecture is the new normal.
Per https://www.docker.com/blog/multi-platform-docker-builds/, tt seems we can do multi-platform build using buildx and docker manifest.
To support that we need to make change to our release pipeline.
Proposal and tradeoffs: https://github.com/GoogleContainerTools/kpt/pull/2938
Hi I'm still having the same error when running the kubeval example.
kpt fn eval kubeval-imperative --image gcr.io/kpt-fn/kubeval:v0.3.0 --results-dir /tmp -- strict=true skip_kinds=MyCustom,MyOtherCustom
[RUNNING] "gcr.io/kpt-fn/kubeval:v0.3.0"
[FAIL] "gcr.io/kpt-fn/kubeval:v0.3.0" in 16s
Results:
[error] v1/ReplicationController/bob templates: Additional property templates is not allowed
[error] v1/ReplicationController/bob spec.replicas: Invalid type. Expected: [integer,null], given: string
Stderr:
"WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested"
Do I need to set anything to make this work?