Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit f568f22

Browse files
authored
Merge pull request #904 from divolgin/ch19623
Replace `ReleaseMeta` and `EntitlementsYAML` functions with `ShipCustomerRelease`
2 parents a0819a2 + ce5690b commit f568f22

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

pkg/templates/installation_context.go

+4-14
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (ctx *InstallationContext) entitlementValue(name string) string {
3333
return ""
3434
}
3535

36-
func (ctx *InstallationContext) releaseMeta() string {
36+
func (ctx *InstallationContext) shipCustomerRelease() string {
3737
data, err := yaml.Marshal(ctx.Meta)
3838
if err != nil {
3939
level.Error(ctx.Logger).Log("msg", "unable to marshal release meta", "err", err)
@@ -42,21 +42,11 @@ func (ctx *InstallationContext) releaseMeta() string {
4242
return string(data)
4343
}
4444

45-
func (ctx *InstallationContext) entitlementsYAML() string {
46-
data, err := yaml.Marshal(ctx.Meta.Entitlements)
47-
if err != nil {
48-
level.Error(ctx.Logger).Log("msg", "unable to marshal entitlements", "err", err)
49-
return ""
50-
}
51-
return string(data)
52-
}
53-
5445
func (ctx *InstallationContext) FuncMap() template.FuncMap {
5546
return template.FuncMap{
56-
"ReleaseMeta": ctx.releaseMeta,
57-
"EntitlementsYAML": ctx.entitlementsYAML,
58-
"EntitlementValue": ctx.entitlementValue,
59-
"LicenseFieldValue": ctx.entitlementValue,
47+
"ShipCustomerRelease": ctx.shipCustomerRelease,
48+
"EntitlementValue": ctx.entitlementValue,
49+
"LicenseFieldValue": ctx.entitlementValue,
6050
"Installation": func(name string) string {
6151
switch name {
6252
case "state_file_path":

0 commit comments

Comments
 (0)