operator-framework / ansible-operator-plugins

Experimental extraction/refactoring of the Operator SDK's ansible operator plugin
Apache License 2.0
9 stars 20 forks source link

Cross Platform docker-buildx target does not work #48

Closed rooftopcellist closed 8 months ago

rooftopcellist commented 8 months ago

Bug Report

Currently, there are two separate issues with the make docker-buildx target in the Makefile that the ansible-operator-sdk lays down.

Problem 1

The test target does not exist, so it immediately fails because of this.

Problem 2 The sed command to add a line to a temporary Dockerfile.cross file for specifying BUILDPLATFORM is not needed, and actually causes issues. See this comment for more details:

I think that the diff here should be added to the examples in the ansible-operator-plugins repo.

Please let me know your thoughts, I'm happy to chat more!


What did you expect to see?

The make docker-buildx command fails immediately because the test target does not exist.

Additionally, once this part is fixed, the arches specified in the PLATFORMS env variable are not honored.

What did you see instead? Under which circumstances?

[chadams@awx eda-server-operator]$ PLATFORM=linux/arm64 make docker-buildx
make: *** No rule to make target 'test', needed by 'docker-buildx'.  Stop.

Environment

Operator type:

Ansible Operatore

Kubernetes cluster type:

Any

$ operator-sdk version

$ operator-sdk version operator-sdk version: "v1.22.0", commit: "9e95050a94577d1f4ecbaeb6c2755a9d2c231289", kubernetes version: "1.24.1", go version: "go1.18.3", GOOS: "linux", GOARCH: "amd64"

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"26+", GitVersion:"v1.26.7-dispatcher", GitCommit:"ae4b8e29ab9af72b4099cf8f5c6e768526c37da3", GitTreeState:"clean", BuildDate:"2023-07-26T00:32:42Z", GoVersion:"go1.20.6", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7

Possible Solution

Described above

Additional context

Context in this PR for the EDA Server Operator:

openshift-ci[bot] commented 8 months ago

@rooftopcellist: The label(s) language/ansible cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/operator-framework/ansible-operator-plugins/issues/48): >## Bug Report > >Currently, there are two separate issues with the `make docker-buildx` target in the Makefile that the ansible-operator-sdk lays down. > >**Problem 1** > >The [`test` target](https://github.com/operator-framework/ansible-operator-plugins/blob/main/testdata/memcached-molecule-operator/Makefile#L48) does not exist, so it immediately fails because of this. > >**Problem 2** >The sed command to add a line to a temporary Dockerfile.cross file for specifying TARGETPLATFORM is not needed, and actually causes issues. See this comment for more details: >* https://github.com/ansible/eda-server-operator/pull/158#issuecomment-1880087800 > >I think that the diff here should be added to the examples in the ansible-operator-plugins repo. >* https://github.com/ansible/eda-server-operator/pull/158/diff > >Please let me know your thoughts, I'm happy to chat more! > >#### What did you do? > > > >#### What did you expect to see? > >The make docker-buildx command fails immediately because the `test` target does not exist. > >Additionally, once this part is fixed, the arches specified in the PLATFORMS env variable are not honored. > >#### What did you see instead? Under which circumstances? > >``` >[chadams@awx eda-server-operator]$ PLATFORM=linux/arm64 make docker-buildx >make: *** No rule to make target 'test', needed by 'docker-buildx'. Stop. >``` > >#### Environment > >**Operator type:** > > > >/language ansible > >**Kubernetes cluster type:** > >Any. > >`$ operator-sdk version` > >$ operator-sdk version >operator-sdk version: "v1.22.0", commit: "9e95050a94577d1f4ecbaeb6c2755a9d2c231289", kubernetes version: "1.24.1", go version: "go1.18.3", GOOS: "linux", GOARCH: "amd64" > > > >`$ kubectl version` > >``` >Client Version: version.Info{Major:"1", Minor:"26+", GitVersion:"v1.26.7-dispatcher", GitCommit:"ae4b8e29ab9af72b4099cf8f5c6e768526c37da3", GitTreeState:"clean", BuildDate:"2023-07-26T00:32:42Z", GoVersion:"go1.20.6", Compiler:"gc", Platform:"linux/amd64"} >Kustomize Version: v4.5.7 >``` > >#### Possible Solution > >Described above > >#### Additional context > >Context in this PR for the EDA Server Operator: >* PR: https://github.com/ansible/eda-server-operator/pull/158 > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
everettraven commented 8 months ago

Thanks for creating this issue @rooftopcellist ! Would you be interested in creating a PR with the fix?

rooftopcellist commented 8 months ago

Sure thing, here's the PR @everettraven