Skip to content

Conversation

@farodin91
Copy link
Contributor

@farodin91 farodin91 commented Jul 26, 2022

Fixes #1902 unable to override scope prefix

@farodin91
Copy link
Contributor Author

@FxKu Would you like to review?

@farodin91
Copy link
Contributor Author

@sdudoladov Would you like to review?

@FxKu
Copy link
Member

FxKu commented Aug 23, 2022

@farodin91 the clone and standby description would be overridable if you move line 910 - 916 before line 939. Then cluster-specfic env var as well as environment configmap or secret come first. No need to add another overridableEnvs list.

You would have to adjust unit test though, because order of variables and overriding behavior changes. The new order must be reflected in the docs, too (2. and 3. becoming 5. and 6.).

@FxKu FxKu added this to the 1.9 milestone Aug 23, 2022
@farodin91 farodin91 force-pushed the allow-to-override-scope-prefix branch from 4c79669 to b6741ce Compare August 24, 2022 06:51
@farodin91
Copy link
Contributor Author

@FxKu I updated the behavior.

@farodin91
Copy link
Contributor Author

@FxKu Do you have time to look into it?

@FxKu
Copy link
Member

FxKu commented Sep 28, 2022

@farodin91 yes. LGTM. Will merge next week when I‘m back from vacation.

@FxKu
Copy link
Member

FxKu commented Oct 18, 2022

@farodin91 can you rebase the PR, please? #2045 introduced some minor changes to env var generation. Thank you :)

@FxKu FxKu changed the title Allow to override scope prefix Allow to override clone and standby description Oct 18, 2022
Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
@farodin91 farodin91 force-pushed the allow-to-override-scope-prefix branch from b6741ce to 3a9256f Compare October 18, 2022 12:34
@farodin91 farodin91 requested a review from hughcapet as a code owner October 18, 2022 12:34
@farodin91
Copy link
Contributor Author

@FxKu Rebased.

@FxKu
Copy link
Member

FxKu commented Oct 24, 2022

@farodin91 Thanks! I gave this a second thought and now having doubts that this is right approach. Global config (like from pod_environment_configmap/secret) should not override local config (like clone and standby sections). Especially for CloneDescription we already have fields like S3AccessKeyId where one would expect that it overrides CLONE_AWS_ACCESS_KEY_ID from a global config map.

In that regard, having spec.Env before generateCloneEnvironment etc. is fine. This would also allow you to override the CLONE_WAL_BUCKET_SCOPE_PREFIX. I know, doing this in every manifest is not what you aim for.

Why do you want to set the prefix in the first place? Note, that it has to be empty when wal path is set (manifest or config). This was the behavior ever since except for version 1.8.0 and 1.8.1 where it was forgotten by mistake. Is it empty in your case? That's the only case I see now, where we should not set it to "". Are there more fields you want to override from what is set in generateCloneEnvironment?

@farodin91
Copy link
Contributor Author

For me, it just CLONE_WAL_BUCKET_SCOPE_PREFIX. I could built a code section to set empty if not set, at the end.

We use the prefix for the cluster name.

@FxKu
Copy link
Member

FxKu commented Jan 5, 2023

with #2159 merged I would close this PR now. You can now override CLONE_WAL_BUCKET_SCOPE_PREFIX per cluster in via manifest Env section.

In order to do it globally, we would have to move only the _PREFIX setting from generate[Clone|Standby]Environment about after fetching variables from secret / config map. Feel free to reopen if you want to continue working on it.

Thanks again for bringing it up.

@FxKu FxKu closed this Jan 5, 2023
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.

2 participants