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

Some fixes to kubetest2 GKE deployer #44

Merged
merged 1 commit into from
Aug 15, 2020

Conversation

chizhg
Copy link
Contributor

@chizhg chizhg commented Aug 14, 2020

Fix a few subtle bugs for kubetest2 GKE deployer, mainly for firewall rules and networking for multicluster profile.

I have done the manual regression tests for both single cluster and multi-cluster, and nothing breaks.

/cc @amwat

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 14, 2020
@chizhg chizhg force-pushed the gke-deployer-fixes branch 4 times, most recently from 08e4144 to 617f43c Compare August 15, 2020 00:17
Copy link
Contributor

@amwat amwat left a comment

Choose a reason for hiding this comment

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

The pre-existing functionality seems to rely too much on top level struct fields 😕
I'll most likely refactor them into separate options in the future.

/lgtm
/approve
/hold
for one question

return len(fwList), nil
// Sleep 10 seconds to wait for the firewall rules being deleted completely.
// TODO(chizhg): change to a more reliable way to check if they are deleted or not.
time.Sleep(10 * time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

does this mean the gcloud firewall-rules delete command exits before the firewalls are actually deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on my experiment, yes, sometimes I got "network is still used by firewall rule xxx", even if the log shows the firewall rule has been deleted.
I have changed the comment to include this information.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 15, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 15, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amwat, chizhg

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 15, 2020
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 15, 2020
@chizhg
Copy link
Contributor Author

chizhg commented Aug 15, 2020

The pre-existing functionality seems to rely too much on top level struct fields 😕
I'll most likely refactor them into separate options in the future.

/lgtm
/approve
/hold
for one question

Do you mean too many functions are using deployer as the receiver? If yes definitely agree...

@amwat
Copy link
Contributor

amwat commented Aug 15, 2020

/lgtm
/hold cancel

yeah because everything is in the top level struct.

They should be split into modular options e.g. networkOptions etc.

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Aug 15, 2020
@k8s-ci-robot k8s-ci-robot merged commit 8027cdc into kubernetes-sigs:master Aug 15, 2020
@mrfaizal
Copy link

any thoughts on adding unit tests?

@chizhg
Copy link
Contributor Author

chizhg commented Aug 18, 2020

any thoughts on adding unit tests?

There is little to no unit test in this repo now :-(

And unfortunately the current way we implement kubetest2-gke makes it almost impossible to unit test, since it's using gcloud command under-the-hood. https://github.com/knative/test-infra/tree/master/kntest/pkg/cluster/gke is a similar tool implemented for Knative a while ago, which is using the Google Cloud Go APIs and has pretty high test coverage. I had some prior discussions with Amit and Ben on moving it here, and will likely do it in the next quarter, then we can have more tests added.

@mrfaizal
Copy link

sgtm!

@chizhg chizhg deleted the gke-deployer-fixes branch November 3, 2021 21:59
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. 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