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

Schedule workflow #1861

Merged
merged 9 commits into from
May 25, 2021
Merged

Conversation

AsterNighT
Copy link
Collaborator

What problem does this PR solve?

What is changed and how does it work?

Checklist

Tests

  • Unit test
  • E2E test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Breaking backward compatibility

Related changes

  • Need to update the documentation

Does this PR introduce a user-facing change?

NONE

AsterNighT and others added 6 commits May 20, 2021 11:29
Signed-off-by: AsterNighT <klxjt99@outlook.com>
* feat: apis for endtime and status

Signed-off-by: STRRL <str_ruiling@outlook.com>

* feat: refactor workflow entry reconciler, update conditions in stastus

Signed-off-by: STRRL <str_ruiling@outlook.com>

* feat: update the end time of workflow

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: fix comments and typos

Signed-off-by: STRRL <str_ruiling@outlook.com>

* test: fix test cases

Signed-off-by: STRRL <str_ruiling@outlook.com>

* fix: fix the condition on updating end time of workflow

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: AsterNighT <klxjt99@outlook.com>
Signed-off-by: AsterNighT <klxjt99@outlook.com>
Signed-off-by: AsterNighT <klxjt99@outlook.com>
Signed-off-by: AsterNighT <klxjt99@outlook.com>
@AsterNighT
Copy link
Collaborator Author

I think it's ready for review. @STRRL @YangKeao

@@ -183,7 +181,7 @@ func InitClientSet() (*ClientSet, error) {
// GetPods returns pod list and corresponding chaos daemon
func GetPods(ctx context.Context, chaosName string, status v1alpha1.ChaosStatus, selectorSpec v1alpha1.PodSelectorSpec, c client.Client) ([]v1.Pod, []v1.Pod, error) {
// get podName
failedMessage := status.FailedMessage
failedMessage := ""
if failedMessage != "" {
Copy link

Choose a reason for hiding this comment

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

opt.semgrep.eqeq-is-bad: useless comparison operation failedMessage == failedMessage or failedMessage != failedMessage
(at-me in a reply with help or ignore)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Muse-Dev ignore

Copy link

Choose a reason for hiding this comment

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

I've recorded this as ignored for this pull request. If you change your mind, just comment @muse-dev unignore.

Signed-off-by: AsterNighT <klxjt99@outlook.com>
@AsterNighT AsterNighT added this to the Controller Nirvana milestone May 20, 2021
Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

Hi @AsterNighT , I try to apply that CRD into my kubernetes clusters (tried on v1.15.12 and v1.20.2), both of them told me:

CustomResourceDefinition.apiextensions.k8s.io "schedules.chaos-mesh.org" is invalid: spec.validation.openAPIV3Schema.properties[spec].properties[workflow].type: Required value: must not be empty for specified object fields

also happends on workflownodes.chaos-mesh.org, workflows.chaos-mesh.org

Seems the controller-gen does NOT make the correct definition of Workflow in EmbededChaos.

FYI, then I tried to regenerate CRD YAML with controller-gen@v0.4.1 and controller-gen@v0.5.0, only controller-gen@v0.5.0 works.

@@ -1898,6 +1898,7 @@ spec:
description: 'TODO: use a custom type, as `TemplateType` contains other
possible values'
type: string
workflow: {}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is the reason that makes the CRD invalid.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I separate schedule totally from workflow. It no longer use embeded chaos any more, but generate its own types. Does it work now?

Signed-off-by: AsterNighT <klxjt99@outlook.com>
@AsterNighT
Copy link
Collaborator Author

Oh my, 7162+! What the hell is that?

Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

LGTM

I am sure we will refactor the definition of EmbedChaos or ScheduleItem in the future.

@YangKeao
Copy link
Member

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • STRRL
  • YangKeao

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@YangKeao
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 47132da

@ti-chi-bot ti-chi-bot merged commit 30f6ea2 into chaos-mesh:nirvana May 25, 2021
YangKeao added a commit that referenced this pull request May 27, 2021
* Simplify implementation

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* provide jvmchaos

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* ignore not found

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* PodIOChaos through reconciler (#1836)

* podnetworkchaos through reconciler

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* manage status machine in common controller

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* fix subresource observation

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* make check and remove comments

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* fix according to review

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* bootstrap podiochaos

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* podiochaos implementation through reconciler

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* fix iochaos owns watch

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* use simple list to map podxxxchaos to xxxchaos in controller

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* fix a typo in the comment

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* Schedule workflow (#1861)

* tmp

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* feat: apis for workflow endtime and status (#1828)

* feat: apis for endtime and status

Signed-off-by: STRRL <str_ruiling@outlook.com>

* feat: refactor workflow entry reconciler, update conditions in stastus

Signed-off-by: STRRL <str_ruiling@outlook.com>

* feat: update the end time of workflow

Signed-off-by: STRRL <str_ruiling@outlook.com>

* chore: fix comments and typos

Signed-off-by: STRRL <str_ruiling@outlook.com>

* test: fix test cases

Signed-off-by: STRRL <str_ruiling@outlook.com>

* fix: fix the condition on updating end time of workflow

Signed-off-by: STRRL <str_ruiling@outlook.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>

* implement gc for workflow

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* Apply generate

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* Update test and yam;

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* Fix type assertion issues

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* Add todo

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* Separate schedule from workflow

Signed-off-by: AsterNighT <klxjt99@outlook.com>

Co-authored-by: STRRL <str_ruiling@outlook.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>

* Simplify implementation

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* provide jvmchaos

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* ignore not found

Signed-off-by: AsterNighT <klxjt99@outlook.com>

* fix selector in jvmchaos

Signed-off-by: YangKeao <keao.yang@yahoo.com>

* update example

Signed-off-by: AsterNighT <klxjt99@outlook.com>

Co-authored-by: YangKeao <keao.yang@yahoo.com>
Co-authored-by: STRRL <str_ruiling@outlook.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants