Skip to content

Commit

Permalink
mark removed fields as computed (#5313)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>

Co-authored-by: Dana Hoffman <[email protected]>
  • Loading branch information
modular-magician and danawillow committed Jan 6, 2020
1 parent d05c3c6 commit a8e4b03
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 8 deletions.
2 changes: 2 additions & 0 deletions google/data_source_google_container_engine_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ func dataSourceGoogleContainerEngineVersions() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Removed: "Use location instead",
Computed: true,
},
"region": {
Type: schema.TypeString,
Optional: true,
Removed: "Use location instead",
Computed: true,
},
"default_cluster_version": {
Type: schema.TypeString,
Expand Down
2 changes: 2 additions & 0 deletions google/node_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ var schemaNodeConfig = &schema.Schema{

"workload_metadata_config": {
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/guides/provider_versions.html for more details.",
Computed: true,
Type: schema.TypeList,
Optional: true,
ForceNew: true,
Expand All @@ -220,6 +221,7 @@ var schemaNodeConfig = &schema.Schema{

"sandbox_config": {
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/guides/provider_versions.html for more details.",
Computed: true,
Type: schema.TypeList,
Optional: true,
ForceNew: true,
Expand Down
1 change: 1 addition & 0 deletions google/resource_compute_forwarding_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ This field is only used for INTERNAL load balancing.`,
Type: schema.TypeString,
Optional: true,
Removed: "ipVersion is not used for regional forwarding rules. Please remove this field if you are using it.",
Computed: true,
},
"project": {
Type: schema.TypeString,
Expand Down
9 changes: 4 additions & 5 deletions google/resource_compute_instance_group_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
},

"instance_template": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Removed: "This field has been replaced by `version.instance_template`",
DiffSuppressFunc: compareSelfLinkRelativePaths,
Type: schema.TypeString,
Optional: true,
Computed: true,
Removed: "This field has been replaced by `version.instance_template`",
},

"version": {
Expand Down
2 changes: 1 addition & 1 deletion google/resource_compute_network_peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func resourceComputeNetworkPeering() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
Removed: "auto_create_routes has been removed because it's redundant and not user-configurable. It can safely be removed from your config",
ForceNew: true,
Computed: true,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions google/resource_compute_region_instance_group_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
Type: schema.TypeString,
Removed: "This field is removed.",
Optional: true,
Computed: true,
},

"target_pools": {
Expand Down
6 changes: 6 additions & 0 deletions google/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ func resourceContainerCluster() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Removed: "Use location instead",
Computed: true,
},

"zone": {
Type: schema.TypeString,
Optional: true,
Removed: "Use location instead",
Computed: true,
},

"node_locations": {
Expand All @@ -144,6 +146,7 @@ func resourceContainerCluster() *schema.Resource {
Type: schema.TypeSet,
Optional: true,
Removed: "Use node_locations instead",
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},

Expand Down Expand Up @@ -188,6 +191,7 @@ func resourceContainerCluster() *schema.Resource {
Type: schema.TypeList,
Optional: true,
Removed: "The Kubernetes Dashboard addon is removed for clusters on GKE.",
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -517,6 +521,7 @@ func resourceContainerCluster() *schema.Resource {
"pod_security_policy_config": {
// Remove return nil from expand when this is removed for good.
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/guides/provider_versions.html for more details.",
Computed: true,
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Expand Down Expand Up @@ -717,6 +722,7 @@ func resourceContainerCluster() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/guides/provider_versions.html for more details.",
Computed: true,
},
},
}
Expand Down
2 changes: 2 additions & 0 deletions google/resource_container_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ func resourceContainerNodePool() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Removed: "use location instead",
Computed: true,
},
"region": {
Type: schema.TypeString,
Optional: true,
Removed: "use location instead",
Computed: true,
},
"location": {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion google/resource_google_service_account_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func resourceGoogleServiceAccountKey() *schema.Resource {
"pgp_key": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Removed: "The pgp_key field has been removed. See https://www.terraform.io/docs/extend/best-practices/sensitive-state.html for more information.",
Computed: true,
},
"private_key_type": {
Type: schema.TypeString,
Expand Down
3 changes: 2 additions & 1 deletion google/resource_monitoring_alert_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,8 @@ Its syntax is: projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]`,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Removed: "labels is removed as it was never used. See user_labels for the correct field",
Removed: "labels is removed as it was never used. See user_labels for the correct field",
Computed: true,
},
"project": {
Type: schema.TypeString,
Expand Down
7 changes: 7 additions & 0 deletions google/resource_monitoring_uptime_check_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,37 +237,44 @@ func resourceMonitoringUptimeCheckConfig() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
Removed: "This field never worked, and will be removed in 3.0.0.",
Computed: true,
},
"internal_checkers": {
Type: schema.TypeList,
Optional: true,
Removed: "This field never worked, and will be removed in 3.0.0.",
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"display_name": {
Type: schema.TypeString,
Optional: true,
Removed: "This field never worked, and will be removed in 3.0.0.",
Computed: true,
},
"gcp_zone": {
Type: schema.TypeString,
Optional: true,
Removed: "This field never worked, and will be removed in 3.0.0.",
Computed: true,
},
"name": {
Type: schema.TypeString,
Optional: true,
Removed: "This field never worked, and will be removed in 3.0.0.",
Computed: true,
},
"network": {
Type: schema.TypeString,
Optional: true,
Removed: "This field never worked, and will be removed in 3.0.0.",
Computed: true,
},
"peer_project_id": {
Type: schema.TypeString,
Optional: true,
Removed: "This field never worked, and will be removed in 3.0.0.",
Computed: true,
},
},
},
Expand Down
1 change: 1 addition & 0 deletions google/resource_storage_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func resourceStorageBucket() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
Removed: "Please use `with_state` instead",
Computed: true,
},
"with_state": {
Type: schema.TypeString,
Expand Down

0 comments on commit a8e4b03

Please sign in to comment.