Skip to content

Commit

Permalink
chore: define public const for the schematic ID extension name
Browse files Browse the repository at this point in the history
Make it const to simplify discovery of the Talos machine schematic IDs by
third party services.

Signed-off-by: Artem Chernyshev <[email protected]>
  • Loading branch information
Unix4ever committed Dec 12, 2023
1 parent 01fcbf1 commit 548128c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/artifacts/schematic.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/siderolabs/talos/pkg/machinery/extensions"
"gopkg.in/yaml.v3"

"github.com/siderolabs/image-factory/pkg/constants"
"github.com/siderolabs/image-factory/pkg/schematic"
)

Expand Down Expand Up @@ -49,7 +50,7 @@ func schematicExtension(schematicID string) (io.Reader, error) {
manifest := extensions.Manifest{
Version: "v1alpha1",
Metadata: extensions.Metadata{
Name: "schematic",
Name: constants.SchematicIDExtensionName,
Version: schematicID,
Author: "Image Factory",
Description: "Virtual extension which specifies the schematic of the image built with Image Factory.",
Expand Down
10 changes: 10 additions & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// Package constants defines image factory public constants.
package constants

// SchematicIDExtensionName when the image factory generates a Talos image
// it adds special extension into the image that constains schematic ID information.
const SchematicIDExtensionName = "schematic"

0 comments on commit 548128c

Please sign in to comment.