-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
assets/installconfig: apply defaults to install config #902
Conversation
@staebler this is 💯 🔥 /approve |
It looks like this should be complementary with #856 in that libvirt users should no longer need to specify the URI. EDIT: Nope, this is a more general and better PR! However I think the improvements in 856 are still useful, but I'll rebase it after this lands. |
@@ -124,6 +78,16 @@ func (a *InstallConfig) Generate(parents asset.Parents) error { | |||
Data: data, | |||
} | |||
|
|||
// Apply the defaults *after* marshaling into yaml so that the defaults |
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 am a little concerned. So the asset has 2 values of the install-config. one in File
and other in Config
.
And in the past people have tried to use Files()
on an asset and decode rather than using the type.
Also, another thing which is more of a personal preference.
getting the install-config with values defaults is a good representation of what the installer has chosen for you and what you can modify for yourself.
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.
^^ thoughts @crawford @wking @cgwalters @staebler
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.
Hrmmmmmmmmmmm. I think I'd prefer if the install-config contained the defaults. Can we do any tricks to comment out the defaults but still include them?
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.
Can we do any tricks to comment out the defaults but still include them?
This sounds really complicated.
As long as the installer handles default-injection after loading an install-config, I don't really care whether we include defaults in configs we write to disk or not.
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.
Can we change this so that the defaults are included? We can provide documentation to show which fields can be safely omitted for users who want to slim down.
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.
Sure. I'll make that change right after I put the kids to bed.
@staebler are you planning to rebase this? I think being able to reuse an install config but still fetch the latest RHCOS is absolutely essential for development. |
The Install Config asset will apply defaults to fields for which there are reasonable defaults. This applies to a generated Install Config asset and to an Install Config asset loaded from disk.
/retest |
The installer will include the default values that it supplies in the install-config.yaml written to disk when targeting install-config.
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, staebler The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
A lot of failures due to etcd being unavailable... /retest |
This conflicts with the just-landed #1052. I'll rebase on top. /close |
@staebler: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Carried with #1058 |
The Install Config asset will apply defaults to fields for which there are reasonable defaults. This applies to a generated Install Config asset and to an Install Config asset loaded from disk.
Note that the ClusterID asset has been removed in favor of generating a value for ClusterID when applying defaults. This is not meant to supersede any active work to remove the ClusterID from the install config. It is only meant to provide a temporary means by which a user can supply an install-config.yml without a ClusterID.
This is the minimum file needed for an AWS install-config.yml.
This is the minimum file needed for a Libvirt install-config.yml.
An invocation of
openshift-install create install-config
will output these minimum files (with the addition of the superfluous.metadata.creationTimestamp
).