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

templating: fallbacks to ease migration from console-flavored ship #884

Merged
merged 1 commit into from
Mar 26, 2019

Conversation

dexhorthy
Copy link
Member

@dexhorthy dexhorthy commented Mar 26, 2019

What I Did

  • In {{repl Installation "installation_id"}}, if license_id was used to fetch, template in the license id value
  • In {{repl Installation "license_id"}}, if installation_id was used to fetch, template in the installation id value
  • Add {{repl LicenseFieldValue "FIELD_KEY"}} as an alias for `{{repl EntitlementValue "FIELD_KEY"}}

How to verify it

  • ship init replicated.app/slug?license_id=..., ensure `{{repl
    Installation "installation_id"}} emits the given license ID.

and so on

Description for the Changelog

  • In {{repl Installation "installation_id"}}, if license_id was used to fetch, template in the license id value
  • In {{repl Installation "license_id"}}, if installation_id was used to fetch, template in the installation id value
  • Add {{repl LicenseFieldValue "FIELD_KEY"}} as an alias for {{repl EntitlementValue "FIELD_KEY"}}

migrate the vendors

What I Did
------------

- In `{{repl Installation "installation_id"}}, if `license_id` was used to fetch, template in the license id value
- In `{{repl Installation "license_id"}}, if `installation_id` was used to fetch, template in the installation id value
- Add `{{repl LicenseFieldValue "FIELD_KEY"}} as an alias for `{{repl EntitlementValue "FIELD_KEY"}}

How to verify it
------------

- ship init replicated.app/slug?license_id=..., ensure `{{repl
Installation "installation_id"}} emits the given license ID.

and so on

Description for the Changelog
------------

- In `{{repl Installation "installation_id"}}, if `license_id` was used to fetch, template in the license id value
- In `{{repl Installation "license_id"}}, if `installation_id` was used to fetch, template in the installation id value
- Add `{{repl LicenseFieldValue "FIELD_KEY"}} as an alias for `{{repl EntitlementValue "FIELD_KEY"}}
level.Debug(ctx.Logger).Log("event", "EntitlementValue.empty")
return ""
}
func (ctx *InstallationContext) entitlementValue(name string) string {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird whitespace things happening here because I pulled this up to a standalone function instead of inline.

@marccampbell
Copy link
Member

Nice. Since "installation_id" and "license_id" are actually the same value, this is good. The work we did to rename the field should have left the old names as alias.

Thanks for adding!

@dexhorthy dexhorthy merged commit bca55d2 into replicatedhq:master Mar 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants