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

assets/installconfig: apply defaults to install config #902

Closed
wants to merge 2 commits into from
Closed

assets/installconfig: apply defaults to install config #902

wants to merge 2 commits into from

Conversation

staebler
Copy link
Contributor

@staebler staebler commented Dec 13, 2018

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.

baseDomain: <<your base domain>>
metadata:
  name: <<your cluster name>>
platform:
  aws:
    region: <<aws region>>
pullSecret: <<your pull secret>>
sshKey: <<your ssh key>>

This is the minimum file needed for a Libvirt install-config.yml.

baseDomain: <<your base domain>>
metadata:
  name: <<your cluster name>>
platform:
  libvirt:
    URI: <<your libvirtd uri>>
pullSecret: <<your pull secret>>
sshKey: <<your ssh key>>

An invocation of openshift-install create install-config will output these minimum files (with the addition of the superfluous .metadata.creationTimestamp).

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 13, 2018
@abhinavdahiya
Copy link
Contributor

@staebler this is 💯 🔥
just a comment nit.

/approve

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 15, 2018
@cgwalters
Copy link
Member

cgwalters commented Dec 20, 2018

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.

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 20, 2018
@@ -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
Copy link
Contributor

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.

Copy link
Contributor

@abhinavdahiya abhinavdahiya Dec 20, 2018

Choose a reason for hiding this comment

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

Copy link
Contributor

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?

Copy link
Member

@wking wking Jan 4, 2019

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 21, 2018
@cgwalters
Copy link
Member

@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.
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 10, 2019
@staebler
Copy link
Contributor Author

/retest

The installer will include the default values that it supplies in the
install-config.yaml written to disk when targeting install-config.
@wking
Copy link
Member

wking commented Jan 12, 2019

/retest

@abhinavdahiya
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2019
@openshift-ci-robot
Copy link
Contributor

[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:
  • OWNERS [abhinavdahiya,staebler]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@crawford
Copy link
Contributor

A lot of failures due to etcd being unavailable...

/retest

@wking
Copy link
Member

wking commented Jan 12, 2019

This conflicts with the just-landed #1052. I'll rebase on top.

/close

@openshift-ci-robot
Copy link
Contributor

@staebler: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws 6c8f95c link /test e2e-aws
ci/prow/unit 6c8f95c link /test unit
ci/prow/shellcheck 6c8f95c link /test shellcheck
ci/prow/tf-fmt 6c8f95c link /test tf-fmt
ci/prow/tf-lint 6c8f95c link /test tf-lint
ci/prow/yaml-lint 6c8f95c link /test yaml-lint
ci/prow/govet 6c8f95c link /test govet
ci/prow/images 6c8f95c link /test images
ci/prow/rhel-images 6c8f95c link /test rhel-images

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.

@wking
Copy link
Member

wking commented Jan 12, 2019

Carried with #1058

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants