/
Resource_VolumeMountSpec.generated.go
100 lines (93 loc) · 2.63 KB
/
Resource_VolumeMountSpec.generated.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package schemas
import (
. "github.com/eddycharly/terraform-provider-kops/pkg/schemas"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"k8s.io/kops/pkg/apis/kops"
)
var _ = Schema
func ResourceVolumeMountSpec() *schema.Resource {
res := &schema.Resource{
Schema: map[string]*schema.Schema{
"device": RequiredString(),
"filesystem": RequiredString(),
"format_options": OptionalList(String()),
"mount_options": OptionalList(String()),
"path": RequiredString(),
},
}
return res
}
func ExpandResourceVolumeMountSpec(in map[string]interface{}) kops.VolumeMountSpec {
if in == nil {
panic("expand VolumeMountSpec failure, in is nil")
}
return kops.VolumeMountSpec{
Device: func(in interface{}) string {
return string(ExpandString(in))
}(in["device"]),
Filesystem: func(in interface{}) string {
return string(ExpandString(in))
}(in["filesystem"]),
FormatOptions: func(in interface{}) []string {
return func(in interface{}) []string {
if in == nil {
return nil
}
var out []string
for _, in := range in.([]interface{}) {
out = append(out, string(ExpandString(in)))
}
return out
}(in)
}(in["format_options"]),
MountOptions: func(in interface{}) []string {
return func(in interface{}) []string {
if in == nil {
return nil
}
var out []string
for _, in := range in.([]interface{}) {
out = append(out, string(ExpandString(in)))
}
return out
}(in)
}(in["mount_options"]),
Path: func(in interface{}) string {
return string(ExpandString(in))
}(in["path"]),
}
}
func FlattenResourceVolumeMountSpecInto(in kops.VolumeMountSpec, out map[string]interface{}) {
out["device"] = func(in string) interface{} {
return FlattenString(string(in))
}(in.Device)
out["filesystem"] = func(in string) interface{} {
return FlattenString(string(in))
}(in.Filesystem)
out["format_options"] = func(in []string) interface{} {
return func(in []string) []interface{} {
var out []interface{}
for _, in := range in {
out = append(out, FlattenString(string(in)))
}
return out
}(in)
}(in.FormatOptions)
out["mount_options"] = func(in []string) interface{} {
return func(in []string) []interface{} {
var out []interface{}
for _, in := range in {
out = append(out, FlattenString(string(in)))
}
return out
}(in)
}(in.MountOptions)
out["path"] = func(in string) interface{} {
return FlattenString(string(in))
}(in.Path)
}
func FlattenResourceVolumeMountSpec(in kops.VolumeMountSpec) map[string]interface{} {
out := map[string]interface{}{}
FlattenResourceVolumeMountSpecInto(in, out)
return out
}