mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #52466 from charrywanganthony/audit-2
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. Update the test under audit/policy Small change to cope with [previous review](https://github.com/kubernetes/kubernetes/pull/51782#pullrequestreview-61526174) @crassirostris
This commit is contained in:
commit
2d7192c54a
@ -91,7 +91,7 @@ var expectedPolicy = &audit.Policy{
|
||||
}
|
||||
|
||||
func TestParserV1alpha1(t *testing.T) {
|
||||
f, err := writePolicy(policyDefV1alpha1, t)
|
||||
f, err := writePolicy(t, policyDefV1alpha1)
|
||||
require.NoError(t, err)
|
||||
defer os.Remove(f)
|
||||
|
||||
@ -105,7 +105,7 @@ func TestParserV1alpha1(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestParserV1beta1(t *testing.T) {
|
||||
f, err := writePolicy(policyDefV1beta1, t)
|
||||
f, err := writePolicy(t, policyDefV1beta1)
|
||||
require.NoError(t, err)
|
||||
defer os.Remove(f)
|
||||
|
||||
@ -119,7 +119,6 @@ func TestParserV1beta1(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPolicyCntCheck(t *testing.T) {
|
||||
//a set of testCases
|
||||
var testCases = []struct {
|
||||
caseName, policy string
|
||||
}{
|
||||
@ -132,7 +131,7 @@ kind: Policy`,
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
f, err := writePolicy(tc.policy, t)
|
||||
f, err := writePolicy(t, tc.policy)
|
||||
require.NoError(t, err)
|
||||
defer os.Remove(f)
|
||||
|
||||
@ -141,7 +140,7 @@ kind: Policy`,
|
||||
}
|
||||
}
|
||||
|
||||
func writePolicy(policy string, t *testing.T) (string, error) {
|
||||
func writePolicy(t *testing.T, policy string) (string, error) {
|
||||
f, err := ioutil.TempFile("", "policy.yaml")
|
||||
require.NoError(t, err)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user