-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Get Cloud Foundry application name from Cloud Controller API #7483
Conversation
6d62cdf
to
b800c12
Compare
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.
👍 YAML LGTM
2b7ccb2
to
0c5a349
Compare
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.
Looks great, a few nits and questions.
@@ -83,7 +83,7 @@ func matchYAMLKey(key string) *regexp.Regexp { | |||
// matchYAMLKeyEnding returns a regexp matching a single YAML line with a key ending by the string passed as argument. | |||
// The returned regexp catches only the key and not the value. | |||
func matchYAMLKeyEnding(ending string) *regexp.Regexp { | |||
return regexp.MustCompile(fmt.Sprintf(`(\s*(\w|_)*%s\s*:).+`, ending)) | |||
return regexp.MustCompile(fmt.Sprintf(`(^\s*(\w|_)*%s\s*:).+`, ending)) |
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.
Is that an intended change?
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.
Yes. Problem was that I can have an error message like failure to get oauth token: err here
, which would end up redacted because this function is called with a token
ending http://github.com/Datadog/datadog-agent/blob/0c5a349103ba5dc611c2e5b8f85e7c1fb8e9ba3c/pkg/util/log/strip.go#L57-L57.
Since the regex here is intended to match on yaml keys, I figured matching a beginning of line would not cause problems
c64301f
to
3d47d5f
Compare
What does this PR do?
Get a list of applications from the cloud controller API to get up to date names since the BBS API provided one never changes upon renames
Motivation
Useful for people using blue/green deployment scheme for their applications, making heavy use of renaming
Additional Notes
Anything else we should know when reviewing?
Describe your test plan
Unit tests and manual tests on lab environment