-
Notifications
You must be signed in to change notification settings - Fork 126
[Custom Agents] Return the policy name also for 9.x stacks #2761
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
Conversation
This reverts commit a2390d6.
test integrations |
Created or updated PR in integrations repository to test this version. Check elastic/integrations#14653 |
💚 Build Succeeded
History
cc @mrodm |
func getTokenPolicyName(stackVersion, policyName string) string { | ||
if strings.HasPrefix(stackVersion, "7.") { | ||
return "" | ||
} | ||
if policyName == "" { | ||
policyName = defaulFleetTokenPolicyName | ||
} | ||
if strings.HasPrefix(stackVersion, "8.") { | ||
return policyName | ||
} | ||
return "" | ||
// For 8.x and later, we return the given policy name | ||
return policyName | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the one defined in agentdeployer
module.
elastic-package/internal/agentdeployer/kubernetes.go
Lines 258 to 263 in 2f30958
func getTokenPolicyName(stackVersion, policyName string) string { | |
if strings.HasPrefix(stackVersion, "7.") { | |
return "" | |
} | |
return policyName | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one, thanks!
This PR fixes the policy name used in Custom Agents (Deprecated).
with-custom
andsystem-flags
steps in Buildkite.The method needs to take into account also 9.x Elastic stacks.
This should just affect Custom Agents since in the other scenarios Elastic Agents are setup via Independent Elastic Agents (
agentdeployer
module).Relates #2758
How to test this PR locally