-
Notifications
You must be signed in to change notification settings - Fork 93
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
Use rendered kots kinds #4239
Use rendered kots kinds #4239
Conversation
@@ -600,16 +591,14 @@ func Pull(upstreamURI string, pullOptions PullOptions) (string, error) { | |||
} | |||
} | |||
|
|||
installationBytes, err := ioutil.ReadFile(filepath.Join(u.GetUpstreamDir(writeUpstreamOptions), "userdata", "installation.yaml")) | |||
// installation spec gets updated during the process, ensure the map has the latest version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this point, would the renderedKotsKinds.Installation
be the same as what's in upstream/userdata/installation.yaml
? just curious why we need to reload it from the archive vs marshaling what we have in renderedKotsKinds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they would be the same, yes. it didn't really matter which one to use. i decided to load it from the upstream directory just to make sure it's definitely the same, and just in case someone forgets to update the renderedKotsKinds
object in a later change.
return "", errors.Wrap(err, "failed to load rendered kotskinds from map") | ||
} | ||
|
||
needsConfig, err := kotsadmconfig.NeedsConfiguration(pullOptions.AppSlug, pullOptions.AppSequence, pullOptions.AirgapRoot != "", renderedKotsKinds, registrySettings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this happened before attempting to render base because of things like this https://app.testim.io/#/project/wpYAooUimFDgQxY73r17/branch/use-rendered-kots-kinds/test/8lupz8KBYa9SGzDO/step/mFwAJVtdRncnSncN/viewer/screenshots?result-id=QSkV5cWC3frZ0dZI&path=s2IRYvVg6O8W5IWX%3AmFwAJVtdRncnSncN
@@ -444,7 +439,7 @@ func tryGetConfigFromFileContent(content []byte, log *logger.CLILogger) *kotsv1b | |||
return nil | |||
} | |||
|
|||
func getKotsKinds(u *upstreamtypes.Upstream) (*kotsutil.KotsKinds, error) { | |||
func getTemplatingKotsKinds(u *upstreamtypes.Upstream) (*kotsutil.KotsKinds, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be good to add a comment for this indicating what "templating kots kinds" is. assuming it's the kots kinds that are needed to render template functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and correct.
What this PR does / why we need it:
Uses rendered KOTS kinds whenever they're available. This is a step forward to support templating for all KOTS kinds fields.
Which issue(s) this PR fixes:
Fixes:
Special notes for your reviewer:
Steps to reproduce
Does this PR introduce a user-facing change?
Does this PR require documentation?
TBD