Support for insecure registries
I personally run my registry in the same Kubernetes cluster as my dref deployment so it makes sense to have them talk directly.
This commit is contained in:
parent
782e19e49a
commit
527d6f8fbf
|
@ -89,8 +89,9 @@ async fn root() -> Markup {
|
|||
|
||||
async fn get_images() -> Result<Vec<Image>, boxed::Box<dyn error::Error>> {
|
||||
let host = env::var("DREF_REGISTRY").unwrap();
|
||||
let insecure_registry = env::var("DREF_REGISTRY_USE_SSL").unwrap() == "false";
|
||||
let dclient = Client::configure()
|
||||
.insecure_registry(false)
|
||||
.insecure_registry(insecure_registry)
|
||||
.registry(&host)
|
||||
.build()?;
|
||||
let catalog = dclient.get_catalog(None).collect::<Vec<_>>().await
|
||||
|
@ -104,8 +105,9 @@ async fn get_images() -> Result<Vec<Image>, boxed::Box<dyn error::Error>> {
|
|||
|
||||
async fn get_tags(image: String) -> Result<Vec<Tag>, boxed::Box<dyn error::Error>> {
|
||||
let host = env::var("DREF_REGISTRY").unwrap();
|
||||
let insecure_registry = env::var("DREF_REGISTRY_USE_SSL").unwrap() == "false";
|
||||
let dclient = Client::configure()
|
||||
.insecure_registry(false)
|
||||
.insecure_registry(insecure_registry)
|
||||
.registry(&host)
|
||||
.build()?;
|
||||
let tags = dclient.get_tags(image.as_str(), None).collect::<Vec<_>>().await
|
||||
|
@ -117,8 +119,9 @@ async fn get_tags(image: String) -> Result<Vec<Tag>, boxed::Box<dyn error::Error
|
|||
|
||||
async fn get_platforms(image: &String, tag: String) -> Result<Vec<String>, boxed::Box<dyn error::Error>> {
|
||||
let host = env::var("DREF_REGISTRY").unwrap();
|
||||
let insecure_registry = env::var("DREF_REGISTRY_USE_SSL").unwrap() == "false";
|
||||
let dclient = Client::configure()
|
||||
.insecure_registry(false)
|
||||
.insecure_registry(insecure_registry)
|
||||
.registry(&host)
|
||||
.build()?;
|
||||
let manifest = dclient.get_manifest(image.as_str(), tag.as_str()).await.unwrap();
|
||||
|
|
Loading…
Reference in a new issue