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

[controller] Set BlockOwnerDeletion to true when create PodGroup #756

Merged

Conversation

xiaogaozi
Copy link
Contributor

Fix #755

@volcano-sh-bot volcano-sh-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 3, 2020
@xiaogaozi
Copy link
Contributor Author

/assign @hzxuzhonghu

Copy link
Collaborator

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/lgtm

@volcano-sh-bot volcano-sh-bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 3, 2020
Controller: &isController,
Name: pod.Name,
UID: pod.UID,
BlockOwnerDeletion: &blockOwnerDeletion,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Instead of constructing this one by one. Can use metav1.NewControllerRef function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion! I've updated the PR.

@hzxuzhonghu
Copy link
Collaborator

@xiaogaozi The ut failed

=== RUN   TestAddPodGroup
--- FAIL: TestAddPodGroup (0.00s)
    pg_controller_test.go:157: Case AddPodGroup: pod has no ownerReferences or priorityClassName failed, expect &{{PodGroup scheduling.volcano.sh/v1beta1} {podgroup-7a09885b-b753-4924-9fba-77c0836bac20  test    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [{v1 Pod pod1 7a09885b-b753-4924-9fba-77c0836bac20 0xc000046250 <nil>}] []  []} {1   <nil>} { [] 0 0 0}}, got &{{ } {podgroup-7a09885b-b753-4924-9fba-77c0836bac20  test    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [{v1 Pod pod1 7a09885b-b753-4924-9fba-77c0836bac20 0xc0000462b1 0xc0000462b2}] []  []} {1   <nil>} { [] 0 0 0}}
FAIL

@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 3, 2020
Copy link
Collaborator

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 3, 2020
@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu, xiaogaozi

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

@TravisBuddy
Copy link

Hey @xiaogaozi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 47464dd0-7598-11ea-b60d-a5b03af48ea2

@volcano-sh-bot volcano-sh-bot merged commit 3b4d699 into volcano-sh:master Apr 3, 2020
@xiaogaozi xiaogaozi deleted the fix/pod-group-owner-ref branch April 16, 2020 03:48
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. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug Report: When delete pod the related "PodGroup" won't be deleted
4 participants