-
Notifications
You must be signed in to change notification settings - Fork 403
Add support for defining labels in Helm Broker bundles #1444
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
d3c771c
to
783a2ab
Compare
783a2ab
to
28438be
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.
FYI
metaCopy.Labels = map[string]string{} | ||
} | ||
// Business requirement that helm bundles are always treated as local | ||
metaCopy.Labels["local"] = "true" |
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.
FYI: hardcoded here, can be replaced with
for k, v := range overridesForPlanLabels {
metaCopy.Labels[k] = v
}
where globaly we have
var overridesForPlanLabels = map[string]string{
// Business requirement that helm bundles are always treated as local
"local": "true",
}
but IMO for now it's not necessary.
@@ -69,60 +76,40 @@ func TestGetCatalogOnConversionError(t *testing.T) { | |||
func TestBundleConversion(t *testing.T) { |
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.
Refactor inspired by golden testing, see: https://golang.org/src/go/doc/doc_test.go#L119
updateGoldenFileIfRequested(t, goldenPath, normalizedGotSvc) | ||
|
||
exp := tc.fixtureMarshaledOsbService(t, goldenPath) | ||
assert.JSONEq(t, exp, string(normalizedGotSvc)) |
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.
I tried to assert on Go obj
using sth like that:
func fixtureOsbService(t *testing.T, testdataBasePath string) osb.Service {
data, err := ioutil.ReadFile(testdataBasePath)
require.NoError(t, err, "failed reading .golden")
out := osb.Service{}
require.NoError(t, json.Unmarshal(data, &out))
return out
}
Unfortunately kinds are different, e.g. map[string]string
vs Labels
where Labels
is type Labels map[string]string
. Then in the assertion, it cannot be compared easily. Because of that, I decided to normalize it to the JSON form.
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.
lgtm
Description
Changes proposed in this pull request:
Related issue(s)