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

Load elasticsearch auth token from file #1319

Merged
merged 4 commits into from Feb 8, 2019

Conversation

pavolloffay
Copy link
Member

In k8s the auth token (serviceaccount) is injected to pod.

Signed-off-by: Pavol Loffay ploffay@redhat.com

flagSet.String(
nsConfig.namespace+suffixTokenPath,
nsConfig.TokenFilePath,
"Path to a file containing bearer token. This flag also uses "+suffixCA+" if it is specified")
Copy link
Contributor

Choose a reason for hiding this comment

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

suffixCA or suffixTokenPath? I think it might be implicit, but the token is the whole content of the file, right? Perhaps we could make it more explicit?

Copy link
Member Author

Choose a reason for hiding this comment

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

suffixCA, it's not a bad thing to have more explanatory docs. I didn't know that we need root CA at all when using token.

Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't use the constant in the help message. It starts with a dot and will look weird. Just say CA.

flagSet.String(
nsConfig.namespace+suffixTokenPath,
nsConfig.TokenFilePath,
"Path to a file containing bearer token. This flag also uses "+suffixCA+" if it is specified")
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't use the constant in the help message. It starts with a dot and will look weird. Just say CA.

@@ -76,11 +76,13 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger)

primaryClient, err := f.primaryConfig.NewClient(logger, metricsFactory)
if err != nil {
f.logger.Error("failed to create primary Elasticsearch client", zap.Error(err))
Copy link
Member

Choose a reason for hiding this comment

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

Logging should happen in main. We may want to call errors.Wrap() here

@pavolloffay pavolloffay mentioned this pull request Feb 8, 2019
4 tasks
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@codecov
Copy link

codecov bot commented Feb 8, 2019

Codecov Report

Merging #1319 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1319   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files         162     162           
  Lines        7277    7282    +5     
======================================
+ Hits         7277    7282    +5
Impacted Files Coverage Δ
plugin/storage/es/options.go 100% <100%> (ø) ⬆️
plugin/storage/es/factory.go 100% <100%> (ø) ⬆️

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 f445c1d...46081d5. Read the comment docs.

@pavolloffay pavolloffay merged commit b6fce7d into jaegertracing:master Feb 8, 2019
@ghost ghost removed the review label Feb 8, 2019
iori-yja pushed a commit to iori-yja/jaeger that referenced this pull request Feb 15, 2019
* Load elasticsearch auth token from file

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Wrap errors

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix lint

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix test

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Iori Yoneji <fivo.11235813@gmail.com>
iori-yja pushed a commit to iori-yja/jaeger that referenced this pull request Feb 15, 2019
* Load elasticsearch auth token from file

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Wrap errors

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix lint

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix test

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
iori-yja pushed a commit to iori-yja/jaeger that referenced this pull request Feb 15, 2019
* Load elasticsearch auth token from file

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Wrap errors

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix lint

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix test

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
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.

None yet

4 participants