-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
kubetest: add "KubectlCommand" to "deployer" interface #10216
Conversation
@BenTheElder @krzyzacy Please review. Had to disable EKS jobs (by deleting release binaries) because |
how about make it into the deployer interface? |
/hold cancel |
kubetest/conformance/conformance.go
Outdated
} | ||
log.Print("Failed to reach api. Sleeping for 10 seconds before retrying...") | ||
time.Sleep(10 * time.Second) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say conformance deployer should do noop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also @BenTheElder we can probably get rid of the old dind conformance deployer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krzyzacy @BenTheElder Just removed and made it no-op in kubetest/conformance
. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I don't think anyone is using the conformance deployer, I'll figure out something else for kind very soon...
kubetest/kubeadmdind/kubeadm_dind.go
Outdated
} | ||
log.Print("Failed to reach api. Sleeping for 10 seconds before retrying...") | ||
time.Sleep(10 * time.Second) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is duplicated logic.. maybe move the getKubectlVersion
to util package so you can reuse it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krzyzacy Found out that would make util
package import process
package, thus cyclic imports. Do you have any other suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably break those up into more specific sub-packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BenTheElder Can't think of better place to put getKubectlVersion
other than kubetest/e2e
package. Or maybe kubetest/client
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or simply make a new package.. other deployers will need some cleanup to move to their own packages as well
Thought: what if we made the path to kubectl or a method to obtain an exec.Command to it instead? GetKubectlVersion seems like an awfully specific thing for deployers to re-implement. |
@BenTheElder Good idea. Let me change |
@BenTheElder @krzyzacy Now this adds |
@BenTheElder @krzyzacy Kindly ping. Thanks! |
looks sane, punt to @BenTheElder see if this matches his thoughts :-) |
kubetest/anywhere.go
Outdated
@@ -291,6 +291,10 @@ func (k *kubernetesAnywhere) GetClusterCreated(gcpProject string) (time.Time, er | |||
return time.Time{}, errors.New("not implemented") | |||
} | |||
|
|||
func (_ *kubernetesAnywhere) KubectlArgs() ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems that KubectlArgs
actually returns one of:
nil
[]string{cmd, args...}
Maybe call this KubectlCommand
and return an *exec.Cmd
or nil
If it's nil, then kubetest can use a default via a wrapper like runKubectl
, and if it's non-nil kubetest can still append to the args with Cmd.Args = append(Cmd.Args, ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Let me change it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks 👍
kubetest/e2e.go
Outdated
if err != nil { | ||
return err | ||
} | ||
if len(args) < 1 { // no-op |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably we should default to just "kubectl" instead?
@BenTheElder All addressed. PTAL. Thanks! |
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
return err | ||
} | ||
if cmd == nil { | ||
cmd = exec.Command("./cluster/kubectl.sh") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self / @krzyzacy : eventually we should stop using cluster/*.sh
I think this is indeed correct for now though of course :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah... I wonder if we should just dump the extracted kubectl into PATH or something...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krzyzacy Can we get this merged first? Please let me know if there's anything else to be done here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/hold
thanks -- @krzyzacy any last comments?
LGTM label has been added. Git tree hash: 3815fe5bf7dde51367e90b7fba851139f5f60654
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, gyuho 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 |
/hold cancel |
/test pull-test-infra-verify-deps |
@gyuho: Updated the
In response to this:
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. |
For kubernetes/kubernetes#71322 and https://github.com/aws/aws-k8s-tester.
Our issue was that all e2e tests were failing as below:
And this
Something went wrong
error happens whentest-infra/kubetest/main.go
Lines 406 to 408 in db6a12c
ref. #9814