Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix v1beta2 airgap installation images #4457

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkg/apparchive/helm-v1beta2.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,6 @@ func WriteV1Beta2HelmCharts(opts WriteV1Beta2HelmChartsOptions) error {
return errors.Wrap(err, "failed to write values file")
}

if !opts.ProcessImageOptions.RewriteImages || opts.ProcessImageOptions.IsAirgap {
// if an on-prem registry is not configured (which means it's an online installation)
// there's no need to process/copy the images as they will be pulled from their original registries or through the replicated proxy.
// if an on-prem registry is configured, but it's an airgap installation, we also don't need to process/copy the images
// as they will be pushed from the airgap bundle.
continue
}

if err := processOnlineV1Beta2HelmChartImages(opts, &helmChart, chartDir); err != nil {
return errors.Wrap(err, "failed to process online images")
}
Expand Down Expand Up @@ -317,6 +309,14 @@ func processOnlineV1Beta2HelmChartImages(opts WriteV1Beta2HelmChartsOptions, hel
return errors.Wrap(err, "failed to update installation images")
}

if !opts.ProcessImageOptions.RewriteImages || opts.ProcessImageOptions.IsAirgap {
// if an on-prem registry is not configured (which means it's an online installation)
// there's no need to process/copy the images as they will be pulled from their original registries or through the replicated proxy.
// if an on-prem registry is configured, but it's an airgap installation, we also don't need to process/copy the images
// as they will be pushed from the airgap bundle.
return nil
}

if err := image.CopyOnlineImages(opts.ProcessImageOptions, chartImages, opts.KotsKinds, opts.KotsKinds.License, dockerHubRegistryCreds, opts.RenderOptions.Log); err != nil {
return errors.Wrap(err, "failed to rewrite base images")
}
Expand Down
1 change: 1 addition & 0 deletions pkg/tests/pull/cases/v1beta2-charts/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Name: test v1beta2 charts
PullOptions:
Namespace: app-namespace
ExcludeAdminConsole: true
IsAirgap: true
Silent: true
LocalPath: cases/v1beta2-charts/upstream
RootDir: cases/v1beta2-charts/results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ spec:
channelName: My Channel
knownImages:
- image: nginx:1.23
isPrivate: true
- image: nginx:1.24
isPrivate: true
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ spec:
channelName: My Channel
knownImages:
- image: nginx:1.23
isPrivate: true
- image: nginx:1.24
isPrivate: true
status: {}
Loading