-
Notifications
You must be signed in to change notification settings - Fork 262
installer: Integrate multistep cli with configuration #2960
installer: Integrate multistep cli with configuration #2960
Conversation
|
Can one of the admins verify this patch? |
e87e8b9 to
29bc125
Compare
installer/pkg/workflow/terraform.go
Outdated
| return err | ||
| } | ||
| return nil | ||
| const ( |
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'd rather move this constants and findTemplatesForStep to a different package may be utils or step, and keep terraform workflow agnostic, with which is purely terraform
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.
Makes sense, will change that.
|
just had a quick look, is looking great to me.
|
| steps: []Step{ | ||
| terraformPrepareStep, | ||
| assetsStep, | ||
| readClusterConfigStep, |
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.
why is the readClusterConfigStep step needed?
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.
Metadata always just gets the cluster dir:
metadata: metadata{clusterDir: clusterDir}The readClusterConfigStep takes care of ensuring that the config gets parsed, e.g. for cluster Name or Platform.
|
@enxebre can you point me towards the output path where you want the operator yml's to be. I'll include a |
29bc125 to
c613217
Compare
c613217 to
44586b5
Compare
|
@spangenberg the casuistic is as follows:
|
132fe2a to
9f2142a
Compare
alexsomesan
left a comment
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.
Looks good overall.
|
@spangenberg thanks a lot, this is pretty awesome work!
|
9f2142a to
6065cb8
Compare
|
@enxebre thanks, this sounds fantastic. I changed the workflow order that the config yamls will be generated after assets step was run. |
The writeFile helpers are from 2b82fbe (installer: Integrate multistep cli with configuration, 2018-02-16, coreos/tectonic-installer#2960) and 461ff5f (cli: add support for user ignition files, 2018-03-23, coreos/tectonic-installer#3120). But ioutil's function has almost the same signature. Remove our local versions and use the stdlib's instead. The \n addition is because ioutil.WriteFile does not append newlines (which workflow.writeFile did via Fprintln). I've used os.Create's 0666 [1] in most cases; callers can set a umask if they want to restrict that. The exception is in generatePrivateKey, where I've set 0600 to avoid leaking a private key even in the presence of a weak umask. [1]: https://golang.org/pkg/os/#Create
This code is descended from terraformPrepareStep, which landed in 1b4bb62 (Cli tool, 2018-02-05, coreos/tectonic-installer#2806). The workspace version was factored out into copyFile in 2b82fbe (installer: Integrate multistep cli with configuration, 2018-02-16, coreos/tectonic-installer#2960). The config-generator version was copy/pasted (or independently developed?) in 1d54899 (installer/pkg/config-generator/tls: generate root CA's with go, 2018-06-28, coreos/tectonic-installer#3316). This commit DRYs that up by pulling the duplicate code out into a shared package. I've also changed O_RDWR to O_WRONLY. The O_RDWR is originally from 1b4bb62, but we do not require the ability to read from the target file. Also add a unit test to exercise this code.
…mands 2b82fbe (installer: Integrate multistep cli with configuration, 2018-02-16, coreos/tectonic-installer#2960) shifted it into the middle of the smaller install subcommands. But because: * those smaller subcommands are, with the exception of newtls, subsets of full, and * full is the default action, I think it makes more sense to move it back to the top.
No description provided.