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
Add support for imagePullSecrets for Scylla and Agent images #678
Conversation
37c0923
to
43c60cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, please rename PR title and commit msg to follow current naming convention.
Please also extract autogenerated changes to separate commit.
d4569cc
to
275fb05
Compare
|
||
storageCapacity, _ := resource.ParseQuantity(basicRack.Storage.Capacity) | ||
|
||
expectedSts := &appsv1.StatefulSet{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh this is painful to work with. Do something simillar to this approach:
scylla-operator/pkg/resourceapply/apps_test.go
Lines 145 to 150 in 9c745f7
expectedSts: func() *appsv1.StatefulSet { | |
sts := newSts() | |
sts.Spec.Replicas = pointer.Int32Ptr(*sts.Spec.Replicas + 1) | |
utilruntime.Must(SetHashAnnotation(sts)) | |
return sts | |
}(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
275fb05
to
6cb9b3d
Compare
2c6c296
to
bac5dd2
Compare
b333f18
to
0b19dd8
Compare
edc5715
to
fe00fe5
Compare
8023196
to
73e8622
Compare
API approved |
63486a4
to
ad8f159
Compare
ad8f159
to
5e45575
Compare
5e45575
to
1830718
Compare
} | ||
} | ||
|
||
newNonNilImagePullSecrets := func() []corev1.LocalObjectReference { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd find it more readable we inline short functions like that, but that might be opinionated. in the other case the nonNil prefix is kind of implicit, I'd not assume you make a function to create nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was taking example from how it's done in existing test, e.g. cluster_validation_test. Inlining would require duplicating the anonymous function in each test case. What would you change the "nonNil" to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was taking example from how it's done in existing test, e.g. cluster_validation_test.
I guess that could have used some tweaking as well :)
Inlining would require duplicating the anonymous function in each test case.
actually, there wouldn't be an anonymous function at all
sc.Spec.ImagePullSecrets = []corev1.LocalObjectReference{
{
Name: "basic-secrets",
},
}
What would you change the "nonNil" to?
I'd drop it, the other helper functions (like newBasicStatefulSet
) don't start with the prefix, yet we assume they return non-nil values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I changed the shorter functions to inline and renamed the other ones
expectedStatefulSet: nil, | ||
expectedError: func() error { | ||
_, err := resource.ParseQuantity("") | ||
return fmt.Errorf("cannot parse %q: %v", "", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd just put the string inside, calling the function assumes to much internals that could change while the string stays constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compared string + added cmpopts.EquateErrors() for recommended error comparison
a0ccc09
to
43c26f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please split generated files and go.mod + vendor into separate commits
} | ||
} | ||
|
||
newNonNilImagePullSecrets := func() []corev1.LocalObjectReference { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was taking example from how it's done in existing test, e.g. cluster_validation_test.
I guess that could have used some tweaking as well :)
Inlining would require duplicating the anonymous function in each test case.
actually, there wouldn't be an anonymous function at all
sc.Spec.ImagePullSecrets = []corev1.LocalObjectReference{
{
Name: "basic-secrets",
},
}
What would you change the "nonNil" to?
I'd drop it, the other helper functions (like newBasicStatefulSet
) don't start with the prefix, yet we assume they return non-nil values
08a7d79
to
441f53f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits, lgtm otherwise
441f53f
to
150697e
Compare
150697e
to
34f4411
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Description of your changes:
Resolves #348