-
Notifications
You must be signed in to change notification settings - Fork 344
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
Fix injecting volumes into rollover jobs #446
Fix injecting volumes into rollover jobs #446
Conversation
Signed-off-by: Pavol Loffay <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #446 +/- ##
==========================================
+ Coverage 91.11% 91.57% +0.45%
==========================================
Files 64 64
Lines 3130 3132 +2
==========================================
+ Hits 2852 2868 +16
+ Misses 196 184 -12
+ Partials 82 80 -2
Continue to review full report at Codecov.
|
I think this deserves a test |
@pavolloffay Don't understand how this changes any behaviour, as appending an empty array should have no effect anyway? And not sure how this would fix the referenced problem? |
This is how pointers work in golang. The items have to be added to the array after they are modified. Or we could use an array of references instead. |
@@ -125,6 +124,9 @@ func newProductionStrategy(jaeger *v1.Jaeger, existingSecrets []corev1.Secret) S | |||
if indexCleaner != nil { | |||
c.cronJobs = append(c.cronJobs, *indexCleaner) | |||
} | |||
if len(esRollover) > 0 { | |||
c.cronJobs = append(c.cronJobs, esRollover...) |
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.
@objectiser to help you understand the code:
The esRollover
arrays changes made on line 115 are not reflected if the esRollover
array has been added to c.cronJobs
before the modification.
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.
Yes, sorry - only looked at the changes, not the full code.
@pavolloffay agree needs a test, but otherwise looks good. |
Signed-off-by: Pavol Loffay <[email protected]>
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 - one minor change.
pkg/strategy/production_test.go
Outdated
for _, dep := range c.Deployments() { | ||
if strings.HasSuffix(dep.Name, "-query") { | ||
assert.Equal(t, 2, len(dep.Spec.Template.Spec.Containers)) | ||
assert.Equal(t, "jaeger-agent", dep.Spec.Template.Spec.Containers[1].Name) | ||
} | ||
} | ||
} | ||
|
||
func TestInjectElasticsearch(t *testing.T) { | ||
j := v1.NewJaeger("TestAgentSidecarIsInjectedIntoQueryForStreamingForProduction") |
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: Should use test name TestInjectElasticsearch
Signed-off-by: Pavol Loffay <[email protected]>
Resolves #434
Signed-off-by: Pavol Loffay [email protected]