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

cleanup(cmd,internal,pkg): move driver config options to be common to all driver commands #365

Merged
merged 2 commits into from Dec 6, 2023

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Dec 5, 2023

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

/area library
/area cli

What this PR does / why we need it:

This way all driver commands can customize their run with both CLI args or env variables, without actually storing anything in the config file.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

…ll `driver` commands.

This way all driver commands can customize their run with both CLI args or env variables,
without actually storing anything in the config file.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
}
}

if driverTypes.String() != "auto" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here we load driver.Type from given driverTypes enum parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We now support auto logic for all driver commands.
This can be useful to eg: test with driver printenv which driver is being discovered for auto driver type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or, to store driver config with correct driver built from automatic discovered one (when using driver config --type auto).

return fmt.Errorf("automatic driver selection failed")
}
}
return driver.Validate()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the end, we validate driver options.

cmd/driver/install/install.go Outdated Show resolved Hide resolved
@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 5, 2023

/milestone v0.7.0

@poiana poiana added this to the v0.7.0 milestone Dec 5, 2023
@FedeDP FedeDP changed the title new(cmd,internal,pkg): move driver config options to be common to all driver commands cleanup(cmd,internal,pkg): move driver config options to be common to all driver commands Dec 5, 2023
…nds.

Moreover, enforce that driver version is a semver and repos is a list of requestURI.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
}
}

if driverTypes.String() != "auto" {
Copy link
Member

Choose a reason for hiding this comment

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

const?

Copy link
Member

Choose a reason for hiding this comment

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

@FedeDP just nit

@poiana poiana added the lgtm label Dec 6, 2023
@poiana
Copy link
Contributor

poiana commented Dec 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, leogr

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit c19ca32 into main Dec 6, 2023
14 checks passed
@poiana poiana deleted the new/driver_options_common branch December 6, 2023 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants