-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(google_container_cluster): allow enabling cost allocation #6469
feat(google_container_cluster): allow enabling cost allocation #6469
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in /~https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
Hello! I am a robot who works on Magic Modules PRs. I've detected that you're a community contributor. @c2thorn, a repository maintainer, has been assigned to assist you and help review your changes. ❓ First time contributing? Click here for more detailsYour assigned reviewer will help review your code by:
You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails. If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform Beta: Diff ( 1 file changed, 34 insertions(+)) |
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 your contribution @renescheepers. I understand this is still in draft mode, but I have some immediate feedback to share just in case it shortens the feedback loop time.
Aside from individual comments, it will be necessary to either add a test that uses this field, or add the field to an existing test. Also, it will need to be added to documentation file.
@@ -1466,6 +1466,15 @@ func resourceContainerCluster() *schema.Resource { | |||
Computed: true, | |||
}, | |||
|
|||
<% if version == 'beta' -%> | |||
"enable_cost_allocation": { |
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.
Haven't looked at the API documentation yet, but it looks like the API defines this as CostManagementConfig.Enabled
. We have shied away from flattening fields like this recently because if the API adds more fields later, it becomes a breaking change to correct. For an example of a similar field, I think mesh_certificates.enable_certificates
.
My recommendation is to expand the field to cost_management_config.enabled
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, wasn't sure which structure to pick since I saw both being used. Should now be fixed.
<% end -%> | ||
<% if version == 'beta' -%> |
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.
<% unless version == 'ga' -%>
is the same as <% if version == 'beta' -%>
, just weird ruby-isms. We can save a couple of lines throughout the file by merging the two statements
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.
Changed it to <% unless version == 'ga' -%>
everywhere in this file.
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccSqlDatabaseInstance_SqlServerAuditConfig|TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange|TestAccIapTunnelIamBindingGenerated|TestAccGKEHubMembershipIamPolicyGenerated|TestAccGKEHubMembershipIamMemberGenerated|TestAccGKEHubMembershipIamBindingGenerated|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccContainerNodePool_withUpgradeSettings|TestAccContainerNodePool_withNetworkConfig|TestAccContainerCluster_withBinaryAuthorizationEnabledBoolLegacy|TestAccContainerCluster_withShieldedNodes|TestAccContainerNodePool_withLinuxNodeConfig|TestAccContainerNodePool_withKubeletConfig|TestAccContainerCluster_withBinaryAuthorizationEnabledBool|TestAccContainerNodePool_withSandboxConfig|TestAccContainerCluster_withAutoscalingProfile|TestAccContainerCluster_withAuthenticatorGroupsConfig|TestAccContainerNodePool_withWorkloadIdentityConfig|TestAccContainerCluster_nodeAutoprovisioningDefaultsMinCpuPlatform|TestAccContainerCluster_withMasterAuthConfig_NoCert|TestAccContainerCluster_withMonitoringConfig|TestAccContainerNodePool_withReservationAffinitySpecific|TestAccContainerCluster_withSoleTenantGroup|TestAccContainerCluster_withNodePoolResize|TestAccContainerCluster_withILBSubsetting|TestAccContainerCluster_withLoggingConfig|TestAccContainerCluster_withConfidentialNodes|TestAccContainerCluster_withNodePoolUpdateVersion|TestAccContainerCluster_withNodePoolBasic|TestAccContainerCluster_withIdentityServiceConfig|TestAccContainerCluster_withWorkloadIdentityConfig|TestAccContainerCluster_withNotificationConfig|TestAccContainerCluster_withAutopilotNetworkTags|TestAccContainerCluster_backend|TestAccContainerCluster_network|TestAccContainerCluster_withAddons|TestAccContainerCluster_errorAutopilotLocation|TestAccContainerCluster_withSandboxConfig|TestAccContainerCluster_withWorkloadMetadataConfig|TestAccContainerCluster_withAutopilot|TestAccContainerCluster_misc|TestAccContainerNodePool_compactPlacement|TestAccContainerNodePool_gvnic|TestAccContainerCluster_nodeAutoprovisioningNetworkTags|TestAccContainerCluster_withNodeConfigReservationAffinity|TestAccContainerCluster_nodeAutoprovisioningDefaults|TestAccContainerCluster_withNodeConfigShieldedInstanceConfig|TestAccContainerNodePool_withReservationAffinity|TestAccContainerCluster_nodeAutoprovisioning|TestAccContainerCluster_withNodeConfigScopeAlias|TestAccContainerCluster_networkingModeRoutes|TestAccContainerCluster_withIPAllocationPolicy_specificSizes|TestAccContainerNodePool_gcfsConfig|TestAccContainerNodePool_withNodeConfig|TestAccContainerCluster_basic|TestAccContainerCluster_withNodeConfig|TestAccContainerNodePool_ephemeralStorageConfig|TestAccContainerCluster_withBootDiskKmsKey|TestAccContainerNodePool_shieldedInstanceConfig|TestAccContainerCluster_withNodeConfigReservationAffinitySpecific|TestAccContainerCluster_updateVersion|TestAccContainerNodePool_maxPodsPerNode|TestAccContainerCluster_withIPAllocationPolicy_specificIPRanges|TestAccContainerCluster_withIPAllocationPolicy_existingSecondaryRanges|TestAccContainerCluster_deleteExclusionWindow|TestAccContainerCluster_updateMaintenanceExclusionOptions|TestAccContainerCluster_deleteMaintenanceExclusionOptions|TestAccContainerNodePool_basicWithClusterId|TestAccContainerNodePool_nodeLocations|TestAccContainerCluster_withMaintenanceExclusionOptions|TestAccContainerCluster_withMaintenanceExclusionWindow|TestAccContainerNodePool_basic|TestAccContainerCluster_withRecurringMaintenanceWindow|TestAccContainerCluster_withMaintenanceWindow|TestAccContainerCluster_withNodePoolNodeConfig|TestAccContainerNodePool_EmptyGuestAccelerator|TestAccContainerCluster_withVersion|TestAccContainerCluster_withTPUConfig|TestAccContainerNodePool_012_ConfigModeAttr|TestAccContainerNodePool_regionalClusters|TestAccContainerNodePool_version|TestAccContainerCluster_withDNSConfig|TestAccContainerCluster_withNodePoolMultiple|TestAccContainerNodePool_resize|TestAccContainerCluster_withEnableKubernetesAlpha|TestAccContainerNodePool_autoscaling|TestAccContainerCluster_withIntraNodeVisibility|TestAccContainerCluster_withNodePoolAutoscaling|TestAccContainerCluster_withMasterAuthorizedNetworksDisabled|TestAccContainerCluster_withPrivateClusterConfigMissingCidrBlock_withAutopilot|TestAccContainerCluster_withResourceUsageExportConfig|TestAccContainerCluster_withAdvancedDatapath|TestAccContainerNodePool_regionalAutoscaling|TestAccContainerNodePool_withNodeConfigScopeAlias|TestAccContainerNodePool_withManagement|TestAccContainerCluster_withDatabaseEncryption|TestAccContainerCluster_withMeshCertificatesConfig|TestAccContainerCluster_errorNoClusterCreated|TestAccContainerNodePool_withGPU|TestAccContainerCluster_withPrivateClusterConfig|TestAccContainerCluster_errorCleanDanglingCluster|TestAccContainerCluster_withTpu|TestAccContainerCluster_nodeAutoprovisioningDefaultsImageType|TestAccContainerCluster_withFlexiblePodCIDR|TestAccContainerCluster_regionalWithNodeLocations|TestAccContainerCluster_withBinaryAuthorizationEvaluationModeClassic|TestAccContainerCluster_regionalWithNodePool|TestAccContainerCluster_regional|TestAccContainerCluster_nodeAutoprovisioningDefaultsBootDiskKmsKey|TestAccContainerCluster_withMasterAuthorizedNetworksConfig|TestAccContainerCluster_withBinaryAuthorizationEvaluationModeAutopilot|TestAccContainerCluster_withTelemetryEnabled|TestAccContainerCluster_withReleaseChannelEnabledDefaultVersion|TestAccContainerCluster_withReleaseChannelEnabled|TestAccContainerCluster_withNetworkPolicyEnabled|TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeNetworkPeeringRoutesConfig_networkPeeringRoutesConfigGkeExample|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample|TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample|TestAccFirebaserulesRelease_BasicRelease|TestAccGKEHubMembership_gkehubMembershipIssuerExample|TestAccGKEHubMembership_gkehubMembershipBasicExample|TestAccContainerClusterDatasource_zonal|TestAccContainerClusterDatasource_regional |
c46986e
to
4225b8f
Compare
4225b8f
to
e63139d
Compare
e63139d
to
edb5009
Compare
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 1 insertion(+)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccCloudFunctions2Function_fullUpdate|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange|TestAccContainerCluster_withCostManagementConfig|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccFirebaserulesRelease_BasicRelease|TestAccSqlDatabaseInstance_SqlServerAuditConfig |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
@c2thorn are you able to see why those tests are failing? I don't think my changes should have had any effect on those tests. |
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.
LGTM. Other tests are not related. Thanks @renescheepers
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)
Description
https://cloud.google.com/kubernetes-engine/docs/how-to/cost-allocations#update_cluster
Fixes hashicorp/terraform-provider-google#12391