Conversation
hors
requested changes
Apr 10, 2025
| result.Requeue = true | ||
| return result, nil | ||
| } | ||
| // K8SPG-698: it should happen earlier |
gkech
reviewed
Apr 14, 2025
| } | ||
| serviceAccountName := sts.Spec.Template.Spec.ServiceAccountName | ||
| if serviceAccountName == "" { | ||
| panic("it's not expected to have empty service account name") |
Contributor
There was a problem hiding this comment.
Since checkObject(...) returns an error and when used we do this
if err := sc.checkObject(ctx, obj); err != nil {
panic(err) // should panic because reconciler can ignore the error
}
I think this check can return an error and let the caller panic it. WDYT?
gkech
reviewed
Apr 14, 2025
Comment on lines
+1656
to
+1668
| func (sc *saTestClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error { | ||
| if err := sc.checkObject(ctx, obj); err != nil { | ||
| panic(err) // should panic because reconciler can ignore the error | ||
| } | ||
| return sc.Client.Update(ctx, obj, opts...) | ||
| } | ||
|
|
||
| func (sc *saTestClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { | ||
| if err := sc.checkObject(ctx, obj); err != nil { | ||
| panic(err) // should panic because reconciler can ignore the error | ||
| } | ||
| return sc.Client.Patch(ctx, obj, patch, opts...) | ||
| } |
Contributor
There was a problem hiding this comment.
Do we need these? Seems that they are not used in the test.
Contributor
Author
There was a problem hiding this comment.
The Crunchy code uses a patch request to create the ServiceAccount instead of a create request:
Contributor
|
seems ok, let's check the golangci and the envtests why they are failing and then we can approve. |
Collaborator
commit: f24206a |
gkech
approved these changes
Apr 15, 2025
egegunes
approved these changes
Apr 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://perconadev.atlassian.net/browse/K8SPG-698
DESCRIPTION
Problem:
The
cluster1-repo-hostStatefulSet is created before its corresponding ServiceAccountcluster1-pgbackrestexists. This can cause failures in certain environments.Solution:
Create ServiceAccount before the StatefulSet.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability