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

Commit

Permalink
Merge pull request #904 from divolgin/ch19623
Browse files Browse the repository at this point in the history
Replace `ReleaseMeta` and `EntitlementsYAML` functions with `ShipCustomerRelease`
  • Loading branch information
divolgin committed Apr 9, 2019
2 parents a0819a2 + ce5690b commit f568f22
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions pkg/templates/installation_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (ctx *InstallationContext) entitlementValue(name string) string {
return ""
}

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

func (ctx *InstallationContext) entitlementsYAML() string {
data, err := yaml.Marshal(ctx.Meta.Entitlements)
if err != nil {
level.Error(ctx.Logger).Log("msg", "unable to marshal entitlements", "err", err)
return ""
}
return string(data)
}

func (ctx *InstallationContext) FuncMap() template.FuncMap {
return template.FuncMap{
"ReleaseMeta": ctx.releaseMeta,
"EntitlementsYAML": ctx.entitlementsYAML,
"EntitlementValue": ctx.entitlementValue,
"LicenseFieldValue": ctx.entitlementValue,
"ShipCustomerRelease": ctx.shipCustomerRelease,
"EntitlementValue": ctx.entitlementValue,
"LicenseFieldValue": ctx.entitlementValue,
"Installation": func(name string) string {
switch name {
case "state_file_path":
Expand Down

0 comments on commit f568f22

Please sign in to comment.