@@ -81,18 +81,18 @@ public Map<String, byte[]> getSecretData(SecretType secretType, String secretNam
81
81
throw new IllegalArgumentException ("Invalid secret name" );
82
82
}
83
83
84
- LOGGER .info (MessageKeys .RETRIEVING_SECRET , secretName );
84
+ LOGGER .fine (MessageKeys .RETRIEVING_SECRET , secretName );
85
85
86
86
V1Secret secret = client .callBuilder ().readSecret (secretName , namespace );
87
87
if (secret == null || secret .getData () == null ) {
88
- LOGGER .info (MessageKeys .SECRET_NOT_FOUND , secretName );
88
+ LOGGER .warning (MessageKeys .SECRET_NOT_FOUND , secretName );
89
89
LOGGER .exiting (null );
90
90
return null ;
91
91
}
92
92
93
93
return harvestAdminSecretData (secret );
94
94
} catch (Throwable e ) {
95
- LOGGER .warning (MessageKeys .EXCEPTION , e );
95
+ LOGGER .severe (MessageKeys .EXCEPTION , e );
96
96
return null ;
97
97
} finally {
98
98
LOGGER .exiting ();
@@ -131,17 +131,16 @@ public NextAction apply(Packet packet) {
131
131
throw new IllegalArgumentException ("Invalid secret name" );
132
132
}
133
133
134
- LOGGER .info (MessageKeys .RETRIEVING_SECRET , secretName );
134
+ LOGGER .fine (MessageKeys .RETRIEVING_SECRET , secretName );
135
135
Step read = CallBuilder .create ().readSecretAsync (secretName , namespace , new ResponseStep <V1Secret >(next ) {
136
136
@ Override
137
137
public NextAction onFailure (Packet packet , ApiException e , int statusCode ,
138
138
Map <String , List <String >> responseHeaders ) {
139
- NextAction nextAction = super .onFailure (packet , e , statusCode , responseHeaders );
140
- if (nextAction .getNext () == null ) {
141
- // no further retries
142
- LOGGER .info (MessageKeys .SECRET_NOT_FOUND , secretName );
139
+ if (statusCode == CallBuilder .NOT_FOUND ) {
140
+ LOGGER .warning (MessageKeys .SECRET_NOT_FOUND , secretName );
141
+ return doNext (packet );
143
142
}
144
- return nextAction ;
143
+ return super . onFailure ( packet , e , statusCode , responseHeaders ) ;
145
144
}
146
145
147
146
@ Override
@@ -164,13 +163,13 @@ private static Map<String, byte[]> harvestAdminSecretData(V1Secret secret) {
164
163
if (usernameBytes != null ) {
165
164
secretData .put (ADMIN_SERVER_CREDENTIALS_USERNAME , usernameBytes );
166
165
} else {
167
- LOGGER .info (MessageKeys .SECRET_DATA_NOT_FOUND , ADMIN_SERVER_CREDENTIALS_USERNAME );
166
+ LOGGER .warning (MessageKeys .SECRET_DATA_NOT_FOUND , ADMIN_SERVER_CREDENTIALS_USERNAME );
168
167
}
169
168
170
169
if (passwordBytes != null ) {
171
170
secretData .put (ADMIN_SERVER_CREDENTIALS_PASSWORD , passwordBytes );
172
171
} else {
173
- LOGGER .info (MessageKeys .SECRET_DATA_NOT_FOUND , ADMIN_SERVER_CREDENTIALS_PASSWORD );
172
+ LOGGER .warning (MessageKeys .SECRET_DATA_NOT_FOUND , ADMIN_SERVER_CREDENTIALS_PASSWORD );
174
173
}
175
174
return secretData ;
176
175
}
0 commit comments