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

replication: add new Validated condition #664

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

Rakshith-R
Copy link
Member

@Rakshith-R Rakshith-R commented Sep 11, 2024

This commit adds new Validated condition.
This is initially used to indicate the csi driver
responded with FailedPrecondition grpc code for
EnableReplication request using
PrerequisiteNotMet reason.

@mergify mergify bot added the api Change to the API, requires extra care label Sep 11, 2024
This commit adds new Validated condition.
This is initially used to indicate the csi driver
responded with FailedPrecondition grpc code for
EnableReplication request using
`PrerequisiteNotMet` reason.

Signed-off-by: Rakshith R <[email protected]>
@Rakshith-R Rakshith-R changed the title replication: add new FailedPrecondition condition replication: add new Validated condition Sep 12, 2024
if resp.HasKnownGRPCError(enableReplicationKnownErrors) {
setFailedValidationCondition(&vr.instance.Status.Conditions, vr.instance.Generation)
} else {
setFailedPromotionCondition(&vr.instance.Status.Conditions, vr.instance.Generation)
Copy link
Member

Choose a reason for hiding this comment

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

can you please use setFailureCondition(instance) as it internally takes care of setting the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

https://github.com/csi-addons/kubernetes-csi-addons/blob/main/internal/controller/replication.storage/status.go

I would like to use similar format of using different functions currently present in status.go than forcing another function (for just one case) just to handle if else decision which then would again call the functions present in status.go .

https://github.com/csi-addons/kubernetes-csi-addons/blob/main/internal/controller/replication.storage/volumereplication_controller.go#L805

Copy link
Member

Choose a reason for hiding this comment

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

we already have a generic helper function to set the conditions i don't like to see others calling it even though we have a helper function to do it. and for this again it's a bug we should not be setting setFailedPromotionCondition condition if the enable replication fails, the condition should reflect what went wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

we already have a generic helper function to set the conditions i don't like to see others calling it even though we have a helper function to do it. and for this again it's a bug we should not be setting setFailedPromotionCondition condition if the enable replication fails, the condition should reflect what went wrong.

Enabling replication is part of promotion. I don't see a issue with that part.

Why do you want to force a helper function that is used at a lot of other places to fit into a new scenario ?
If we do that, we'll need more arguments and the function will not be so generic anymore.

Copy link
Member

Choose a reason for hiding this comment

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

even thought its part of the condition we should reflect on what exactly went wrong #666 is the tracker for it.

Why do you want to force a helper function that is used at a lot of other places to fit into a new scenario ?
If we do that, we'll need more arguments and the function will not be so generic anymore.

i don't see any new change in the behaviour to call setFailureCondition instead of setFailedPromotionCondition

Copy link
Member Author

Choose a reason for hiding this comment

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

I really don't get why you want to call that function when you already know which function it will in turn call.

There are a lot of places already calling functions from status.go directly.

Copy link
Member

Choose a reason for hiding this comment

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

we need to remove all that one and remove unwanted functions, we should be doing call A in one function to set status and call B in one function to set status, we need have only one way to set the conditions

@Rakshith-R Rakshith-R marked this pull request as ready for review September 12, 2024 10:50
@mergify mergify bot merged commit 9f416da into csi-addons:main Sep 12, 2024
15 checks passed
lumiere-bot bot referenced this pull request in coolguy1771/home-ops Sep 19, 2024
… ) (#5423)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[kubernetes-csi-addons](https://redirect.github.com/csi-addons/kubernetes-csi-addons)
| minor | `v0.9.1` -> `v0.10.0` |

---

### Release Notes

<details>
<summary>csi-addons/kubernetes-csi-addons
(kubernetes-csi-addons)</summary>

###
[`v0.10.0`](https://redirect.github.com/csi-addons/kubernetes-csi-addons/releases/tag/v0.10.0)

[Compare
Source](https://redirect.github.com/csi-addons/kubernetes-csi-addons/compare/v0.9.1...v0.10.0)

#### What's Changed

- Add proto and sidecar code for volumegroup by
[@&#8203;Nikhil-Ladha](https://redirect.github.com/Nikhil-Ladha) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/652](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/652)
- vendor: Bump google.golang.org/grpc from 1.65.0 to 1.66.0 in the
golang-dependencies group by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/656](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/656)
- vendor: Bump sigs.k8s.io/controller-tools from 0.16.1 to 0.16.2 in
/tools in the k8s-dependencies group by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/658](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/658)
- vendor: Bump the github-dependencies group across 1 directory with 3
updates by [@&#8203;dependabot](https://redirect.github.com/dependabot)
in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/657](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/657)
- replication: add new Validated condition by
[@&#8203;Rakshith-R](https://redirect.github.com/Rakshith-R) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/664](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/664)
- bundle: Update CSV capability to Seamless Upgrades by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/668](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/668)
- Refactor PVC controller by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/662](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/662)
- bundle: Add missing CRDs to bundle CSV by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/669](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/669)
- vendor: bump the k8s-dependencies group with 3 updates by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/673](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/673)

