@@ -28,7 +28,7 @@ var inst = instance.Spec{
28
28
Tags : map [string ]string {},
29
29
Init : "" ,
30
30
LogicalID : logicalID ("id" ),
31
- Attachments : []instance.Attachment {"att1" },
31
+ Attachments : []instance.Attachment {{ ID : "att1" , Type : "nic" } },
32
32
}
33
33
34
34
func pluginLookup (plugins map [string ]flavor.Plugin ) group.FlavorPluginLookup {
@@ -72,15 +72,15 @@ func TestMergeBehavior(t *testing.T) {
72
72
Tags : map [string ]string {"a" : "1" , "c" : "4" },
73
73
Init : "init data a" ,
74
74
LogicalID : inst .LogicalID ,
75
- Attachments : []instance.Attachment {"a" },
75
+ Attachments : []instance.Attachment {{ ID : "a" , Type : "nic" } },
76
76
}, nil )
77
77
78
78
b .EXPECT ().Prepare (json .RawMessage (`{"b": "2"}` ), inst , allocation ).Return (instance.Spec {
79
79
Properties : inst .Properties ,
80
80
Tags : map [string ]string {"b" : "2" , "c" : "5" },
81
81
Init : "init data b" ,
82
82
LogicalID : inst .LogicalID ,
83
- Attachments : []instance.Attachment {"b" },
83
+ Attachments : []instance.Attachment {{ ID : "b" , Type : "gpu" } },
84
84
}, nil )
85
85
86
86
result , err := combo .Prepare (flavorProperties , inst , types.AllocationMethod {Size : 1 })
@@ -91,7 +91,7 @@ func TestMergeBehavior(t *testing.T) {
91
91
Tags : map [string ]string {"a" : "1" , "b" : "2" , "c" : "5" },
92
92
Init : "init data a\n init data b" ,
93
93
LogicalID : inst .LogicalID ,
94
- Attachments : []instance.Attachment {"att1" , " a" , "b" },
94
+ Attachments : []instance.Attachment {{ ID : "att1" , Type : "nic" }, { ID : " a" , Type : "nic" }, { ID : "b" , Type : "gpu" } },
95
95
}
96
96
require .Equal (t , expected , result )
97
97
}
@@ -103,7 +103,7 @@ func TestMergeNoLogicalID(t *testing.T) {
103
103
Properties : jsonPtr ("{}" ),
104
104
Tags : map [string ]string {},
105
105
Init : "" ,
106
- Attachments : []instance.Attachment {"att1" },
106
+ Attachments : []instance.Attachment {{ ID : "att1" , Type : "nic" } },
107
107
}
108
108
109
109
ctrl := gomock .NewController (t )
@@ -136,15 +136,15 @@ func TestMergeNoLogicalID(t *testing.T) {
136
136
Tags : map [string ]string {"a" : "1" , "c" : "4" },
137
137
Init : "init data a" ,
138
138
LogicalID : inst .LogicalID ,
139
- Attachments : []instance.Attachment {"a" },
139
+ Attachments : []instance.Attachment {{ ID : "a" , Type : "nic" } },
140
140
}, nil )
141
141
142
142
b .EXPECT ().Prepare (json .RawMessage (`{"b": "2"}` ), inst , allocation ).Return (instance.Spec {
143
143
Properties : inst .Properties ,
144
144
Tags : map [string ]string {"b" : "2" , "c" : "5" },
145
145
Init : "init data b" ,
146
146
LogicalID : inst .LogicalID ,
147
- Attachments : []instance.Attachment {"b" },
147
+ Attachments : []instance.Attachment {{ ID : "b" , Type : "gpu" } },
148
148
}, nil )
149
149
150
150
result , err := combo .Prepare (flavorProperties , inst , types.AllocationMethod {Size : 1 })
@@ -155,7 +155,7 @@ func TestMergeNoLogicalID(t *testing.T) {
155
155
Tags : map [string ]string {"a" : "1" , "b" : "2" , "c" : "5" },
156
156
Init : "init data a\n init data b" ,
157
157
LogicalID : inst .LogicalID ,
158
- Attachments : []instance.Attachment {"att1" , " a" , "b" },
158
+ Attachments : []instance.Attachment {{ ID : "att1" , Type : "nic" }, { ID : " a" , Type : "nic" }, { ID : "b" , Type : "gpu" } },
159
159
}
160
160
require .Equal (t , expected , result )
161
161
}
0 commit comments