Skip to content

Commit 770d8ac

Browse files
committed
Mark the limactl template command and template embedding as experimental
Signed-off-by: Jan Dubois <[email protected]>
1 parent 1f00288 commit 770d8ac

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

cmd/limactl/template.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ func newTemplateCommand() *cobra.Command {
2424
// The template command is still hidden because the subcommands and options are still under development
2525
// and subject to change at any time.
2626
Hidden: true,
27+
PreRun: func(*cobra.Command, []string) {
28+
logrus.Warn("`limactl template` is experimental")
29+
},
2730
}
2831
templateCommand.AddCommand(
2932
newTemplateCopyCommand(),

pkg/limatmpl/embed.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"path/filepath"
88
"slices"
9+
"sync"
910

1011
"github.com/coreos/go-semver/semver"
1112
"github.com/lima-vm/lima/pkg/store/dirnames"
@@ -15,6 +16,13 @@ import (
1516
"github.com/sirupsen/logrus"
1617
)
1718

19+
var warnBaseIsExperimental = sync.OnceFunc(func() {
20+
logrus.Warn("`base` is experimental")
21+
})
22+
var warnFileIsExperimental = sync.OnceFunc(func() {
23+
logrus.Warn("`provision[*].file` and `probes[*].file` are experimental")
24+
})
25+
1826
// Embed will recursively resolve all "base" dependencies and update the
1927
// template with the merged result. It also inlines all external provisioning
2028
// and probe scripts.
@@ -64,6 +72,7 @@ func (tmpl *Template) embed(ctx context.Context, defaultBase bool, seen map[stri
6472
}
6573
}
6674
for _, baseLocator := range bases {
75+
warnBaseIsExperimental()
6776
logrus.Debugf("Merging base template %q", baseLocator)
6877
base, err := Read(ctx, "", baseLocator)
6978
if err != nil {
@@ -497,6 +506,7 @@ func (tmpl *Template) embedAllScripts(ctx context.Context) error {
497506
for i, p := range tmpl.Config.Probes {
498507
// Don't overwrite existing file. This should throw an error during validation.
499508
if p.File != nil && p.Script == "" {
509+
warnFileIsExperimental()
500510
scriptTmpl, err := Read(ctx, "", *p.File)
501511
if err != nil {
502512
return err
@@ -506,6 +516,7 @@ func (tmpl *Template) embedAllScripts(ctx context.Context) error {
506516
}
507517
for i, p := range tmpl.Config.Provision {
508518
if p.File != nil && p.Script == "" {
519+
warnFileIsExperimental()
509520
scriptTmpl, err := Read(ctx, "", *p.File)
510521
if err != nil {
511522
return err

templates/default.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ containerd:
211211
# Provisioning scripts need to be idempotent because they might be called
212212
# multiple times, e.g. when the host VM is being restarted.
213213
# The scripts can use the following template variables: {{.Home}}, {{.Name}}, {{.Hostname}}, {{.UID}}, {{.User}}, and {{.Param.Key}}.
214-
# Alternatively the script can be provided using the "file" property. This file is read when the instance is created and then
215-
# stored under the "script" property. When "file" is specified, then "script" must be empty.
214+
#
215+
# EXPERIMENTAL Alternatively the script can be provided using the "file" property. This file is read when the instance
216+
# is created and then stored under the "script" property. When "file" is specified "script" must be empty.
216217
# Relative script files will be resolved relative to the location of the template file.
217218
# 🟢 Builtin default: []
218219
# provision:
@@ -252,8 +253,8 @@ containerd:
252253
# Probe scripts to check readiness.
253254
# The scripts run in user mode. They must start with a '#!' line.
254255
# The scripts can use the following template variables: {{.Home}}, {{.Name}}, {{.Hostname}}, {{.UID}}, {{.User}}, and {{.Param.Key}}.
255-
# Alternatively the script can be provided using the "file" property. This file is read when the instance is created and then
256-
# stored under the "script" property. When "file" is specified, then "script" must be empty.
256+
# EXPERIMENTAL Alternatively the script can be provided using the "file" property. This file is read when the instance
257+
# is created and then stored under the "script" property. When "file" is specified "script" must be empty.
257258
# Relative script files will be resolved relative to the location of the template file.
258259
# 🟢 Builtin default: []
259260
# probes:
@@ -280,6 +281,7 @@ containerd:
280281
# 🟢 Builtin default: not set
281282
minimumLimaVersion: null
282283

284+
# EXPERIMENTAL
283285
# Default settings can be imported from base templates. These will be merged in when the instance
284286
# is created, and the combined template is stored in the instance directory.
285287
# This setting ca be either a single string, or a list of strings.
@@ -569,6 +571,7 @@ nestedVirtualization: null
569571
# on each restart. It can be used to globally override settings, e.g. make
570572
# the mount of the home directory writable.
571573

574+
# EXPERIMENTAL
572575
# A third mechanism is $LIMA_HOME/_config/base.yaml. It is similar to
573576
# `default.yaml` but will be merged during the `base` template embedding
574577
# when the instance is created, and not on every start. It becomes part

0 commit comments

Comments
 (0)