Skip to content

Commit 3574da4

Browse files
committed
fix tests
Signed-off-by: Aviram Hassan <[email protected]>
1 parent a288295 commit 3574da4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

examples/get-manifest/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub async fn main() {
8585
let auth = build_auth(&reference, &cli);
8686

8787
let client_config = build_client_config(&cli);
88-
let mut client = Client::new(client_config);
88+
let client = Client::new(client_config);
8989

9090
let (manifest, _) = client
9191
.pull_manifest(&reference, &auth)

src/client.rs

+10
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ impl Client {
534534
authentication: &RegistryAuth,
535535
operation: RegistryOperation,
536536
) -> Result<Option<String>> {
537+
self.store_auth_if_needed(image.resolve_registry(), authentication)
538+
.await;
537539
// preserve old caching behavior
538540
match self._auth(image, authentication, operation).await {
539541
Ok(Some(RegistryTokenType::Bearer(token))) => {
@@ -1802,6 +1804,14 @@ mod test {
18021804
.as_str()
18031805
.to_string();
18041806

1807+
// we have to have it in the stored auth so we'll get to the token cache check.
1808+
client
1809+
.store_auth(
1810+
&Reference::try_from(HELLO_IMAGE_TAG)?.resolve_registry(),
1811+
RegistryAuth::Anonymous,
1812+
)
1813+
.await;
1814+
18051815
client
18061816
.tokens
18071817
.insert(

0 commit comments

Comments
 (0)