[deckhouse-cli] Add built-in package command#370
Merged
Conversation
- mirror d8-package-plugin layout 1:1: pkg/cmd/, internal/, templates/ - bootstrap/build/verify subcommands; layout/templates/docs/images/oss/icon linters - add thin packagecmd.go adapter (NewCommand) for cmd/d8/root.go registration - import paths rewritten: runtime.io/plugins/package/ -> github.com/deckhouse/deckhouse-cli/internal/packagecmd/ - bump go.mod: add viper, go-openapi/spec, swag/yamlutils, golang.org/x/image; tidy promotes uuid, mapstructure - 2 prealloc fixes for stricter d8-cli linter Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- register packagecmd.NewCommand() in cmd/d8/root.go outside DECKHOUSE_PLUGINS_ENABLED - drop PackagePluginName constant (no longer wrapped by plugin runner) - drop redundant "package version" subcommand (use global "d8 --version") Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
296372a to
32403a7
Compare
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
ldmonster
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Injected
d8 packageas a built-in command.The
packagecommand is needed for:.pkglint.yaml.How it works
The command is a top-level entry point with three subcommands.
Internal layout under
internal/packagecmd/:pkg/cmd/- cobra wrappersinternal/- business logic and linterstemplates/-//go:embedmodule/application skeletons and werf stage templatespackagecmd.go- thinNewCommand()adapter registered incmd/d8/root.goNew direct deps in
go.mod:github.com/spf13/vipergithub.com/go-openapi/spec,github.com/go-openapi/swag/yamlutils,golang.org/x/image(webp decoder for icon linter).Tidy also promoted
uuidandmapstructurefrom indirect.Before / After
Before:
packageis a plugin (lazy-loaded) command.After:
packageis internal (built-in) command.Tests
Manual smoke checks:
d8 package --helplistsbootstrap,build,verifyd8 package bootstrap module foocreates a complete module skeleton (charts, docs, hooks, images, openapi, templates, package.yaml, .pkglint.yaml, git init)d8 package bootstrap application foocreates an application skeletond8 package verifyin a generated application package returns0 errors, 1 warning(missing icon, expected for a bare skeleton)task testpassestask lint:checkis clean for the new code