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

Replace BuildTestContainer with use of builder #5896

Merged

Conversation

kwiesmueller
Copy link
Member

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Resolves a code TODO by replacing uses of BuildTestContainer with use of the builder directly.

Which issue(s) this PR fixes:

Fixes code TODO

Special notes for your reviewer:

I was resolving the TODO and generally think it might have helped clean things up, but would like to get some feedback if we all agree this change makes sense.
I can see it both ways that having this helper made sense. If so we should just remove the TODO instead.

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


/assign @jbartosik

@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. area/vertical-pod-autoscaler labels Jun 27, 2023
@k8s-ci-robot k8s-ci-robot requested review from kgolab and voelzmo June 27, 2023 20:01
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 27, 2023
@jbartosik
Copy link
Collaborator

/retest

Test failure seems unrelated to the PR:

W0627 20:22:16.992770   40599 clusterstate.go:444] AcceptableRanges have not been populated yet. Skip checking
--- FAIL: TestBinpackingLimiter (0.00s)
    common.go:404: 
        	Error Trace:	/home/runner/work/autoscaler/autoscaler/go/src/k8s.io/autoscaler/cluster-autoscaler/core/test/common.go:404
        	            				/home/runner/work/autoscaler/autoscaler/go/src/k8s.io/autoscaler/cluster-autoscaler/core/scaleup/orchestrator/orchestrator.go:173
        	            				/home/runner/work/autoscaler/autoscaler/go/src/k8s.io/autoscaler/cluster-autoscaler/core/scaleup/orchestrator/orchestrator_test.go:855
        	Error:      	did not find expansionOptionToChoose %+v
        	Test:       	TestBinpackingLimiter
        	Messages:   	&{GroupName:ng1 SizeChange:1}
    orchestrator_test.go:858: 
        	Error Trace:	/home/runner/work/autoscaler/autoscaler/go/src/k8s.io/autoscaler/cluster-autoscaler/core/scaleup/orchestrator/orchestrator_test.go:858
        	Error:      	Should be true
        	Test:       	TestBinpackingLimiter

Copy link
Collaborator

@jbartosik jbartosik left a comment

Choose a reason for hiding this comment

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

Looks good to me

One idea I have is that we're calling resource.MustParse each time we call WithMemRequest and similar functions (in existing code too). What do you think about changing the builder to take a string input instead?

(this is a strict improvement so if you think it's better to merge as-is let's do that)

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 28, 2023
@mwielgus
Copy link
Contributor

/retest

@kwiesmueller
Copy link
Member Author

If we always use a string for the quantity it makes sense to simplify, agreed.
Would do that in a follow-up.

@kwiesmueller
Copy link
Member Author

Retest didn't trigger, trying again.

/retest
/test

@k8s-ci-robot
Copy link
Contributor

@kwiesmueller: No presubmit jobs available for kubernetes/autoscaler@master

In response to this:

Retest didn't trigger, trying again.

/retest
/test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kwiesmueller kwiesmueller force-pushed the test-util-builder-cleanup branch from 73adf4c to db507cd Compare June 28, 2023 14:58
Copy link
Collaborator

@jbartosik jbartosik 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 Jun 28, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 8f83f7e into kubernetes:master Jun 28, 2023
@jbartosik
Copy link
Collaborator

If we always use a string for the quantity it makes sense to simplify, agreed.

It seems so to me.

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. area/vertical-pod-autoscaler 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants