Skip to content
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

feat: add more built-in templates to Zarf templating #2330

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
9 changes: 9 additions & 0 deletions src/internal/packager/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,30 @@ func (values *Values) GetVariables(component types.ZarfComponent) (templateMap m
if values.config.State != nil {
regInfo := values.config.State.RegistryInfo
gitInfo := values.config.State.GitServer
artInfo := values.config.State.ArtifactServer

builtinMap := map[string]string{
Noxsios marked this conversation as resolved.
Show resolved Hide resolved
"STORAGE_CLASS": values.config.State.StorageClass,

// Registry info
"REGISTRY": values.registry,
"NODEPORT": fmt.Sprintf("%d", regInfo.NodePort),
"REGISTRY_PUSH": regInfo.PushUsername,
"REGISTRY_AUTH_PUSH": regInfo.PushPassword,
"REGISTRY_PULL": regInfo.PullUsername,
"REGISTRY_AUTH_PULL": regInfo.PullPassword,

// Git server info
"GIT_URL": gitInfo.Address,
"GIT_PUSH": gitInfo.PushUsername,
"GIT_AUTH_PUSH": gitInfo.PushPassword,
"GIT_PULL": gitInfo.PullUsername,
"GIT_AUTH_PULL": gitInfo.PullPassword,

// Artifact server info
"ARTIFACT_URL": artInfo.Address,
"ARTIFACT_PUSH": artInfo.PushUsername,
"ARTIFACT_AUTH_PUSH": artInfo.PushToken,
}

// Include the data injection marker template if the component has data injections
Expand Down
Loading