-
Notifications
You must be signed in to change notification settings - Fork 617
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
[occm] add tag on floating ip create #2577
base: master
Are you sure you want to change the base?
Conversation
Welcome @lidongshengxdayu! |
Hi @lidongshengxdayu. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
This looks like a sane request to be able to tag the FIPs created by CCM. This needs to handle one more case though:
While you're on this, be informed that a bunch of other folks are working on resource tagging, @stephenfin and @dd-georgiev. |
remove add tag on floating create
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 still not untagging FIPs we don't delete properly.
it mean that you need to untag it when cancel the association? |
See this comment for details: #2577 (comment) |
# Conflicts: # pkg/openstack/loadbalancer.go
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
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.
regarding the conditions logic, I think it makes sense to update it to the pattern below:
if found && !delete {
return nil
}
if delete {
DELETE
}
ADD
UPD: not all openstack deployments have the standard-attr-tag
extension enabled. Can you add a check for tags extensions? See
cloud-provider-openstack/pkg/openstack/openstack.go
Lines 466 to 470 in 733195a
netExts, err := openstackutil.GetNetworkExtensions(ctx, network) | |
if err != nil { | |
klog.Warningf("Failed to list neutron extensions: %v", err) | |
return nil, false | |
} |
LoadBalancer
struct
@@ -663,6 +697,7 @@ func (lbaas *LbaasV2) ensureFloatingIP(ctx context.Context, clusterName string, | |||
if err != nil { | |||
return "", err | |||
} | |||
_ = lbaas.updateFloatingIPTag(ctx, floatIP, svcConf.lbName, true) |
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 wonder why do you skip err
?
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'm not sure whether returning an error will cause a wider range of logic errors, and I'm not very familiar with the code base.
And tag
is optional. I think it should not affect the normal logic of floating ip. Even if an error occurs, it can be checked through the log.
At this position, even if an error occurs and return, the next loop cannot be updated either
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.
If you think this and the add
below need to return err, tell me and I will add it.
@lidongshengxdayu have you considered to change the logic to the suggested pattern? And what about my |
sorry, eyes are drowning in code. |
What this PR does / why we need it:
In some scenarios, tags are used as resource tags, but occm creates a floating ip without a tag. This PR adds the same tag as the LB when the floating ip created.