File tree Expand file tree Collapse file tree
util/src/test/java/io/kubernetes/client/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ void lookPathIgnoresRelativeAndMissingEntries(@TempDir Path tempDir) throws IOEx
147147 }
148148
149149 @ Test
150- void kubeRcPolicies () {
150+ void kubeRcPolicies (@ TempDir Path tempDir ) {
151151 String header = "apiVersion: kubectl.config.k8s.io/v1beta1\n kind: Preference\n " ;
152152 assertThat (ExecCredentialPluginPolicy .fromKubeRc (new StringReader (header )))
153153 .isSameAs (ExecCredentialPluginPolicy .ALLOW_ALL );
@@ -164,17 +164,20 @@ void kubeRcPolicies() {
164164 new StringReader (header + "credentialPluginPolicy: DenyAll\n " )))
165165 .isSameAs (ExecCredentialPluginPolicy .DENY_ALL );
166166
167+ String trustedBinary = tempDir .resolve ("my-other-trusted-binary" ).toString ();
167168 ExecCredentialPluginPolicy allowlist =
168169 ExecCredentialPluginPolicy .fromKubeRc (
169170 new StringReader (
170171 header
171172 + "credentialPluginPolicy: Allowlist\n "
172173 + "credentialPluginAllowlist:\n "
173174 + " - command: my-trusted-binary\n "
174- + " - name: /usr/local/bin/my-other-trusted-binary\n " ));
175+ + " - name: "
176+ + trustedBinary
177+ + "\n " ));
175178 assertThat (allowlist .getType ()).isEqualTo (ExecCredentialPluginPolicy .PolicyType .ALLOWLIST );
176179 assertThat (allowlist .getAllowlist ())
177- .containsExactly ("my-trusted-binary" , "/usr/local/bin/my-other-trusted-binary" );
180+ .containsExactly ("my-trusted-binary" , trustedBinary );
178181 }
179182
180183 @ Test
You can’t perform that action at this time.
0 commit comments