-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Oracle update exadata infra to support X11M shape #29801
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
Oracle update exadata infra to support X11M shape #29801
Conversation
126bd5a
to
331811d
Compare
8107220
to
7dc06e5
Compare
@mihretkidane-OCI , thank you for composing this PR. To add a new feature that resides in a new Azure service API version, the best practice recommended in AzureRM is to split them into several PRs for better fine granularity mgmt. Take this PR as example, it does two actions: 1) introduce the new version of Hashicorp Azure SDK to this repo + Have related services consume the new service API version 2) business code update. These two actions are expected to be split into 2 PRs, separately, and we can imagine the first PR could be reviewed and merged quickly. With the current state, we can see another Azure Oracle PR 29833 would have to rebase to this PR, or vice versa. Another suggestion is to use the same API version to manage all resources in a Resource Provider though using multiple API versions in parallel is not forbidden. To use the latter way as this PR does that co-uses I’m sharing here a previous PR 28825 as a reference that embodies the above 2 suggested practices. |
@mybayern1974 I have another PR to upgrade the client to the new version , however I couldn't merge it because it will introduce a breaking change if merged right away. For that reason we are working on a fix to our service so we wont introduce a breaking change , However with the timeline that we have and business requirement we are requesting to keep both clients in this PR and merge it. The other PRs like oracle 29833 will rebase once this PR is merged or vice versa. |
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.
Hi @mihretkidane-OCI - There's a few review comments to check below if you can take a look. Thanks!
@@ -466,6 +472,7 @@ func (d CloudVmClusterDataSource) Read() sdk.ResourceFunc { | |||
state.CloudExadataInfrastructureId = props.CloudExadataInfrastructureId | |||
state.ClusterName = pointer.From(props.ClusterName) | |||
state.CompartmentId = pointer.From(props.CompartmentId) | |||
state.ComputeModel = string(pointer.From(props.ComputeModel)) |
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.
we have a helper for this
state.ComputeModel = string(pointer.From(props.ComputeModel)) | |
state.ComputeModel = pointer.FromEnum(props.ComputeModel) |
@@ -192,7 +220,9 @@ func (d DbSystemShapesDataSource) Read() sdk.ResourceFunc { | |||
AvailableDbNodeStorageInGbs: pointer.From(props.AvailableDbNodeStorageInGbs), | |||
AvailableMemoryInGbs: pointer.From(props.AvailableMemoryInGbs), | |||
AvailableMemoryPerNodeInGbs: pointer.From(props.AvailableMemoryPerNodeInGbs), | |||
ComputeModel: string(pointer.From(props.ComputeModel)), |
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.
as above
ComputeModel: string(pointer.From(props.ComputeModel)), | |
ComputeModel: pointer.FromEnum(props.ComputeModel), |
check.That(data.ResourceName).Key("shape").HasValue("Exadata.X11M"), | ||
check.That(data.ResourceName).Key("database_server_type").HasValue("X11M"), | ||
check.That(data.ResourceName).Key("storage_server_type").HasValue("X11M-HC"), |
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.
These should be unnecessary as the import check will validate that all values match those in the config on read.
check.That(data.ResourceName).Key("shape").HasValue("Exadata.X11M"), | |
check.That(data.ResourceName).Key("database_server_type").HasValue("X11M"), | |
check.That(data.ResourceName).Key("storage_server_type").HasValue("X11M-HC"), |
} | ||
|
||
if len(v) < 1 || len(v) > 255 { | ||
errors = append(errors, fmt.Errorf("databse_server_type must be %d to %d characters", 1, 255)) |
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.
errors = append(errors, fmt.Errorf("databse_server_type must be %d to %d characters", 1, 255)) | |
errors = append(errors, fmt.Errorf("%s must be %d to %d characters", k, 1, 255)) |
} | ||
|
||
if len(v) < 1 || len(v) > 255 { | ||
errors = append(errors, fmt.Errorf("storage_server_type must be %d to %d characters", 1, 255)) |
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.
errors = append(errors, fmt.Errorf("storage_server_type must be %d to %d characters", 1, 255)) | |
errors = append(errors, fmt.Errorf("%s must be %d to %d characters", k, 1, 255)) |
if len(model.DatabaseServerType) > 0 { | ||
param.Properties.DatabaseServerType = pointer.To(model.DatabaseServerType) | ||
} | ||
if len(model.StorageServerType) > 0 { | ||
param.Properties.StorageServerType = pointer.To(model.StorageServerType) | ||
} |
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.
checks should be type specific:
if len(model.DatabaseServerType) > 0 { | |
param.Properties.DatabaseServerType = pointer.To(model.DatabaseServerType) | |
} | |
if len(model.StorageServerType) > 0 { | |
param.Properties.StorageServerType = pointer.To(model.StorageServerType) | |
} | |
if model.DatabaseServerType != "" { | |
param.Properties.DatabaseServerType = pointer.To(model.DatabaseServerType) | |
} | |
if model.StorageServerType != "" { | |
param.Properties.StorageServerType = pointer.To(model.StorageServerType) | |
} |
7dc06e5
to
5d3a013
Compare
5d3a013
to
176b252
Compare
176b252
to
79915b2
Compare
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.
Thanks @mihretkidane-OCI - Just a couple of items to take a look at below, but this should be fine after those are addressed.
internal/services/oracle/oracle_exadata_infrastructure_resource.go
Outdated
Show resolved
Hide resolved
@jackofallops please help review the PR |
e2ec5ad
to
ef5e626
Compare
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.
Thanks for the changes @mihretkidane-OCI - This LGTM now 👍
Community Note
Description
The following changes have been made to the Oracle provider to support the new Oracle Cloud Infrastructure Exadata Infrastructure X11M shape.
oracle_exadata_infrastructure_resource , oracle_exadata_infrastructure_data_source
Added new Optional Arguments
New Attributes:
oracle_db_system_shapes_data_source
New Optional argument
New attributes
oracle_cloud_vm_cluster_data_source, oracle_cloud_vm_cluster_resource
New attributes
oracle_db_servers_data_source
New attributes
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_resource
- support for thething1
property [GH-00000]This is a (please select all that apply):
Related Issue(s)
Fixes #29820
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the provider.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Note
If this PR changes meaningfully during the course of review please update the title and description as required.