Skip to content

Commit 9efe905

Browse files
authored
Revert "feat: add image capabilities, test suites, and publish config (#101)"
This reverts commit 710de7a.
1 parent 710de7a commit 9efe905

File tree

15 files changed

+4
-953
lines changed

15 files changed

+4
-953
lines changed

docs/user/reference/config/config-file.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ All config files share the same schema — there is no distinction between a "ro
1414
| `components` | map of objects | Component (package) definitions | [Components](components.md) |
1515
| `component-groups` | map of objects | Named groups of components with shared defaults | [Component Groups](component-groups.md) |
1616
| `images` | map of objects | Image definitions (VMs, containers) | [Images](images.md) |
17-
| `test-suites` | map of objects | Named test suite definitions referenced by images | [Test Suites](test-suites.md) |
1817
| `tools` | object | Configuration for external tools used by azldev | [Tools](tools.md) |
19-
| `default-package-config` | object | Project-wide default applied to all binary packages | [Package Groups — Resolution Order](package-groups.md#resolution-order) |
20-
| `package-groups` | map of objects | Named groups of binary packages with shared config | [Package Groups](package-groups.md) |
2118

2219
## Includes
2320

docs/user/reference/config/images.md

Lines changed: 2 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ The `[images]` section defines system images (VMs, containers, etc.) that azldev
88
|-------|----------|------|----------|-------------|
99
| Description | `description` | string | No | Human-readable description of the image |
1010
| Definition | `definition` | [ImageDefinition](#image-definition) | No | Specifies the image definition format, file path, and optional profile |
11-
| Capabilities | `capabilities` | [ImageCapabilities](#image-capabilities) | No | Describes features and properties of this image |
12-
| Tests | `tests` | [ImageTests](#image-tests) | No | Test configuration for this image |
13-
| Publish | `publish` | [ImagePublish](#image-publish) | No | Publishing settings for this image |
1411

1512
## Image Definition
1613

@@ -22,59 +19,24 @@ The `definition` field tells azldev where to find the image definition file and
2219
| Path | `path` | string | No | Path to the image definition file, relative to the config file |
2320
| Profile | `profile` | string | No | Build profile to use when building the image (format-specific) |
2421

25-
## Image Capabilities
26-
27-
The `capabilities` subtable describes what the image supports. All fields are optional booleans using tri-state semantics: `true` (explicitly enabled), `false` (explicitly disabled), or omitted (unspecified / inherit from defaults).
28-
29-
| Field | TOML Key | Type | Default | Description |
30-
|-------|----------|------|---------|-------------|
31-
| Machine Bootable | `machine-bootable` | bool | unset | Whether the image can be booted on a machine (bare metal or VM) |
32-
| Container | `container` | bool | unset | Whether the image can be run on an OCI container host |
33-
| Systemd | `systemd` | bool | unset | Whether the image runs systemd as its init system |
34-
| Runtime Package Management | `runtime-package-management` | bool | unset | Whether the image supports installing/removing packages at runtime (e.g., via dnf/tdnf) |
35-
36-
## Image Tests
37-
38-
The `tests` subtable links an image to one or more test suites defined in the top-level [`[test-suites]`](test-suites.md) section.
39-
40-
| Field | TOML Key | Type | Required | Description |
41-
|-------|----------|------|----------|-------------|
42-
| Test Suites | `test-suites` | array of inline tables | No | List of test suite references. Each entry must have a `name` field matching a key in `[test-suites]`. |
43-
44-
## Image Publish
45-
46-
The `publish` subtable configures where an image is published. Unlike packages (which target a single channel), images may be published to multiple channels simultaneously.
47-
48-
| Field | TOML Key | Type | Required | Description |
49-
|-------|----------|------|----------|-------------|
50-
| Channels | `channels` | string array | No | List of publish channels for this image |
51-
5222
> **Note:** Each image name must be unique across all config files. Defining the same image name in two files produces an error.
5323
5424
## Examples
5525

56-
### VM image with capabilities
26+
### VM image using Kiwi
5727

5828
```toml
5929
[images.vm-base]
6030
description = "VM Base Image"
6131
definition = { type = "kiwi", path = "vm-base/vm-base.kiwi" }
62-
63-
[images.vm-base.capabilities]
64-
machine-bootable = true
65-
systemd = true
66-
runtime-package-management = true
6732
```
6833

69-
### Container image with capabilities
34+
### Container image
7035

7136
```toml
7237
[images.container-base]
7338
description = "Container Base Image"
7439
definition = { type = "kiwi", path = "container-base/container-base.kiwi" }
75-
76-
[images.container-base.capabilities]
77-
container = true
7840
```
7941

8042
### Image with a build profile
@@ -85,37 +47,7 @@ description = "Azure-optimized VM image"
8547
definition = { type = "kiwi", path = "vm-azure/vm-azure.kiwi", profile = "azure" }
8648
```
8749

88-
### Image with test suite references
89-
90-
```toml
91-
[images.vm-base]
92-
description = "VM Base Image"
93-
definition = { type = "kiwi", path = "vm-base/vm-base.kiwi" }
94-
95-
[images.vm-base.capabilities]
96-
machine-bootable = true
97-
systemd = true
98-
99-
[images.vm-base.tests]
100-
test-suites = [
101-
{ name = "smoke" },
102-
{ name = "integration" },
103-
]
104-
```
105-
106-
### Image with publish channels
107-
108-
```toml
109-
[images.vm-base]
110-
description = "VM Base Image"
111-
definition = { type = "kiwi", path = "vm-base/vm-base.kiwi" }
112-
113-
[images.vm-base.publish]
114-
channels = ["registry-prod", "registry-staging"]
115-
```
116-
11750
## Related Resources
11851

11952
- [Config File Structure](config-file.md) — top-level config file layout
120-
- [Test Suites](test-suites.md) — test suite definitions
12153
- [Tools](tools.md) — Image Customizer tool configuration

docs/user/reference/config/test-suites.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

internal/app/azldev/cmds/image/list.go

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"strings"
1111

1212
"github.com/microsoft/azure-linux-dev-tools/internal/app/azldev"
13-
"github.com/microsoft/azure-linux-dev-tools/internal/projectconfig"
1413
"github.com/samber/lo"
1514
"github.com/spf13/cobra"
1615
)
@@ -29,26 +28,6 @@ type ImageListResult struct {
2928
// Description of the image.
3029
Description string `json:"description"`
3130

32-
// Capabilities describes the features and properties of this image.
33-
Capabilities projectconfig.ImageCapabilities `json:"capabilities" table:"-"`
34-
35-
// CapabilitiesSummary is a comma-separated summary of enabled capabilities for table
36-
// display.
37-
CapabilitiesSummary string `json:"-" table:"Capabilities"`
38-
39-
// Tests holds the test configuration for this image, matching the original config
40-
// structure.
41-
Tests projectconfig.ImageTestsConfig `json:"tests" table:"-"`
42-
43-
// TestsSummary is a comma-separated summary of test suite names for table display.
44-
TestsSummary string `json:"-" table:"Tests"`
45-
46-
// Publish holds the publish settings for this image.
47-
Publish projectconfig.ImagePublishConfig `json:"publish" table:"-"`
48-
49-
// PublishSummary is a comma-separated summary of publish channels for table display.
50-
PublishSummary string `json:"-" table:"Publish"`
51-
5231
// Definition contains the image definition details (hidden from table output).
5332
Definition ImageDefinitionResult `json:"definition" table:"-"`
5433
}
@@ -129,16 +108,9 @@ func ListImages(env *azldev.Env, options *ListImageOptions) ([]ImageListResult,
129108
}
130109

131110
imageConfig := cfg.Images[name]
132-
133111
results = append(results, ImageListResult{
134-
Name: name,
135-
Description: imageConfig.Description,
136-
Capabilities: imageConfig.Capabilities,
137-
CapabilitiesSummary: strings.Join(imageConfig.Capabilities.EnabledNames(), ", "),
138-
Tests: imageConfig.Tests,
139-
TestsSummary: strings.Join(imageConfig.TestNames(), ", "),
140-
Publish: imageConfig.Publish,
141-
PublishSummary: strings.Join(imageConfig.Publish.Channels, ", "),
112+
Name: name,
113+
Description: imageConfig.Description,
142114
Definition: ImageDefinitionResult{
143115
Type: string(imageConfig.Definition.DefinitionType),
144116
Path: imageConfig.Definition.Path,

internal/app/azldev/cmds/image/list_test.go

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/microsoft/azure-linux-dev-tools/internal/app/azldev/cmds/image"
1010
"github.com/microsoft/azure-linux-dev-tools/internal/app/azldev/core/testutils"
1111
"github.com/microsoft/azure-linux-dev-tools/internal/projectconfig"
12-
"github.com/samber/lo"
1312
"github.com/stretchr/testify/assert"
1413
"github.com/stretchr/testify/require"
1514
)
@@ -79,91 +78,6 @@ func TestListImages_AllImages(t *testing.T) {
7978
assert.Equal(t, "Image B description", results[1].Description)
8079
}
8180

82-
func TestListImages_WithCapabilitiesAndTests(t *testing.T) {
83-
testEnv := testutils.NewTestEnv(t)
84-
testEnv.Config.Images = map[string]projectconfig.ImageConfig{
85-
"vm-base": {
86-
Name: "vm-base",
87-
Description: "VM Base Image",
88-
Capabilities: projectconfig.ImageCapabilities{
89-
MachineBootable: lo.ToPtr(true),
90-
Systemd: lo.ToPtr(true),
91-
},
92-
Tests: projectconfig.ImageTestsConfig{
93-
TestSuites: []projectconfig.TestSuiteRef{
94-
{Name: "smoke"},
95-
{Name: "integration"},
96-
},
97-
},
98-
Publish: projectconfig.ImagePublishConfig{
99-
Channels: []string{"registry-prod", "registry-staging"},
100-
},
101-
},
102-
"container-base": {
103-
Name: "container-base",
104-
Description: "Container Base Image",
105-
Capabilities: projectconfig.ImageCapabilities{
106-
Container: lo.ToPtr(true),
107-
},
108-
Tests: projectconfig.ImageTestsConfig{
109-
TestSuites: []projectconfig.TestSuiteRef{
110-
{Name: "smoke"},
111-
},
112-
},
113-
Publish: projectconfig.ImagePublishConfig{
114-
Channels: []string{"registry-prod"},
115-
},
116-
},
117-
"minimal": {
118-
Name: "minimal",
119-
Description: "Minimal image with no capabilities or tests",
120-
},
121-
}
122-
123-
options := &image.ListImageOptions{}
124-
125-
results, err := image.ListImages(testEnv.Env, options)
126-
require.NoError(t, err)
127-
require.Len(t, results, 3)
128-
129-
// Results sorted alphabetically.
130-
assert.Equal(t, "container-base", results[0].Name)
131-
assert.Equal(t, lo.ToPtr(true), results[0].Capabilities.Container)
132-
assert.Nil(t, results[0].Capabilities.MachineBootable)
133-
assert.Equal(t, "container", results[0].CapabilitiesSummary)
134-
assert.Equal(t, projectconfig.ImageTestsConfig{
135-
TestSuites: []projectconfig.TestSuiteRef{{Name: "smoke"}},
136-
}, results[0].Tests)
137-
assert.Equal(t, "smoke", results[0].TestsSummary)
138-
assert.Equal(t, projectconfig.ImagePublishConfig{
139-
Channels: []string{"registry-prod"},
140-
}, results[0].Publish)
141-
assert.Equal(t, "registry-prod", results[0].PublishSummary)
142-
143-
assert.Equal(t, "minimal", results[1].Name)
144-
assert.Nil(t, results[1].Capabilities.MachineBootable)
145-
assert.Nil(t, results[1].Capabilities.Container)
146-
assert.Empty(t, results[1].CapabilitiesSummary)
147-
assert.Empty(t, results[1].Tests.TestSuites)
148-
assert.Empty(t, results[1].TestsSummary)
149-
assert.Empty(t, results[1].Publish.Channels)
150-
assert.Empty(t, results[1].PublishSummary)
151-
152-
assert.Equal(t, "vm-base", results[2].Name)
153-
assert.Equal(t, lo.ToPtr(true), results[2].Capabilities.MachineBootable)
154-
assert.Equal(t, lo.ToPtr(true), results[2].Capabilities.Systemd)
155-
assert.Nil(t, results[2].Capabilities.Container)
156-
assert.Equal(t, "machine-bootable, systemd", results[2].CapabilitiesSummary)
157-
assert.Equal(t, projectconfig.ImageTestsConfig{
158-
TestSuites: []projectconfig.TestSuiteRef{{Name: "smoke"}, {Name: "integration"}},
159-
}, results[2].Tests)
160-
assert.Equal(t, "smoke, integration", results[2].TestsSummary)
161-
assert.Equal(t, projectconfig.ImagePublishConfig{
162-
Channels: []string{"registry-prod", "registry-staging"},
163-
}, results[2].Publish)
164-
assert.Equal(t, "registry-prod, registry-staging", results[2].PublishSummary)
165-
}
166-
16781
func TestListImages_ExactMatch(t *testing.T) {
16882
testEnv := testutils.NewTestEnv(t)
16983
testEnv.Config.Images = map[string]projectconfig.ImageConfig{

internal/projectconfig/configfile.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ type ConfigFile struct {
5454
// to be applied to sets of binary packages.
5555
PackageGroups map[string]PackageGroupConfig `toml:"package-groups,omitempty" validate:"dive" jsonschema:"title=Package groups,description=Definitions of package groups for shared binary package configuration"`
5656

57-
// Definitions of test suites.
58-
TestSuites map[string]TestSuiteConfig `toml:"test-suites,omitempty" validate:"dive" jsonschema:"title=Test Suites,description=Definitions of test suites for this project"`
59-
6057
// Internal fields used to track the origin of the config file; `dir` is the directory
6158
// that the config file's relative paths are based from.
6259
sourcePath string `toml:"-"`

0 commit comments

Comments
 (0)