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

Api deprecation changes #208

Merged
merged 4 commits into from
Sep 8, 2020
Merged

Api deprecation changes #208

merged 4 commits into from
Sep 8, 2020

Conversation

nabhajit-ray
Copy link
Collaborator

Description

[Api deprecation changes]

Issues Resolved

[]

Check List

  • New functionality includes testing.
    • All tests pass for go 1.11 + gofmt checks.
  • New functionality has been documented in the README if applicable.
    • New functionality has been thoroughly documented in the examples (please include helpful comments).
    • New endpoints supported are updated in the endpoints-support.md file.
  • Changes are documented in the CHANGELOG.

c.OVAPIVersion = apiver.CurrentVersion
} else if c.OVAPIVersion < apiver.MinimumVersion {
//Throw error if provided api version is not supported
return errors.New(fmt.Sprintf("The minimum api version supported is %d", apiver.MinimumVersion))

Choose a reason for hiding this comment

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

should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

//If no api version is provided use the current version to create client
if c.OVAPIVersion == 0 {
if err != nil {
return errors.New(fmt.Sprintf("Could not fetch the appliance %s api version", c.OVEndpoint))

Choose a reason for hiding this comment

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

should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@@ -53,7 +53,7 @@ func Provider() terraform.ResourceProvider {
"ov_apiversion": {
Type: schema.TypeInt,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("ONEVIEW_OV_API_VERSION", 200),
DefaultFunc: schema.EnvDefaultFunc("ONEVIEW_OV_API_VERSION", 0),
Copy link
Contributor

Choose a reason for hiding this comment

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

what does this mean..?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Default api version in the schema if the value is not found. Keeping it 0, we are controlling what to for set the api version

@nabhajit-ray nabhajit-ray merged commit 217592f into master Sep 8, 2020
@nabhajit-ray nabhajit-ray deleted the API_Deprecation branch September 18, 2020 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants