@@ -119,6 +119,44 @@ func TestLogGRPC(t *testing.T) {
119
119
},
120
120
`GRPC request: {"starting_token":"testtoken"}` ,
121
121
},
122
+ {
123
+ "NodeStageVolumeRequest with service account token" ,
124
+ & csi.NodeStageVolumeRequest {
125
+ VolumeContext : map [string ]string {
126
+ "csi.storage.k8s.io/serviceAccount.tokens" : "testtoken" ,
127
+ "csi.storage.k8s.io/testfield" : "testvalue" ,
128
+ },
129
+ XXX_sizecache : 100 ,
130
+ },
131
+ `GRPC request: {"volume_context":{"csi.storage.k8s.io/serviceAccount.tokens":"***stripped***","csi.storage.k8s.io/testfield":"testvalue"}}` ,
132
+ },
133
+ {
134
+ "NodePublishVolumeRequest with service account token" ,
135
+ & csi.NodePublishVolumeRequest {
136
+ VolumeContext : map [string ]string {
137
+ "csi.storage.k8s.io/serviceAccount.tokens" : "testtoken" ,
138
+ "csi.storage.k8s.io/testfield" : "testvalue" ,
139
+ },
140
+ XXX_sizecache : 100 ,
141
+ },
142
+ `GRPC request: {"volume_context":{"csi.storage.k8s.io/serviceAccount.tokens":"***stripped***","csi.storage.k8s.io/testfield":"testvalue"}}` ,
143
+ },
144
+ {
145
+ "with secrets and service account token" ,
146
+ & csi.NodeStageVolumeRequest {
147
+ VolumeId : "vol_1" ,
148
+ Secrets : map [string ]string {
149
+ "account_name" : "k8s" ,
150
+ "account_key" : "testkey" ,
151
+ },
152
+ VolumeContext : map [string ]string {
153
+ "csi.storage.k8s.io/serviceAccount.tokens" : "testtoken" ,
154
+ "csi.storage.k8s.io/testfield" : "testvalue" ,
155
+ },
156
+ XXX_sizecache : 100 ,
157
+ },
158
+ `GRPC request: {"secrets":"***stripped***","volume_context":{"csi.storage.k8s.io/serviceAccount.tokens":"***stripped***","csi.storage.k8s.io/testfield":"testvalue"},"volume_id":"vol_1"}` ,
159
+ },
122
160
}
123
161
124
162
for _ , test := range tests {
0 commit comments