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

Fix an issue where clusteractuator.Delete(...) would never succeed if the firewall rules it is attempting to delete do not exist. Move GCEClientComputeServieMock to an appropriate shared location. #378

Merged

Conversation

spew
Copy link
Contributor

@spew spew commented Jun 21, 2018

What this PR does / why we need it:
This PR fixes an issue where clusteractuator.Delete(...) would never succeed if the firewall rules it is attempting to delete do not exist. Therefore, it handles a NotFound error by assuming the FirewallRule has already been removed by a previous run of Delete(...) or by an external force (like a GCP adminstratro).

It also moves the GCEClientComputeServieMock to an appropriate shared location since it is being used by both the clusteractuator_test.go and machineactuator_test.go.

Release note:

Fix an issue where clusteractuator.Delete(...) would never succeed if the firewall rules it is attempting to delete do not exist.

@kubernetes/kube-deploy-reviewers

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 21, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spew

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 21, 2018
@spew spew force-pushed the delete-firewall-rule-not-found branch 2 times, most recently from a520de6 to 84930c4 Compare June 21, 2018 20:57
@spew
Copy link
Contributor Author

spew commented Jun 21, 2018

/assign @mkjelland

@spew
Copy link
Contributor Author

spew commented Jun 21, 2018

/assign @roberthbailey

@@ -0,0 +1,96 @@
package google_test

import (
Copy link
Contributor

Choose a reason for hiding this comment

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

if you only need a single import you can put it on one line instead of in a block

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -0,0 +1,68 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to fix this copyright now that we have the verify boilerplate script (it needs some blank lines).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed and added the copyright to the clientcomputeservice_test.go as well where it was missing.


func newClusterActuator(t *testing.T, params google.ClusterActuatorParams) cluster.Actuator {
t.Helper()
actuator, err := google.NewClusterActuator(params)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is just making one fn call and checking for an error is there a reason you put it into a separate fn instead of putting it inline?

Copy link
Contributor Author

@spew spew Jun 22, 2018

Choose a reason for hiding this comment

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

Just did this out of force of habit since it is useful once there is more than one test (they can all make a one line function call instead of 3 lines of function call & error handling).

… the firewall rules it is attempting to delete do not exist. Move GCEClientComputeServieMock to an appropriate shared location.
@spew spew force-pushed the delete-firewall-rule-not-found branch from 22594f7 to 3d90b8e Compare June 22, 2018 18:11
@roberthbailey
Copy link
Contributor

lgtm

@mkjelland
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2018
@k8s-ci-robot k8s-ci-robot merged commit 4c5bd3c into kubernetes-sigs:master Jun 25, 2018
jayunit100 pushed a commit to jayunit100/cluster-api that referenced this pull request Jan 31, 2020
…-fix-cluster-name

hack/generate-yaml.sh: fix hard-coded cluster name
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.

None yet

4 participants