Skip to content

Commit

Permalink
volumes: rename existing volume resources
Browse files Browse the repository at this point in the history
Rename `nomad_volume` to `nomad_csi_volume_registration` and
`nomad_external_volume` to `nomad_csi_volume` to better reflect their
intended use.

The deprecated top-level fields `access_mode` and `attachment_mode` were
not moved to the new resource.

The previous resources are now marked as deprecated.
  • Loading branch information
lgfa29 committed Jul 11, 2023
1 parent 8eca8ac commit a395311
Show file tree
Hide file tree
Showing 12 changed files with 1,481 additions and 13 deletions.
12 changes: 12 additions & 0 deletions nomad/helper/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package helper

func ToMapStringString(m any) map[string]string {
mss := map[string]string{}
for k, v := range m.(map[string]any) {
mss[k] = v.(string)
}
return mss
}
28 changes: 15 additions & 13 deletions nomad/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,21 @@ func Provider() *schema.Provider {
},

ResourcesMap: map[string]*schema.Resource{
"nomad_acl_auth_method": resourceACLAuthMethod(),
"nomad_acl_binding_rule": resourceACLBindingRule(),
"nomad_acl_policy": resourceACLPolicy(),
"nomad_acl_role": resourceACLRole(),
"nomad_acl_token": resourceACLToken(),
"nomad_external_volume": resourceExternalVolume(),
"nomad_job": resourceJob(),
"nomad_namespace": resourceNamespace(),
"nomad_quota_specification": resourceQuotaSpecification(),
"nomad_sentinel_policy": resourceSentinelPolicy(),
"nomad_volume": resourceVolume(),
"nomad_scheduler_config": resourceSchedulerConfig(),
"nomad_variable": resourceVariable(),
"nomad_acl_auth_method": resourceACLAuthMethod(),
"nomad_acl_binding_rule": resourceACLBindingRule(),
"nomad_acl_policy": resourceACLPolicy(),
"nomad_acl_role": resourceACLRole(),
"nomad_acl_token": resourceACLToken(),
"nomad_csi_volume": resourceCSIVolume(),
"nomad_csi_volume_registration": resourceCSIVolumeRegistration(),
"nomad_external_volume": resourceExternalVolume(),
"nomad_job": resourceJob(),
"nomad_namespace": resourceNamespace(),
"nomad_quota_specification": resourceQuotaSpecification(),
"nomad_sentinel_policy": resourceSentinelPolicy(),
"nomad_volume": resourceVolume(),
"nomad_scheduler_config": resourceSchedulerConfig(),
"nomad_variable": resourceVariable(),
},
}
}
Expand Down
Loading

0 comments on commit a395311

Please sign in to comment.