#### New Contributors

- [@&#8203;Nikhil-Ladha](https://redirect.github.com/Nikhil-Ladha) made
their first contribution in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/652](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/652)

**Full Changelog**:
csi-addons/kubernetes-csi-addons@v0.9.1...v0.10.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44NS4wIiwidXBkYXRlZEluVmVyIjoiMzguODUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUvZ2l0aHViLXJlbGVhc2UiLCJ0eXBlL21pbm9yIl19-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
spiceratops referenced this pull request in spiceratops/k8s-gitops Sep 26, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[kubernetes-csi-addons](https://redirect.github.com/csi-addons/kubernetes-csi-addons)
| minor | `v0.9.1` -> `v0.10.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>csi-addons/kubernetes-csi-addons
(kubernetes-csi-addons)</summary>

###
[`v0.10.0`](https://redirect.github.com/csi-addons/kubernetes-csi-addons/releases/tag/v0.10.0)

[Compare
Source](https://redirect.github.com/csi-addons/kubernetes-csi-addons/compare/v0.9.1...v0.10.0)

#### What's Changed

- Add proto and sidecar code for volumegroup by
[@&#8203;Nikhil-Ladha](https://redirect.github.com/Nikhil-Ladha) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/652](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/652)
- vendor: Bump google.golang.org/grpc from 1.65.0 to 1.66.0 in the
golang-dependencies group by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/656](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/656)
- vendor: Bump sigs.k8s.io/controller-tools from 0.16.1 to 0.16.2 in
/tools in the k8s-dependencies group by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/658](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/658)
- vendor: Bump the github-dependencies group across 1 directory with 3
updates by [@&#8203;dependabot](https://redirect.github.com/dependabot)
in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/657](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/657)
- replication: add new Validated condition by
[@&#8203;Rakshith-R](https://redirect.github.com/Rakshith-R) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/664](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/664)
- bundle: Update CSV capability to Seamless Upgrades by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/668](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/668)
- Refactor PVC controller by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/662](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/662)
- bundle: Add missing CRDs to bundle CSV by
[@&#8203;black-dragon74](https://redirect.github.com/black-dragon74) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/669](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/669)
- vendor: bump the k8s-dependencies group with 3 updates by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/673](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/673)

#### New Contributors

- [@&#8203;Nikhil-Ladha](https://redirect.github.com/Nikhil-Ladha) made
their first contribution in
[https://github.com/csi-addons/kubernetes-csi-addons/pull/652](https://redirect.github.com/csi-addons/kubernetes-csi-addons/pull/652)

**Full Changelog**:
csi-addons/kubernetes-csi-addons@v0.9.1...v0.10.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44NS4wIiwidXBkYXRlZEluVmVyIjoiMzguODUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUvZ2l0aHViLXJlbGVhc2UiLCJ0eXBlL21pbm9yIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Change to the API, requires extra care
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants