Skip to content
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

Minor tweaks to addon-resizer Makefile to enable automatic builds #7634

Conversation

raywainman
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Automatic builds are broken:

docker buildx inspect img-builder > /dev/null || docker buildx create --name img-builder --use
ERROR: no builder "img-builder" found
img-builder
cp -r * /tmp/tmp.LlaJKl
cd /tmp/tmp.LlaJKl && sed -i 's|BASEIMAGE|gcr.io/distroless/static:latest|g' Dockerfile
docker run --rm -it -v /tmp/tmp.LlaJKl:/tmp/tmp.LlaJKl:Z -v `pwd`:/go/src/k8s.io/autoscaler/addon-resizer/:Z \
        golang:1.22 \
        /bin/bash -c "\
            cd /go/src/k8s.io/autoscaler/addon-resizer/ && \
            CGO_ENABLED=0 GOARM=7 GOARCH=amd64 go build -a -installsuffix cgo --ldflags '-w -X k8s.io/autoscaler/addon-resizer/nanny.AddonResizerVersion=1.8.22' -o /tmp/tmp.LlaJKl/pod_nanny nanny/main/pod_nanny.go"
the input device is not a TTY

I confirmed that builds still work by running make container locally.

Which issue(s) this PR fixes:

Ref #7615

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 19, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 19, 2024
@raywainman
Copy link
Contributor Author

If I inject a compile-time error, I can still see the error in the output, even without -it. TBH I'm not sure why it was there in the first place.

$ make container
docker buildx inspect img-builder > /dev/null || docker buildx create --name img-builder --use
cp -r * /tmp/tmp.ORf3Qub1gb
cd /tmp/tmp.ORf3Qub1gb && sed -i 's|BASEIMAGE|gcr.io/distroless/static:latest|g' Dockerfile
docker run --rm -v /tmp/tmp.ORf3Qub1gb:/tmp/tmp.ORf3Qub1gb:Z -v `pwd`:/go/src/k8s.io/autoscaler/addon-resizer/:Z \
        golang:1.23 \
        /bin/bash -c "\
            cd /go/src/k8s.io/autoscaler/addon-resizer/ && \
            CGO_ENABLED=0 GOARM=7 GOARCH=amd64 go build -a -installsuffix cgo --ldflags '-w -X k8s.io/autoscaler/addon-resizer/nanny.AddonResizerVersion=1.8.22' -o /tmp/tmp.ORf3Qub1gb/pod_nanny nanny/main/pod_nanny.go"
# command-line-arguments
nanny/main/pod_nanny.go:105:23: undefined: asd2
make: *** [Makefile:57: .container-amd64] Error 1

vs

$ make container
docker buildx inspect img-builder > /dev/null || docker buildx create --name img-builder --use
cp -r * /tmp/tmp.QpP1JYun9f
cd /tmp/tmp.QpP1JYun9f && sed -i 's|BASEIMAGE|gcr.io/distroless/static:latest|g' Dockerfile
docker run --rm -it -v /tmp/tmp.QpP1JYun9f:/tmp/tmp.QpP1JYun9f:Z -v `pwd`:/go/src/k8s.io/autoscaler/addon-resizer/:Z \
        golang:1.23 \
        /bin/bash -c "\
            cd /go/src/k8s.io/autoscaler/addon-resizer/ && \
            CGO_ENABLED=0 GOARM=7 GOARCH=amd64 go build -a -installsuffix cgo --ldflags '-w -X k8s.io/autoscaler/addon-resizer/nanny.AddonResizerVersion=1.8.22' -o /tmp/tmp.QpP1JYun9f/pod_nanny nanny/main/pod_nanny.go"
# command-line-arguments
nanny/main/pod_nanny.go:105:23: undefined: asd2
make: *** [Makefile:57: .container-amd64] Error 1

Copy link
Member

@kwiesmueller kwiesmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 19, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kwiesmueller, raywainman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 9037fd8 into kubernetes:addon-resizer-release-1.8 Dec 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants