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

Delete pod if subnet of the pod's owner(sts/vm) updated #1678

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

chestack
Copy link
Contributor

What type of this PR

  • Bug fixes

Which issue(s) this PR fixes:

Fixes #1677

@chestack
Copy link
Contributor Author

@hongzhen-ma cloud you please help review this change, found that you did much work about sts pods deletion from the git history. thanks

@hongzhen-ma
Copy link
Collaborator

@hongzhen-ma cloud you please help review this change, found that you did much work about sts pods deletion from the git history. thanks

It looks good to me. Thanks for the PR. @chestack

@hongzhen-ma
Copy link
Collaborator

@chestack It seems that e2e should be modified to adapt.

@chestack
Copy link
Contributor Author

@chestack It seems that e2e should be modified to adapt.

e2e helped to find out the missing condition ownerRefSubnet != ""

// subnet of ownerReference(sts/vm) has been changed, it needs to handle delete pod and create port on the new logical switch
-       if podSubnet != nil && podSubnet.Name != ownerRefSubnet {
+       if podSubnet != nil && ownerRefSubnet != "" && podSubnet.Name != ownerRefSubnet {
                klog.Infof("Subnet of owner %s has been changed from %s to %s, delete pod %s/%s", ownerRefName, podSubnet.Name, ownerRefSubnet, pod.Namespace, pod.Name)
                return true, nil
        }

@hongzhen-ma hongzhen-ma merged commit db3b9f7 into kubeovn:master Jul 12, 2022
oilbeater pushed a commit that referenced this pull request Jul 12, 2022
oilbeater pushed a commit that referenced this pull request Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need backport
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating subnet of sts won't trigger handleDeletePod which result in failed to create new port
3 participants