@@ -142,15 +142,11 @@ func TestStripSecrets(t *testing.T) {
142
142
{true , "true" },
143
143
{false , "false" },
144
144
{& csi.CreateVolumeRequest {}, `{}` },
145
- {& testReq , `{"accessibility_requirements":{},"capacity_range":{"limit_bytes":1024,"required_bytes":1024},"name":"test-volume","parameters":{"param1":"param1","param2":"param2"},"secrets":"***stripped***","volume_capabilities":[{"AccessType ":{"Mount": {"fs_type":"ext4","mount_flags":["flag1","flag2","flag3"]}},"access_mode":{"mode":5}} ],"volume_content_source":{"Type":null }}` },
146
- {createVolume , `{"accessibility_requirements":{"requisite":[{"segments":{"foo":"bar","x":"y"}},{"segments":{"a":"b"}}]},"capacity_range":{"required_bytes":1024},"name":"foo","secrets":"***stripped***","volume_capabilities":[{"AccessType ":{"Mount":{" fs_type":"ext4"} }}]}` },
145
+ {& testReq , `{"accessibility_requirements":{},"capacity_range":{"limit_bytes":1024,"required_bytes":1024},"name":"test-volume","parameters":{"param1":"param1","param2":"param2"},"secrets":"***stripped***","volume_capabilities":[{"access_mode ":{"mode":"MULTI_NODE_MULTI_WRITER"},"mount": {"fs_type":"ext4","mount_flags":["flag1","flag2","flag3"]}}],"volume_content_source":{}}` },
146
+ {createVolume , `{"accessibility_requirements":{"requisite":[{"segments":{"foo":"bar","x":"y"}},{"segments":{"a":"b"}}]},"capacity_range":{"required_bytes":1024},"name":"foo","secrets":"***stripped***","volume_capabilities":[{"mount ":{"fs_type":"ext4"}}]}` },
147
147
{& csitest.CreateVolumeRequest {}, `{}` },
148
148
{createVolumeFuture ,
149
- // Secrets are *not* removed from all fields yet. This will have to be fixed one way or another
150
- // before the CSI spec can start using secrets there (currently it doesn't).
151
- // The test is still useful because it shows that also complicated fields get serialized.
152
- // `{"capacity_range":{"required_bytes":1024},"maybe_secret_map":{"1":{"AccessType":null,"array_secret":"***stripped***"},"2":{"AccessType":null,"array_secret":"***stripped***"}},"name":"foo","new_secret_int":"***stripped***","seecreets":"***stripped***","volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}},"array_secret":"***stripped***"},{"AccessType":null,"array_secret":"***stripped***"}],"volume_content_source":{"Type":{"Volume":{"oneof_secret_field":"***stripped***","volume_id":"abc"}},"nested_secret_field":"***stripped***"}}`,
153
- `{"capacity_range":{"required_bytes":1024},"maybe_secret_map":{"1":{"AccessType":null,"array_secret":"aaa"},"2":{"AccessType":null,"array_secret":"bbb"}},"name":"foo","new_secret_int":"***stripped***","seecreets":"***stripped***","volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}},"array_secret":"***stripped***"},{"AccessType":null,"array_secret":"***stripped***"}],"volume_content_source":{"Type":{"Volume":{"oneof_secret_field":"hello","volume_id":"abc"}},"nested_secret_field":"***stripped***"}}` ,
149
+ `{"capacity_range":{"required_bytes":1024},"maybe_secret_map":{"1":{"array_secret":"***stripped***"},"2":{"array_secret":"***stripped***"}},"name":"foo","new_secret_int":"***stripped***","seecreets":"***stripped***","volume_capabilities":[{"array_secret":"***stripped***","mount":{"fs_type":"ext4"}},{"array_secret":"***stripped***"}],"volume_content_source":{"nested_secret_field":"***stripped***","volume":{"oneof_secret_field":"***stripped***","volume_id":"abc"}}}` ,
154
150
},
155
151
}
156
152
@@ -161,7 +157,7 @@ func TestStripSecrets(t *testing.T) {
161
157
if assert .NoError (t , err , "marshall future message" ) &&
162
158
assert .NoError (t , proto .Unmarshal (data , unknownFields ), "unmarshal with unknown fields" ) {
163
159
cases = append (cases , testcase {unknownFields ,
164
- `{"capacity_range":{"required_bytes":1024},"name":"foo","secrets":"***stripped***","volume_capabilities":[{"AccessType ":{"Mount":{" fs_type":"ext4"}}},{"AccessType":null }],"volume_content_source":{"Type ":{"Volume":{" volume_id":"abc"} }}}` ,
160
+ `{"capacity_range":{"required_bytes":1024},"name":"foo","secrets":"***stripped***","volume_capabilities":[{"mount ":{"fs_type":"ext4"}},{ }],"volume_content_source":{"volume ":{"volume_id":"abc"}}}` ,
165
161
})
166
162
}
167
163
0 commit comments