Skip to content

Commit

Permalink
image-rs: enable the test of reading credentials from auth config
Browse files Browse the repository at this point in the history
Though the PR (oras-project/rust-oci-client#48) had
been merged and oci-distribution has published a new release (v0.10.0),
the test could be enabled.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
  • Loading branch information
ChengyuZhu6 authored and Xynnn007 committed Dec 25, 2023
1 parent 5d4bb95 commit de998ec
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions image-rs/src/auth/auth_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,13 @@ mod tests {
#[case("mysql:latest", RegistryAuth::Basic("liudalibj".to_string(),"Passw0rd!qaz".to_string()))]
#[case("quay.io/confidential-containers/image:latest", RegistryAuth::Basic("liudalibj".to_string(),"Passw0rd!qaz".to_string()))]
#[case("gcr.io/google-containers/busybox:1.27.2", RegistryAuth::Anonymous)]
fn test_credential_from_auth_config(#[case] reference: &str, #[case] _auth: RegistryAuth) {
fn test_credential_from_auth_config(#[case] reference: &str, #[case] auth: RegistryAuth) {
let reference = Reference::try_from(reference).expect("reference creation failed");
let auths: HashMap<String, DockerAuthConfig> = serde_json::from_str(DOCKER_AUTH_CONFIGS)
.expect("deserialize DOCKER_AUTH_CONFIGS failed");
let _got_auth =
let got_auth =
super::credential_from_auth_config(&reference, &auths).expect("get auth failed");
// TODO: This assert_eq! test needs the following tasks to be Done
// - wait for this PR to be merged into upstream: https://github.com/krustlet/oci-distribution/pull/48
// - wait for `oci-distribution` to publish a new release
// - let `ocicrypt-rs` follow the new release
// - let `image-rs` follow the new release and delete the notes below
// assert_eq!(got_auth, auth);
assert_eq!(got_auth, auth);
}

#[rstest]
Expand Down

0 comments on commit de998ec

Please sign in to comment.