Skip to content

Conversation

@benluddy
Copy link
Contributor

@benluddy benluddy commented Nov 1, 2022

  • Removes references from sample config file.
  • Remove defaulting behavior from ReadAndValidate.
  • Don't try to load from file if no config file path is available.

- Removes references from sample config file.
- Remove defaulting behavior from ReadAndValidate.
- Don't try to load from file if no config file path is available.
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2022
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 1, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 1, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benluddy, dinhxuanvu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

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

@benluddy
Copy link
Contributor Author

benluddy commented Nov 1, 2022

/cc @dhellmann

@openshift-ci openshift-ci bot requested a review from dhellmann November 1, 2022 15:59
@benluddy
Copy link
Contributor Author

benluddy commented Nov 1, 2022

/retest-required

}
if err := c.ReadFromConfigFile(configFile); err != nil {
return err
if configFile != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should an empty filename be an error now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't in the past -- that seems to have been an inadvertent change of the original PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it makes sense to bring that back when we drop the environment variable stuff? Let's think about it and do it separately if we decide we want it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/hold

For this PR, are you proposing that it should be a fatal error if neither a user nor a global config file exists? This has historically been treated as though there were an existent-but-empty config file, and only became an error in #1026 (comment). My first reaction was to restore the original behavior since there had been no discussion/intent to change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was proposing that this function consider an empty string an invalid filename. If we're saying the file doesn't have to exist (that makes sense), and the caller might pass an empty string when there is no file to read, then this function could treat the empty string as not an error.

Copy link
Contributor

Choose a reason for hiding this comment

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

As it is, MicroShift follows your latter logic. The configFile is set by the findConfigFile() func (L143), which will return an empty string if no file is found. The empty string value should continue to be interpreted as "use defaults" rather than throwing a fatal 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.

/unhold

The original behavior (i.e. to work without a config file) makes sense to me. I'm going to proceed with restoring it in this PR. If that behavior's not desirable, it can be changed deliberately sometime later.

return err
}
}
if err := c.ReadFromEnv(); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could drop the environment variable stuff at some point, too. That was for configuring a container version, and we don't support deploying that way.

@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Nov 1, 2022
@benluddy
Copy link
Contributor Author

benluddy commented Nov 1, 2022

/retest-required

@dinhxuanvu
Copy link
Member

/test e2e-openshift-conformance-sig-api-machinery

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 2, 2022

@benluddy: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

@openshift-merge-robot openshift-merge-robot merged commit fb290ba into openshift:main Nov 2, 2022
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants