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

Fix injecting volumes into rollover jobs #446

Merged

Conversation

pavolloffay
Copy link
Member

Resolves #434

Signed-off-by: Pavol Loffay [email protected]

@pavolloffay pavolloffay requested a review from jpkrohling May 28, 2019 15:54
@codecov
Copy link

codecov bot commented May 28, 2019

Codecov Report

Merging #446 into master will increase coverage by 0.45%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
pkg/storage/elasticsearch.go 81.53% <ø> (ø) ⬆️
pkg/strategy/controller.go 97.54% <100%> (+0.02%) ⬆️
pkg/strategy/production.go 100% <100%> (+22.58%) ⬆️
pkg/storage/elasticsearch_secrets.go 92.55% <100%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9906da3...eea4ade. Read the comment docs.

@pavolloffay pavolloffay requested a review from objectiser May 28, 2019 17:01
@pavolloffay
Copy link
Member Author

I think this deserves a test

@objectiser
Copy link
Contributor

@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?

@pavolloffay
Copy link
Member Author

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...)
Copy link
Member Author

@pavolloffay pavolloffay May 29, 2019

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.

Copy link
Contributor

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.

@objectiser
Copy link
Contributor

@pavolloffay agree needs a test, but otherwise looks good.

Signed-off-by: Pavol Loffay <[email protected]>
Copy link
Contributor

@objectiser objectiser left a 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.

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")
Copy link
Contributor

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

@pavolloffay pavolloffay merged commit 0a14f3d into jaegertracing:master May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jaeger services failed to deploy, if "es.use-aliases" is enabled
2 participants