Skip to content

Commit 6b8b003

Browse files
improve container validation output
1 parent 3fe338b commit 6b8b003

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

cmd/apply.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ var applyCmd = &cobra.Command{
6060
}
6161

6262
config_lint.Validate(cfg)
63-
if err := config_lint.ValidateWithError(cfg); err != nil {
64-
return fmt.Errorf("config validation failed: %w", err)
65-
}
6663

6764
tapplier, err := templating.NewTemplateApplier(cfg, nil)
6865
if err != nil {

internal/config/loader.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ func retrieveContainerVersionsFromExporters(loaded *LoadedLabConfig) map[string]
329329

330330
// Retrieve version information for each unique image
331331
for imageURL := range uniqueImages {
332+
fmt.Printf("🔍 Checking container version for %s...\n", imageURL)
333+
332334
imageLabels, err := container.GetImageLabelsFromRegistry(imageURL)
333335
if err != nil {
334336
fmt.Printf("Latest container version of %s: unavailable (%v)\n", imageURL, err)

internal/exporter/ssh/ssh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,12 @@ func (m *SSHHostManager) checkDetailedContainerVersion(containerImage, svcName s
336336
// getRunningContainerLabels gets container labels from running container
337337
func (m *SSHHostManager) getRunningContainerLabels(serviceName string) (*container.ImageLabels, error) {
338338
// Try jumpstarter labels first, then fall back to OCI standard labels
339-
result, err := m.runCommand(fmt.Sprintf("podman inspect --format '{{index .Config.Labels \"jumpstarter.version\"}}\n{{index .Config.Labels \"jumpstarter.revision\"}}\n{{index .Config.Labels \"org.opencontainers.image.version\"}}\n{{index .Config.Labels \"org.opencontainers.image.revision\"}}' %s", serviceName))
339+
result, err := m.runCommand(fmt.Sprintf("podman inspect --format '{{index .Config.Labels \"jumpstarter.version\"}} {{index .Config.Labels \"jumpstarter.revision\"}} {{index .Config.Labels \"org.opencontainers.image.version\"}} {{index .Config.Labels \"org.opencontainers.image.revision\"}}' %s", serviceName))
340340
if err != nil {
341341
return nil, fmt.Errorf("failed to inspect container %s: %w", serviceName, err)
342342
}
343343

344-
parts := strings.Split(strings.TrimSpace(result.Stdout), "\n")
344+
parts := strings.Fields(strings.TrimSpace(result.Stdout))
345345
// Pad with empty strings if we got fewer parts
346346
for len(parts) < 4 {
347347
parts = append(parts, "")

0 commit comments

Comments
 (0)