Skip to content

Commit b9c1684

Browse files
committed
Deprecate host attributes in instance info
The fields still exist, but are no longer list by `limactl ls --list-fields`. Signed-off-by: Jan Dubois <[email protected]>
1 parent 400c9e9 commit b9c1684

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

cmd/limactl/list.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ func fieldNames() []string {
2828
f := t.Field(i)
2929
if f.Anonymous {
3030
for j := range f.Type.NumField() {
31-
names = append(names, f.Type.Field(j).Name)
31+
if tag := f.Tag.Get("lima"); tag != "deprecated" {
32+
names = append(names, f.Type.Field(j).Name)
33+
}
3234
}
3335
} else {
34-
names = append(names, t.Field(i).Name)
36+
if tag := f.Tag.Get("lima"); tag != "deprecated" {
37+
names = append(names, t.Field(i).Name)
38+
}
3539
}
3640
}
3741
return names

pkg/store/instance.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,12 @@ func ReadPIDFile(path string) (int, error) {
227227
type FormatData struct {
228228
limatype.Instance `yaml:",inline"`
229229

230-
HostOS string `json:"HostOS" yaml:"HostOS"`
231-
HostArch string `json:"HostArch" yaml:"HostArch"`
232-
LimaHome string `json:"LimaHome" yaml:"LimaHome"`
233-
IdentityFile string `json:"IdentityFile" yaml:"IdentityFile"`
230+
// Using these host attributes is deprecated; they will be removed in Lima 3.0
231+
// The values are available from `limactl info` as hostOS, hostArch, limaHome, and identifyFile.
232+
HostOS string `json:"HostOS" yaml:"HostOS" lima:"deprecated"`
233+
HostArch string `json:"HostArch" yaml:"HostArch" lima:"deprecated"`
234+
LimaHome string `json:"LimaHome" yaml:"LimaHome" lima:"deprecated"`
235+
IdentityFile string `json:"IdentityFile" yaml:"IdentityFile" lima:"deprecated"`
234236
}
235237

236238
var FormatHelp = "\n" +

0 commit comments

Comments
 (0)