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

Add ClusterProfile template variable #483

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/payload/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ const (

cincinnatiJSONFile = "release-metadata"
imageReferencesFile = "image-references"

defaultClusterProfile = "self-managed-high-availability"
)

// Update represents the contents of a release image.
Expand Down Expand Up @@ -279,7 +281,10 @@ func getPayloadTasks(releaseDir, cvoDir, releaseImage string) []payloadTasks {
cjf := filepath.Join(releaseDir, cincinnatiJSONFile)
irf := filepath.Join(releaseDir, imageReferencesFile)

mrc := manifestRenderConfig{ReleaseImage: releaseImage}
mrc := manifestRenderConfig{
ReleaseImage: releaseImage,
ClusterProfile: defaultClusterProfile,
}

return []payloadTasks{{
idir: cvoDir,
Expand Down
8 changes: 6 additions & 2 deletions pkg/payload/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ func Render(outputDir, releaseImage string) error {
bootstrapDir = "/bootstrap"
oBootstrapDir = filepath.Join(outputDir, "bootstrap")

renderConfig = manifestRenderConfig{ReleaseImage: releaseImage}
renderConfig = manifestRenderConfig{
ReleaseImage: releaseImage,
ClusterProfile: defaultClusterProfile,
}
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure who calls this function? Is it installer during bootstrap?

Copy link
Member

Choose a reason for hiding this comment

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

I mean Render(outputDir, releaseImage string) error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The env. variable is not plugged yet. This PR just teaches enough to the CVO for updating to a CVO that uses ClusterProfile in his manifests.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like the the PR for env variable already merged for installer.

)

tasks := []struct {
Expand Down Expand Up @@ -102,7 +105,8 @@ func renderDir(renderConfig manifestRenderConfig, idir, odir string, skipFiles s
}

type manifestRenderConfig struct {
ReleaseImage string
ReleaseImage string
ClusterProfile string
}

// renderManifest Executes go text template from `manifestBytes` with `config`.
Expand Down