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

Support multiple events in the lifecycle policy #285

Merged
merged 1 commit into from
Jul 9, 2019

Conversation

Rajadeepan
Copy link
Contributor

Support multiple events in the lifecycle policy. updating events to list of events.
#266

This PR need to be updated with updated submodule of charts after the PR volcano-retired/charts#5 gets merged.

@volcano-sh-bot volcano-sh-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 3, 2019
@volcano-sh-bot volcano-sh-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 3, 2019
@k82cn
Copy link
Member

k82cn commented Jul 4, 2019

This PR need to be updated with updated submodule of charts after the PR volcano-retired/charts#5 gets merged.

We need cherry-pick CRD when this PR is merged.

@@ -178,7 +178,7 @@ type LifecyclePolicy struct {
// The Event recorded by scheduler; the controller takes actions
// according to this Event.
// +optional
Event Event `json:"event,omitempty" protobuf:"bytes,2,opt,name=event"`
Event []Event `json:"event,omitempty" protobuf:"bytes,2,opt,name=event"`
Copy link
Member

Choose a reason for hiding this comment

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

Add a new member; we already publish this CRD; we can not change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a new member EventList

break
}
if _, found := policyEvents[event]; found {
err = multierror.Append(err, fmt.Errorf("duplicate event %v", event))
Copy link
Member

Choose a reason for hiding this comment

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

that's ok if duplicated in the same array.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code updated to ignore duplicates in the same array

Copy link
Contributor

Choose a reason for hiding this comment

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

The duplicated events are already been removed in codes of:

policyEventsList := getEventlist(policy)

?

Copy link
Contributor Author

@Rajadeepan Rajadeepan Jul 8, 2019

Choose a reason for hiding this comment

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

If there are duplicate events within one policy it will be removed in the codes of:
policyEventList := getEventlist(policy)

But if there are duplicate events across different policy then
Error message will be thrown ("duplicate events %v",event)

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, then we may need more clear error message for that since the first case is being handled automatically now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can the error message be updated as ("duplicate events %v across different policy", event) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

That would be good thanks.

@Rajadeepan Rajadeepan changed the title [WIP]Support multiple events in the lifecycle policy Support multiple events in the lifecycle policy Jul 4, 2019
@Rajadeepan Rajadeepan changed the title Support multiple events in the lifecycle policy [WIP]Support multiple events in the lifecycle policy Jul 5, 2019
@Rajadeepan Rajadeepan changed the title [WIP]Support multiple events in the lifecycle policy Support multiple events in the lifecycle policy Jul 5, 2019
@volcano-sh-bot volcano-sh-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 5, 2019
@TravisBuddy
Copy link

Travis tests have failed

Hey @Rajadeepan,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: c0c60700-9f0f-11e9-9e24-3df77584075c

@TravisBuddy
Copy link

Travis tests have failed

Hey @Rajadeepan,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: add68ad0-a0ee-11e9-9257-c7ea9dc52f8c

@TravisBuddy
Copy link

Travis tests have failed

Hey @Rajadeepan,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 4d1bc270-a119-11e9-b4a0-0f4450928f2b

// The EventList recorded by scheduler; the controller takes actions
// according to this EventList.
// +optional
EventList []Event `json:"eventlist,omitempty" protobuf:"bytes,3,opt,name=eventlist"`
Copy link
Member

Choose a reason for hiding this comment

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

Just call Events

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to Events

@Rajadeepan Rajadeepan force-pushed the mulevents branch 2 times, most recently from b042b5b to aac88fc Compare July 8, 2019 05:41
@TravisBuddy
Copy link

Travis tests have failed

Hey @Rajadeepan,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 3c24db80-a143-11e9-b4a0-0f4450928f2b

@TommyLike
Copy link
Contributor

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2019
@TommyLike
Copy link
Contributor

/approve

@TommyLike
Copy link
Contributor

cc @k82cn

@k82cn
Copy link
Member

k82cn commented Jul 9, 2019

/lgtm

Please also open PR for e2e test.

@volcano-sh-bot volcano-sh-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 9, 2019
@k82cn
Copy link
Member

k82cn commented Jul 9, 2019

/approve

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: k82cn, Rajadeepan, TommyLike

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

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2019
@volcano-sh-bot volcano-sh-bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 9, 2019
@Rajadeepan
Copy link
Contributor Author

/lgtm

Please also open PR for e2e test.

ok will raise a new PR for e2e test

@TommyLike
Copy link
Contributor

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2019
@volcano-sh-bot volcano-sh-bot merged commit 0625d1a into volcano-sh:master Jul 9, 2019
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/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.

5 participants