Skip to content
Merged
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
11 changes: 8 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ env:
permissions:
contents: write

# Cancel in-progress jobs for the same PR (pull_request_target event) or for the same branch (push event).
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
Expand Down Expand Up @@ -259,12 +264,12 @@ jobs:
git config --global --add safe.directory '*'

- name: Build and package
run: task build-and-package
run: task build:dist:all

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: deckhouse-cli-pr-build-${{ github.run_id }}.tar.gz
path: dist/**/*.tar.gz
name: deckhouse-cli-pr-build-${{ github.run_id }}
path: dist/**/*
retention-days: 1
compression-level: 9
6 changes: 4 additions & 2 deletions cmd/plugins/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (pc *PluginsCommand) InitPluginServices() {
// - Full path: "registry.deckhouse.io/deckhouse/ee"
sourceRepo := d8flags.SourceRegistryRepo
registryHost := sourceRepo
registryPath, edition := service.GetEditionFromRegistryPath(sourceRepo)

// If it's just a hostname (no slashes), use it directly
// Otherwise parse to extract the hostname
Expand All @@ -59,18 +60,19 @@ func (pc *PluginsCommand) InitPluginServices() {
slog.Bool("tls_skip_verify", d8flags.TLSSkipVerify))

// Create base client with registry host only
pc.pluginRegistryClient = client.NewClientWithOptions(sourceRepo, &client.Options{
pc.pluginRegistryClient = client.NewClientWithOptions(registryPath, &client.Options{
Auth: auth,
Insecure: d8flags.Insecure,
TLSSkipVerify: d8flags.TLSSkipVerify,
Logger: pc.logger.Named("registry-client"),
})

pc.logger.Debug("Creating plugin service with scoped client",
slog.String("path", sourceRepo))
slog.String("path", registryPath))

registryService := service.NewService(
pc.pluginRegistryClient,
edition,
pc.logger.Named("registry-service"),
)

Expand Down
6 changes: 4 additions & 2 deletions internal/mirror/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `d8 mirror` command facilitates the distribution of Deckhouse Kubernetes Pla

This functionality is exclusively available to users holding a valid license for any commercial version of the Deckhouse Kubernetes Platform.

**Official Documentation:** https://deckhouse.io/products/kubernetes-platform/documentation/v1/deckhouse-faq.html#manually-uploading-images-to-an-air-gapped-registry
**Official Documentation:** https://deckhouse.io/products/kubernetes-platform/documentation/latest/installing/#manual-loading-of-dkp-images-and-vulnerability-db-into-a-private-registry

## License Note

Expand Down Expand Up @@ -71,6 +71,8 @@ d8 mirror pull <images-bundle-path> [flags]
| `--no-security-db` | Do not pull security databases into bundle |
| `--no-modules` | Do not pull Deckhouse modules into bundle |
| `--only-extra-images` | Pull only extra images for modules (security databases, scanners, etc.) without main module images |
| `--no-installer` | Do not pull Deckhouse installer into bundle |
| `--installer-tag` | Specific Deckhouse installer build tag to pull. |

#### Bundle Options

Expand Down Expand Up @@ -423,7 +425,7 @@ Internally, the tool uses OCI-compliant image layouts for organizing container i
## Additional Resources

- [Deckhouse Official Documentation](https://deckhouse.io/products/kubernetes-platform/documentation/)
- [Air-Gapped Installation Guide](https://deckhouse.io/products/kubernetes-platform/documentation/v1/deckhouse-faq.html#manually-uploading-images-to-an-air-gapped-registry)
- [Air-Gapped Installation Guide](https://deckhouse.io/products/kubernetes-platform/guides/airgapped-update.html)
- [Deckhouse Licensing](https://deckhouse.io/products/kubernetes-platform/pricing.html)

---
Expand Down
2 changes: 1 addition & 1 deletion internal/mirror/cmd/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Copy Deckhouse Kubernetes Platform distribution to the local filesystem or
the air-gapped registries.

For more information on how to use it, consult the docs at
https://deckhouse.io/products/kubernetes-platform/documentation/v1/deckhouse-faq.html#manually-uploading-images-to-an-air-gapped-registry
https://deckhouse.io/products/kubernetes-platform/documentation/latest/installing/#manual-loading-of-dkp-images-and-vulnerability-db-into-a-private-registry

LICENSE NOTE:
The d8 mirror functionality is exclusively available to users holding a
Expand Down
14 changes: 14 additions & 0 deletions internal/mirror/cmd/pull/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var (
SinceVersion *semver.Version

DeckhouseTag string
InstallerTag string

ModulesPathSuffix string
ModulesWhitelist []string
Expand All @@ -62,6 +63,7 @@ var (
NoPlatform bool
NoSecurityDB bool
NoModules bool
NoInstaller bool
OnlyExtraImages bool
)

Expand Down Expand Up @@ -103,6 +105,12 @@ func AddFlags(flagSet *pflag.FlagSet) {
"",
"Specific Deckhouse build tag to pull. Conflicts with --since-version. If registry contains release channel image for specified tag, all release channels in the bundle will be pointed to it.",
)
flagSet.StringVar(
&InstallerTag,
"installer-tag",
"latest",
"Specific Deckhouse installer build tag to pull. If not specified, the latest tag for the installer will be pulled from the registry path.",
)
flagSet.StringArrayVarP(
&ModulesWhitelist,
"include-module",
Expand Down Expand Up @@ -186,6 +194,12 @@ module-name@=v1.3.0+stable → exact tag match: include only v1.3.0 and and publ
false,
"Do not pull Deckhouse modules into bundle.",
)
flagSet.BoolVar(
&NoInstaller,
"no-installer",
false,
"Do not pull Deckhouse installer into bundle.",
)
flagSet.BoolVar(
&OnlyExtraImages,
"only-extra-images",
Expand Down
10 changes: 7 additions & 3 deletions internal/mirror/cmd/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ containing specific platform releases and it's modules,
to be pushed into the air-gapped container registry at a later time.

For more information on how to use it, consult the docs at
https://deckhouse.io/products/kubernetes-platform/documentation/v1/deckhouse-faq.html#manually-uploading-images-to-an-air-gapped-registry
https://deckhouse.io/products/kubernetes-platform/documentation/latest/installing/#manual-loading-of-dkp-images-and-vulnerability-db-into-a-private-registry

Additional configuration options for the d8 mirror family of commands are available as environment variables:

Expand Down Expand Up @@ -156,6 +156,7 @@ func buildPullParams(logger params.Logger) *params.PullParams {
SkipPlatform: pullflags.NoPlatform,
SkipSecurityDatabases: pullflags.NoSecurityDB,
SkipModules: pullflags.NoModules,
SkipInstaller: pullflags.NoInstaller,
OnlyExtraImages: pullflags.OnlyExtraImages,
IgnoreSuspend: pullflags.IgnoreSuspend,
DeckhouseTag: pullflags.DeckhouseTag,
Expand Down Expand Up @@ -240,7 +241,8 @@ func (p *Puller) Execute(ctx context.Context) error {
}

var c registry.Client
c = regclient.NewClientWithOptions(p.params.DeckhouseRegistryRepo, clientOpts)
repo, edition := registryservice.GetEditionFromRegistryPath(p.params.DeckhouseRegistryRepo)
c = regclient.NewClientWithOptions(repo, clientOpts)

if os.Getenv("STUB_REGISTRY_CLIENT") == "true" {
c = stub.NewRegistryClientStub()
Expand All @@ -258,13 +260,15 @@ func (p *Puller) Execute(ctx context.Context) error {
}

svc := mirror.NewPullService(
registryservice.NewService(c, logger),
registryservice.NewService(c, edition, logger),
pullflags.TempDir,
pullflags.DeckhouseTag,
&mirror.PullServiceOptions{
SkipPlatform: pullflags.NoPlatform,
SkipSecurity: pullflags.NoSecurityDB,
SkipModules: pullflags.NoModules,
SkipInstaller: pullflags.NoInstaller,
InstallerTag: pullflags.InstallerTag,
OnlyExtraImages: pullflags.OnlyExtraImages,
IgnoreSuspend: pullflags.IgnoreSuspend,
ModuleFilter: filter,
Expand Down
3 changes: 3 additions & 0 deletions internal/mirror/cmd/pull/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,7 @@ func TestPullFunction(t *testing.T) {
originalNoPlatform := pullflags.NoPlatform
originalNoSecurityDB := pullflags.NoSecurityDB
originalNoModules := pullflags.NoModules
originalNoInstaller := pullflags.NoInstaller

defer func() {
pullflags.TempDir = originalTempDir
Expand All @@ -1241,6 +1242,7 @@ func TestPullFunction(t *testing.T) {
pullflags.NoPlatform = originalNoPlatform
pullflags.NoSecurityDB = originalNoSecurityDB
pullflags.NoModules = originalNoModules
pullflags.NoInstaller = originalNoInstaller
}()

// Set test values to skip actual operations
Expand All @@ -1250,6 +1252,7 @@ func TestPullFunction(t *testing.T) {
pullflags.NoPlatform = true
pullflags.NoSecurityDB = true
pullflags.NoModules = true
pullflags.NoInstaller = true

cmd := &cobra.Command{}
err := pull(cmd, []string{})
Expand Down
2 changes: 1 addition & 1 deletion internal/mirror/cmd/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const pushLong = `Upload Deckhouse Kubernetes Platform distribution bundle to th
This command pushes the Deckhouse Kubernetes Platform distribution into the specified container registry.

For more information on how to use it, consult the docs at
https://deckhouse.io/products/kubernetes-platform/documentation/v1/deckhouse-faq.html#manually-uploading-images-to-an-air-gapped-registry
https://deckhouse.io/products/kubernetes-platform/documentation/latest/installing/#manual-loading-of-dkp-images-and-vulnerability-db-into-a-private-registry

Additional configuration options for the d8 mirror family of commands are available as environment variables:

Expand Down
Loading