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

FieldManager add namespace for Aeraki #338

Closed
wants to merge 1 commit into from

Conversation

tanjunchen
Copy link
Member

What this PR does / Why we need it:

Pre-Submission Checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added related test cases?
  • Have you modified the related document?
  • Is this PR backward compatible?

Comment on lines 26 to 27
// True: The generated envoyFilters will be placed under the service namespace
DefaultAerakiEnableEnvoyFilterNsScopeName = "AERAKI_ENABLE_ENVOY_FILTER_NS_SCOPE"
Copy link
Member

Choose a reason for hiding this comment

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

I prefer “AerakiEnableEnvoyFilterNsScope” because it's just a env name, not a default value.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok.update it.

LabelSelector: "manager=" + constants.AerakiFieldManager,
})
listNamespace := ""
if c.namespaceScoped {
Copy link
Member

Choose a reason for hiding this comment

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

Envoyfilters can exist in multiple namespaces, not only in the root namespace.

Copy link
Member Author

Choose a reason for hiding this comment

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

update it.

@tanjunchen tanjunchen changed the title optimize code for AERAKI_ENABLE_ENVOY_FILTER_NS_SCOPE for aeraki FieldManager add namespace for Aeraki Apr 20, 2023
Signed-off-by: chentanjun <tanjunchen20@gmail.com>
// DefaultAerakiEnableEnvoyFilterNsScope is the name for Aeraki to place envoyFilters scope
// False(Default): The generated envoyFilters will be placed under Istio root namespace
// True: The generated envoyFilters will be placed under the service namespace
DefaultAerakiEnableEnvoyFilterNsScope = "AERAKI_ENABLE_ENVOY_FILTER_NS_SCOPE"
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just AerakiEnableEnvoyFilterNsScope as it's an Env name, not a default value.

@@ -105,7 +107,7 @@ func (c *namespaceController) createBootstrapConfigMap(ns string) {
"custom_bootstrap.json": GetBootstrapConfig(c.AerakiAddr, c.AerakiPort),
}
if err := c.Client.Create(context.TODO(), cm, &controllerclient.CreateOptions{
FieldManager: constants.AerakiFieldManager,
FieldManager: constants.AerakiFieldManager + "-" + c.rootNamespace,
Copy link
Member

Choose a reason for hiding this comment

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

There're two problems here:

  • The change of FieldManager will break existing Aeraki deployment since old resources were created with “constants.AerakiFieldManager", the change should be back compatible
  • I prefer geting FiledManager value from a central place rather than passing rootNamespace around everywhere

@zhaohuabing
Copy link
Member

Hold this until we have a clear design how multi-tenants would work.

@zhaohuabing
Copy link
Member

This PR is related to #330

@stale
Copy link

stale bot commented Jun 22, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 22, 2023
@stale stale bot closed this Jun 29, 2023
@tanjunchen
Copy link
Member Author

/reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants