Enforce sa token node audience restriction when ServiceAccountNodeAudienceRestriction=true

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
This commit is contained in:
Anish Ramasekar
2024-10-14 23:30:51 -07:00
parent 51f7475b6a
commit e93d5d5425
4 changed files with 922 additions and 35 deletions

View File

@@ -17,7 +17,9 @@ limitations under the License.
package auth
import (
"context"
"testing"
"time"
"k8s.io/kubernetes/test/integration/framework"
)
@@ -25,3 +27,9 @@ import (
func TestMain(m *testing.M) {
framework.EtcdMain(m.Run)
}
func testContext(t *testing.T) context.Context {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
t.Cleanup(cancel)
return ctx
}