@@ -150,7 +150,7 @@ private static Collection<IdCredentials> fetchCredentials() {
150150
151151 SecretClient client = SecretClientCache .get (credentialID , keyVaultURL );
152152
153- String labelSelector = extractLabelSelector ();
153+ String configuredLabelSelector = extractLabelSelector ();
154154 List <IdCredentials > credentials = new ArrayList <>();
155155 for (SecretProperties secretItem : client .listPropertiesOfSecrets ()) {
156156 String id = secretItem .getId ();
@@ -160,11 +160,11 @@ private static Collection<IdCredentials> fetchCredentials() {
160160 if (tags == null ) {
161161 tags = new HashMap <>();
162162 }
163-
164- if ( StringUtils . isNotBlank ( labelSelector )) {
165- String jenkinsLabels = tags . getOrDefault ( "jenkins-label" , "" );
166- List <String > labelSelectors = Arrays .asList (jenkinsLabels .split ("," ));
167- if (! labelSelectors . contains ( labelSelector )) {
163+ if ( StringUtils . isNotBlank ( configuredLabelSelector )) {
164+ String secretLabelSelector = tags . getOrDefault ( "jenkins-label" , "" );
165+ List < String > secretLabels = Arrays . asList ( secretLabelSelector . split ( "," ) );
166+ List <String > configuredLabels = Arrays .asList (configuredLabelSelector .split ("," ));
167+ if (secretLabels . stream (). filter ( configuredLabels :: contains ). findAny (). isEmpty ( )) {
168168 continue ;
169169 }
170170 }
@@ -176,7 +176,7 @@ private static Collection<IdCredentials> fetchCredentials() {
176176
177177 CredentialsScope scope = CredentialsScope .GLOBAL ;
178178
179- if (tags .containsKey ("scope" ) && labelScope .equals ("SYSTEM" )) {
179+ if (tags .containsKey ("scope" ) && labelScope .equalsIgnoreCase ("SYSTEM" )) {
180180 scope = CredentialsScope .SYSTEM ;
181181 }
182182
0 commit comments