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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摉 Update provider contract to account for the paused condition #10519

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

theobarberbany
Copy link

@theobarberbany theobarberbany commented Apr 25, 2024

What this PR does / why we need it:
This change updates the provider contract to account for a new paused
condition.

It is intended to start as an optional condition, but then become
required at a later date. See issue for more context.

Relates #10130

/area documentation

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 25, 2024
@k8s-ci-robot k8s-ci-robot added do-not-merge/needs-area PR is missing an area label needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 25, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @theobarberbany. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@theobarberbany
Copy link
Author

/area documentation

@k8s-ci-robot k8s-ci-robot added area/documentation Issues or PRs related to documentation and removed do-not-merge/needs-area PR is missing an area label labels Apr 26, 2024
@theobarberbany theobarberbany force-pushed the pause-condition-update-contract branch from 285b232 to 2ff8fbd Compare April 26, 2024 11:59
@theobarberbany theobarberbany changed the title WIP: Update provider contract to account for the paused condition Update provider contract to account for the paused condition Apr 26, 2024
@theobarberbany theobarberbany marked this pull request as ready for review April 26, 2024 12:18
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 26, 2024
@sbueringer sbueringer changed the title Update provider contract to account for the paused condition 馃摉 Update provider contract to account for the paused condition Apr 29, 2024
@sbueringer
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 29, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 9, 2024
@theobarberbany theobarberbany force-pushed the pause-condition-update-contract branch from 2ff8fbd to 24a20d0 Compare July 8, 2024 11:02
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chrischdi for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2024
@theobarberbany theobarberbany force-pushed the pause-condition-update-contract branch from 24a20d0 to 09bfcdb Compare July 8, 2024 13:08
@theobarberbany theobarberbany force-pushed the pause-condition-update-contract branch 8 times, most recently from 7b5e290 to 45d23ac Compare July 8, 2024 15:54
return ctrl.Result{}, nil
}

conditions.MarkFalse(m, clusterv1.PausedCondition, clusterv1.ResourceNotPausedReason, clusterv1.ConditionSeverityInfo, "Resource is operating as expected")
Copy link
Author

@theobarberbany theobarberbany Jul 8, 2024

Choose a reason for hiding this comment

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

I'm not sure if I want a FalseConditionWithNegativePolarity here? Does a resource not being paused, therefore reconciling now count as a positive polarity event?

Although, then the helper does not accept a reason or severity.

Maybe This would be more straightforward with just conditions.Set(), I think I'm agreeing more with the paused condition not being polar.

cc @sbueringer

Copy link
Member

Choose a reason for hiding this comment

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

I would say let's use conditions.Set()

Let's only provide severity + reason + message if the object is paused. Goal would be to precisely write in the message why the object is paused (e.g. because the Cluster is paused, or the object itself is paused, but we can finalize wording of that message on the implementation PR)

Copy link
Author

Choose a reason for hiding this comment

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

Ok - I've updated the PR to do this! :)

I'm not sure if it makes sense to have reason + message, where reason can be the cluster is paused, or that the annotation is present. What extra would we gain from adding a message?

Copy link
Member

Choose a reason for hiding this comment

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

There are multiple reasons why a resource could be paused. One example: A Machine can be paused because the Machine itself is paused or because the Cluster is paused.

I would like to surface all the reasons why something is paused so folks know what to change to unpause (and also after which "unpause" the reconciliation continues)

Copy link
Author

@theobarberbany theobarberbany Jul 10, 2024

Choose a reason for hiding this comment

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

Ah yep, I understand and agree with your motivation there! I just imagined those having different reasons:

// ClusterPausedReason (Severity=Info) documents a CAPI object that is paused due to the cluster being paused (.Spec.Paused).
ClusterPausedReason = "ClusterPaused"

// AnnotationPausedReason (Severity=Info) documents a CAPI object that is paused due to the paused annotation being present.
AnnotationPausedReason = "PausedAnnotationSet"

// MachineDeploymentPausedReason (Severity=Info) documents a CAPI object that is paused due to the machine deployment being paused.
MachineDeploymentPausedReason = "MachineDeploymentPaused"

In this instance I'm not sure what extra useful information we might add in a message? E.g in the scenario where a cluster is paused, adding the name of the cluster? Name of the annotation?

Or would a single reason make more sense, with more information in the message about the specifics of the reason?

Copy link
Member

@sbueringer sbueringer Jul 10, 2024

Choose a reason for hiding this comment

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

Ah sorry that was confusing :D. I would use one Reason constant and then just describe the details in the message

Copy link
Author

Choose a reason for hiding this comment

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

Ahh ok - makes sense! :)

Copy link
Author

Choose a reason for hiding this comment

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

Ok, I think the latest changes should have short reason + more descriptive message!

@theobarberbany theobarberbany force-pushed the pause-condition-update-contract branch 4 times, most recently from e2cf9ad to 2d6f01f Compare July 10, 2024 11:37
@theobarberbany theobarberbany force-pushed the pause-condition-update-contract branch 5 times, most recently from 4699f72 to fc90091 Compare July 11, 2024 18:56
This change updates the provider contract to account for a new paused
condition.

It is intended to start as an optional condition, but then become
required at a later date.
@theobarberbany theobarberbany force-pushed the pause-condition-update-contract branch from fc90091 to 1604605 Compare July 11, 2024 19:01
This change updates verify-capi-book-summary.sh to exclude
'code-examples.md' from the summary.
@theobarberbany theobarberbany force-pushed the pause-condition-update-contract branch from 6cb0da9 to 3e9e664 Compare July 12, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Issues or PRs related to documentation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants