Skip to content

Commit 51bcfb5

Browse files
committed
feat: rename image default and source bundle
s/default/k8s-bundle s/source-bundle/talos-bundle for UX consistency when generating lists of images used by talos. Remove non-k8s images from k8s-bundle list. Signed-off-by: Justin Garrison <justin.garrison@siderolabs.com>
1 parent 585abe9 commit 51bcfb5

File tree

4 files changed

+38
-34
lines changed

4 files changed

+38
-34
lines changed

cmd/talosctl/cmd/talos/image.go

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ var imagePullCmd = &cobra.Command{
138138
},
139139
}
140140

141-
// imageDefaultCmd represents the image default command.
141+
// imageDefaultCmd represents the image k8s-bundle command.
142142
var imageDefaultCmd = &cobra.Command{
143-
Use: "default",
144-
Short: "List the default images used by Talos",
145-
Long: ``,
143+
Use: "k8s-bundle",
144+
Aliases: []string{"default"},
145+
Short: "List the default Kubernetes images used by Talos",
146+
Long: ``,
146147
RunE: func(cmd *cobra.Command, args []string) error {
147148
images := images.List(container.NewV1Alpha1(&v1alpha1.Config{
148149
MachineConfig: &v1alpha1.MachineConfig{
@@ -166,15 +167,6 @@ var imageDefaultCmd = &cobra.Command{
166167
fmt.Printf("%s\n", images.KubeScheduler)
167168
fmt.Printf("%s\n", images.KubeProxy)
168169
fmt.Printf("%s\n", images.Kubelet)
169-
170-
if slices.Contains([]string{provisionerInstaller, provisionerAll}, imageDefaultCmdFlags.provisioner.String()) {
171-
fmt.Printf("%s\n", images.Installer)
172-
}
173-
174-
if slices.Contains([]string{provisionerDocker, provisionerAll}, imageDefaultCmdFlags.provisioner.String()) {
175-
fmt.Printf("%s\n", images.Talos)
176-
}
177-
178170
fmt.Printf("%s\n", images.Pause)
179171

180172
return nil
@@ -193,19 +185,24 @@ var imageDefaultCmdFlags = struct {
193185
provisioner: helpers.StringChoice(provisionerInstaller, provisionerDocker, provisionerAll),
194186
}
195187

196-
// imageSourceBundleCmd represents the image source-bundle command.
188+
// imageSourceBundleCmd represents the image talos-bundle command.
197189
var imageSourceBundleCmd = &cobra.Command{
198-
Use: "source-bundle <talos-version>",
199-
Short: "List the source images used for building Talos",
190+
Use: "talos-bundle [talos-version]",
191+
Short: "List the default system images and extensions used for Talos",
200192
Long: ``,
201193
Args: cobra.MatchAll(
202-
cobra.ExactArgs(1),
194+
cobra.RangeArgs(0, 1),
203195
func(cmd *cobra.Command, args []string) error {
204196
maximumVersion, err := semver.ParseTolerant(version.Tag)
205197
if err != nil {
206198
panic(err) // panic, this should never happen
207199
}
208200

201+
// If no version specified, use current version
202+
if len(args) == 0 {
203+
return nil
204+
}
205+
209206
tag := args[0]
210207

211208
ver, err := semver.ParseTolerant(tag)
@@ -222,12 +219,19 @@ var imageSourceBundleCmd = &cobra.Command{
222219
),
223220
RunE: func(cmd *cobra.Command, args []string) error {
224221
var (
225-
tag = args[0]
222+
tag string
226223
err error
227224
extensions []artifacts.ExtensionRef
228225
overlays []artifacts.OverlayRef
229226
)
230227

228+
// Default to current version if not specified
229+
if len(args) == 0 {
230+
tag = version.Tag
231+
} else {
232+
tag = args[0]
233+
}
234+
231235
sources := images.ListSourcesFor(tag)
232236

233237
extensions, err = artifacts.FetchOfficialExtensions(tag)

hack/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function release-notes {
2222
release-tool "${2}" --gfm > "${1}"
2323

2424
echo -e '\n## Images\n\n```' >> ${1}
25-
${ARTIFACTS}/talosctl-linux-amd64 image default >> ${1}
25+
${ARTIFACTS}/talosctl-linux-amd64 image k8s-bundle >> ${1}
2626
echo -e '```\n' >> ${1}
2727
}
2828

internal/integration/cli/image.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ func (suite *ImageSuite) SuiteName() string {
3030

3131
// TestDefault verifies default Talos list of images.
3232
func (suite *ImageSuite) TestDefault() {
33-
suite.RunCLI([]string{"image", "default"},
33+
suite.RunCLI([]string{"image", "k8s-bundle"},
3434
base.StdoutShouldMatch(regexp.MustCompile(regexp.QuoteMeta("registry.k8s.io/kube-apiserver"))),
3535
)
3636
}
3737

38-
// TestSourceBundle verifies source-bundle Talos list of images.
38+
// TestSourceBundle verifies talos-bundle Talos list of images.
3939
func (suite *ImageSuite) TestSourceBundle() {
40-
suite.RunCLI([]string{"image", "source-bundle", "v1.11.2"},
40+
suite.RunCLI([]string{"image", "talos-bundle", "v1.11.2"},
4141
base.StdoutShouldMatch(regexp.MustCompile(regexp.QuoteMeta(`ghcr.io/siderolabs/installer:v1.11.2
4242
ghcr.io/siderolabs/installer-base:v1.11.2
4343
ghcr.io/siderolabs/imager:v1.11.2
@@ -162,7 +162,7 @@ func (suite *ImageSuite) TestCacheCreateOCI() {
162162
suite.T().Skip("skipping in short mode")
163163
}
164164

165-
stdOut, _ := suite.RunCLI([]string{"image", "default"})
165+
stdOut, _ := suite.RunCLI([]string{"image", "k8s-bundle"})
166166

167167
imagesList := strings.Split(strings.Trim(stdOut, "\n"), "\n")
168168

@@ -187,7 +187,7 @@ func (suite *ImageSuite) TestCacheCreateFlat() {
187187
suite.T().Skip("skipping in short mode")
188188
}
189189

190-
stdOut, _ := suite.RunCLI([]string{"image", "default"})
190+
stdOut, _ := suite.RunCLI([]string{"image", "k8s-bundle"})
191191

192192
imagesList := strings.Split(strings.Trim(stdOut, "\n"), "\n")
193193

website/content/v1.12/reference/cli.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,18 +1982,18 @@ talosctl image cache-serve [flags]
19821982

19831983
* [talosctl image](#talosctl-image) - Manage CRI container images
19841984

1985-
## talosctl image default
1985+
## talosctl image k8s-bundle
19861986

1987-
List the default images used by Talos
1987+
List the default Kubernetes images used by Talos
19881988

19891989
```
1990-
talosctl image default [flags]
1990+
talosctl image k8s-bundle [flags]
19911991
```
19921992

19931993
### Options
19941994

19951995
```
1996-
-h, --help help for default
1996+
-h, --help help for k8s-bundle
19971997
--provisioner string include provisioner specific images (default "installer")
19981998
```
19991999

@@ -2073,18 +2073,18 @@ talosctl image pull <image> [flags]
20732073

20742074
* [talosctl image](#talosctl-image) - Manage CRI container images
20752075

2076-
## talosctl image source-bundle
2076+
## talosctl image talos-bundle
20772077

2078-
List the source images used for building Talos
2078+
List the default system images and extensions used for Talos
20792079

20802080
```
2081-
talosctl image source-bundle <talos-version> [flags]
2081+
talosctl image talos-bundle [talos-version] [flags]
20822082
```
20832083

20842084
### Options
20852085

20862086
```
2087-
-h, --help help for source-bundle
2087+
-h, --help help for talos-bundle
20882088
```
20892089

20902090
### Options inherited from parent commands
@@ -2126,10 +2126,10 @@ Manage CRI container images
21262126
* [talosctl image cache-cert-gen](#talosctl-image-cache-cert-gen) - Generate TLS certificates and CA patch required for securing image cache to Talos communication
21272127
* [talosctl image cache-create](#talosctl-image-cache-create) - Create a cache of images in OCI format into a directory
21282128
* [talosctl image cache-serve](#talosctl-image-cache-serve) - Serve an OCI image cache directory over HTTP(S) as a container registry
2129-
* [talosctl image default](#talosctl-image-default) - List the default images used by Talos
2129+
* [talosctl image k8s-bundle](#talosctl-image-k8s-bundle) - List the default Kubernetes images used by Talos
21302130
* [talosctl image list](#talosctl-image-list) - List CRI images
21312131
* [talosctl image pull](#talosctl-image-pull) - Pull an image into CRI
2132-
* [talosctl image source-bundle](#talosctl-image-source-bundle) - List the source images used for building Talos
2132+
* [talosctl image talos-bundle](#talosctl-image-talos-bundle) - List the default system images and extensions used for Talos
21332133

21342134
## talosctl inject serviceaccount
21352135

0 commit comments

Comments
 (0)