License Context
This topic provides a list of the Replicated template functions in the License context.
Template functions in the license context have access to customer license and version data. For more information about managing customer licenses, see About Customers and Licensing.
LicenseFieldValue
func LicenseFieldValue(name string) string
LicenseFieldValue returns the value of the specified license field. LicenseFieldValue accepts custom license fields and all built-in license fields. For a list of all built-in fields, see Built-In License Fields.
LicenseFieldValue always returns a string, regardless of the license field type. To return integer or boolean values, you need to use the ParseInt or ParseBool template function to convert the string value.
String License Field
The following example returns the value of the built-in customerName license field:
customerName: '{{repl LicenseFieldValue "customerName" }}'
Integer License Field
The following example returns the value of a custom integer license field named numSeats:
numSeats: repl{{ LicenseFieldValue "numSeats" | ParseInt }}
This example uses ParseInt to convert the returned value to an integer.
Boolean License Field
The following example returns the value of a custom boolean license field named feature-1:
feature-1: repl{{ LicenseFieldValue "feature-1" | ParseBool }}
This example uses ParseBool to convert the returned value to a boolean.
LicenseDockerCfg
func LicenseDockerCfg() string
LicenseDockerCfg returns a value that can be written to a secret if needed to deploy manually. Replicated KOTS creates and injects this secret automatically in normal conditions, but some deployments (with static, additional namespaces) may need to include this.
apiVersion: v1
kind: Secret
type: kubernetes.io/dockerconfigjson
metadata:
name: myapp-registry
namespace: my-other-namespace
data:
.dockerconfigjson: repl{{ LicenseDockerCfg }}
Sequence
func Sequence() int64
Sequence is the sequence of the application deployed. This will start at 0 for each installation, and increase with every app update, config change, license update and registry setting change.
'{{repl Sequence }}'
Cursor
func Cursor() string
Cursor is the channel sequence of the app.
For instance, if 5 releases have been promoted to the channel that the app is running, then this would return the string 5.
'{{repl Cursor }}'
ChannelName
func ChannelName() string
ChannelName is the name of the deployed channel of the app.
'{{repl ChannelName }}'
VersionLabel
func VersionLabel() string
VersionLabel is the semantic version of the app, as specified when promoting a release to a channel.
'{{repl VersionLabel }}'
ReleaseNotes
func ReleaseNotes() string
ReleaseNotes is the release notes of the current version of the app.
'{{repl ReleaseNotes }}'
IsAirgap
func IsAirgap() bool
IsAirgap is true when the app is installed via uploading an airgap package, false otherwise.
'{{repl IsAirgap }}'
IsRequired
Introduced in KOTS v1.68.0
func IsRequired() bool
IsRequired is true when the release is a required release, false otherwise. Customers can't skip required releases when they update. For more information, see Required releases in About channels and releases.
'{{repl IsRequired }}'
ReplicatedRegistryDomain
Introduced in KOTS v1.100.1
func ReplicatedRegistryDomain() string
Returns the domain of the Replicated registry for the installation. If you configured a custom domain for the Replicated registry, returns the custom domain. Otherwise, returns registry.replicated.com. In KOTS and Embedded Cluster v2 air gap installations, returns an empty string. In Embedded Cluster v3, returns the domain in all installations, including air gap.
For more information, see Use custom domains.
'{{repl ReplicatedRegistryDomain }}'
ReplicatedProxyDomain
Introduced in KOTS v1.100.1
func ReplicatedProxyDomain() string
Returns the domain of the Replicated proxy registry for the installation. If you configured a custom domain for the proxy registry, returns the custom domain. Otherwise, returns proxy.replicated.com. In KOTS and Embedded Cluster v2 air gap installations, returns an empty string. In Embedded Cluster v3, returns the domain in all installations, including air gap.
For more information, see Use custom domains.
'{{repl ReplicatedProxyDomain }}'