noderestriction: restrict nodes TokenRequest permission

nodes should only be able to create TokenRequests if:
* token is bound to a pod
* binding has uid and name
* the pod exists
* the pod is running on that node
This commit is contained in:
Mike Danese
2018-02-23 11:24:43 -08:00
parent 2cc75f0a5a
commit b43cd7307d
4 changed files with 142 additions and 4 deletions

View File

@@ -448,6 +448,8 @@ func TestNodeAuthorizer(t *testing.T) {
defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.CSIPersistentVolume, true)()
expectForbidden(t, getVolumeAttachment(node1ClientExternal))
expectAllowed(t, getVolumeAttachment(node2ClientExternal))
//TODO(mikedanese): integration test node restriction of TokenRequest
}
// expect executes a function a set number of times until it either returns the