Skip to content

Commit

Permalink
Fix #38 by correcting image url and order of inspect podman call
Browse files Browse the repository at this point in the history
  • Loading branch information
mbr committed Jan 14, 2024
1 parent 4de75db commit 8e2abed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Log messages have been cleaned up.

### Fixed

* Images uploaded are now properly inspected (would cause all uploads to fail before).

## [0.1.0] - 2024-01-14

Initial release
27 changes: 13 additions & 14 deletions src/container_orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,6 @@ impl ContainerOrchestrator {
let production_tag = "prod";

if matches!(manifest_reference.reference(), Reference::Tag(tag) if tag == production_tag) {
let image_json_raw = self
.podman
.inspect("image", &manifest_reference.to_string())
.await
.context("failed to fetch image information via inspect")?;

let image_json: Vec<ImageJson> = serde_json::from_value(image_json_raw)
.context("failed to deserialize image information")?;
let volumes = image_json
.get(0)
.context("no information via inspect")?
.config
.volume_iter();

let location = manifest_reference.location();
let name = format!("rockslide-{}-{}", location.repository(), location.image());

Expand Down Expand Up @@ -306,6 +292,19 @@ impl ContainerOrchestrator {
// Prepare volumes.
let volume_base = manifest_reference.namespaced_dir(&self.volumes_dir);

let image_json_raw = self
.podman
.inspect("image", &image_url)
.await
.context("failed to fetch image information via inspect")?;
let image_json: Vec<ImageJson> = serde_json::from_value(image_json_raw)
.context("failed to deserialize image information")?;
let volumes = image_json
.get(0)
.context("no information via inspect")?
.config
.volume_iter();

let mut podman_run = self.podman.run(&image_url);

for vol_desc in volumes {
Expand Down

0 comments on commit 8e2abed

Please sign in to comment.