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

[Merged by Bors] - fixup ability to detect MAP BOX API key and add it to the environment… #178

Closed
wants to merge 7 commits into from

Conversation

rsiwicki
Copy link
Contributor

@rsiwicki rsiwicki commented Apr 19, 2022

… if present.

Description

Addition of ability to add the lookup for the MAP_BOX_API key that Superset can use to obtain geo information and map backgrounds for lat / long style queries.

Review Checklist

  • Code contains useful comments
  • (Integration-)Test cases added (or not applicable)
  • Documentation added (or not applicable)
  • Changelog updated (or not applicable)
  • Cargo.toml only contains references to git tags (not specific commits or branches)
  • Helm chart can be installed and deployed operator works (or not applicable)

Once the review is done, comment bors r+ (or bors merge) to merge. Further information

@stackable-bot
Copy link
Contributor

stackable-bot commented Apr 19, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@razvan razvan left a comment

Choose a reason for hiding this comment

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

Hi Rob, thanks for your PR. Unless I'm missing something, this can be reduced to a single call like this:

cb.add_env_var_from_secret("MAPBOX_API_KEY", &value, "connections.mapBoxApiKey");

similar to the way it's done in lines 401 and 402.

@sbernauer
Copy link
Member

I think @razvan's suggestion is the way to go. Here are also some points that might interest you describing why the current approach of the PR is not optimal. Hope they are helpful :)

  1. The credentials (api key) will be written in clear text in the StatefulSet Manifest which can be pretty dangerous
  2. The operator now reads the credentials, which we try to avoid
  3. We would have to watch the secret for changes and reconcile. When we just reference the Secret as suggested by @razvan restart-controller handles this for us automatically

@rsiwicki
Copy link
Contributor Author

@sbernauer @razvan - have simplified this to use optional crd property for mapbox api key.

Copy link
Member

@razvan razvan left a comment

Choose a reason for hiding this comment

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

lgtm

@razvan
Copy link
Member

razvan commented Apr 20, 2022

bors merge

bors bot pushed a commit that referenced this pull request Apr 20, 2022
#178)

… if present.

## Description

Addition of ability to add the lookup for the MAP_BOX_API key that Superset can use to obtain geo information and map backgrounds for lat / long style queries.



Co-authored-by: Razvan-Daniel Mihai <[email protected]>
@bors
Copy link
Contributor

bors bot commented Apr 20, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title fixup ability to detect MAP BOX API key and add it to the environment… [Merged by Bors] - fixup ability to detect MAP BOX API key and add it to the environment… Apr 20, 2022
@bors bors bot closed this Apr 20, 2022
@sbernauer
Copy link
Member

Great, thanks!
I just noticed that the Env Variable gets set but the superset_config.py doesn't use it. Shouldn't we need to add something like MAPBOX_API_KEY = os.environ.get("MAPBOX_API_KEY") to the superset_config.py?

@rsiwicki
Copy link
Contributor Author

@sbernauer - yes I think that would make sense.

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.

4 participants