Skip to content

Commit 8b4e0d9

Browse files
committed
chore: make metatadata pkg public
Make metadata pkg public. Signed-off-by: Noel Georgi <git@frezbo.dev>
1 parent 7a4de58 commit 8b4e0d9

4 files changed

Lines changed: 23 additions & 15 deletions

File tree

internal/frontend/http/ui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import (
2525
"gopkg.in/yaml.v3"
2626

2727
"github.com/siderolabs/image-factory/internal/artifacts"
28-
"github.com/siderolabs/image-factory/internal/frontend/http/metadata"
2928
"github.com/siderolabs/image-factory/internal/version"
29+
"github.com/siderolabs/image-factory/pkg/metadata"
3030
"github.com/siderolabs/image-factory/pkg/schematic"
3131
)
3232

pkg/client/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ func New(baseURL string, options ...Option) (*Client, error) {
5757
return c, nil
5858
}
5959

60+
// BaseURL returns the base URL of the client.
61+
func (c *Client) BaseURL() string {
62+
return c.baseURL.String()
63+
}
64+
6065
// SchematicCreate generates new schematic from the configuration.
6166
func (c *Client) SchematicCreate(ctx context.Context, schematic schematic.Schematic) (string, error) {
6267
data, err := schematic.Marshal()

internal/frontend/http/metadata/platforms.go renamed to pkg/metadata/platforms.go

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import (
1111
"github.com/siderolabs/image-factory/internal/artifacts"
1212
)
1313

14+
// Arch represents an architecture supported by Talos.
15+
type Arch = artifacts.Arch
16+
1417
// Platform represents a platform supported by Talos.
1518
type Platform struct {
1619
Name string
@@ -19,7 +22,7 @@ type Platform struct {
1922
Description string
2023

2124
MinVersion semver.Version
22-
Architectures []artifacts.Arch
25+
Architectures []Arch
2326
Documentation string
2427
DiskImageSuffix string
2528
BootMethods []string
@@ -45,7 +48,7 @@ func Platforms() []Platform {
4548
Label: "Amazon Web Services (AWS)",
4649
Description: "Runs on AWS VMs booted from an AMI",
4750

48-
Architectures: []artifacts.Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
51+
Architectures: []Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
4952
Documentation: "/talos-guides/install/cloud-platforms/aws/",
5053
DiskImageSuffix: "raw.xz",
5154
BootMethods: []string{
@@ -58,7 +61,7 @@ func Platforms() []Platform {
5861
Label: "Google Cloud (GCP)",
5962
Description: "Runs on Google Cloud VMs booted from a disk image",
6063

61-
Architectures: []artifacts.Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
64+
Architectures: []Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
6265
Documentation: "/talos-guides/install/cloud-platforms/gcp/",
6366
DiskImageSuffix: "raw.tar.gz",
6467
BootMethods: []string{
@@ -71,7 +74,7 @@ func Platforms() []Platform {
7174
Label: "Equinix Metal",
7275
Description: "Runs on Equinix Metal bare-metal servers",
7376

74-
Architectures: []artifacts.Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
77+
Architectures: []Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
7578
Documentation: "/talos-guides/install/bare-metal-platforms/equinix-metal/",
7679
BootMethods: []string{
7780
"pxe",
@@ -85,7 +88,7 @@ func Platforms() []Platform {
8588
Label: "Microsoft Azure",
8689
Description: "Runs on Microsoft Azure Linux Virtual Machines",
8790

88-
Architectures: []artifacts.Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
91+
Architectures: []Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
8992
Documentation: "/talos-guides/install/cloud-platforms/azure/",
9093
DiskImageSuffix: "vhd.xz",
9194
BootMethods: []string{
@@ -98,7 +101,7 @@ func Platforms() []Platform {
98101
Label: "Digital Ocean",
99102
Description: "Runs on Digital Ocean droplets",
100103

101-
Architectures: []artifacts.Arch{artifacts.ArchAmd64},
104+
Architectures: []Arch{artifacts.ArchAmd64},
102105
Documentation: "/talos-guides/install/cloud-platforms/digitalocean/",
103106
DiskImageSuffix: "raw.gz",
104107
BootMethods: []string{
@@ -111,7 +114,7 @@ func Platforms() []Platform {
111114
Label: "OpenStack",
112115
Description: "Runs on OpenStack virtual machines",
113116

114-
Architectures: []artifacts.Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
117+
Architectures: []Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
115118
Documentation: "/talos-guides/install/cloud-platforms/openstack/",
116119
DiskImageSuffix: "raw.xz",
117120
BootMethods: []string{
@@ -126,7 +129,7 @@ func Platforms() []Platform {
126129
Label: "VMWare",
127130
Description: "Runs on VMWare ESXi virtual machines",
128131

129-
Architectures: []artifacts.Arch{artifacts.ArchAmd64},
132+
Architectures: []Arch{artifacts.ArchAmd64},
130133
Documentation: "/talos-guides/install/virtualized-platforms/vmware/",
131134
DiskImageSuffix: "ova",
132135
BootMethods: []string{
@@ -141,7 +144,7 @@ func Platforms() []Platform {
141144
Label: "Akamai",
142145
Description: "Runs on Akamai Cloud (Linode) virtual machines",
143146

144-
Architectures: []artifacts.Arch{artifacts.ArchAmd64},
147+
Architectures: []Arch{artifacts.ArchAmd64},
145148
MinVersion: semver.MustParse("1.7.0"),
146149
Documentation: "/talos-guides/install/cloud-platforms/akamai/",
147150
DiskImageSuffix: "raw.gz",
@@ -156,7 +159,7 @@ func Platforms() []Platform {
156159
Label: "Hetzner",
157160
Description: "Runs on Hetzner virtual machines",
158161

159-
Architectures: []artifacts.Arch{artifacts.ArchAmd64},
162+
Architectures: []Arch{artifacts.ArchAmd64},
160163
Documentation: "/talos-guides/install/cloud-platforms/hetzner/",
161164
DiskImageSuffix: "raw.xz",
162165
BootMethods: []string{
@@ -169,7 +172,7 @@ func Platforms() []Platform {
169172
Label: "Nocloud",
170173
Description: "Runs on various hypervisors supporting 'nocloud' metadata (Proxmox, Oxide Computer, etc.)",
171174

172-
Architectures: []artifacts.Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
175+
Architectures: []Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
173176
Documentation: "/talos-guides/install/cloud-platforms/nocloud/",
174177
DiskImageSuffix: "raw.xz",
175178
BootMethods: []string{
@@ -185,7 +188,7 @@ func Platforms() []Platform {
185188
Label: "Oracle Cloud",
186189
Description: "Runs on Oracle Cloud virtual machines",
187190

188-
Architectures: []artifacts.Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
191+
Architectures: []Arch{artifacts.ArchAmd64, artifacts.ArchArm64},
189192
Documentation: "/talos-guides/install/cloud-platforms/oracle/",
190193
DiskImageSuffix: "raw.xz",
191194
BootMethods: []string{
@@ -199,7 +202,7 @@ func Platforms() []Platform {
199202
Label: "UpCloud",
200203
Description: "Runs on UpCloud virtual machines",
201204

202-
Architectures: []artifacts.Arch{artifacts.ArchAmd64},
205+
Architectures: []Arch{artifacts.ArchAmd64},
203206
Documentation: "/talos-guides/install/cloud-platforms/ucloud/",
204207
DiskImageSuffix: "raw.xz",
205208
BootMethods: []string{
@@ -212,7 +215,7 @@ func Platforms() []Platform {
212215
Label: "Vultr",
213216
Description: "Runs on Vultr Cloud Compute virtual machines",
214217

215-
Architectures: []artifacts.Arch{artifacts.ArchAmd64},
218+
Architectures: []Arch{artifacts.ArchAmd64},
216219
Documentation: "/talos-guides/install/cloud-platforms/vultr/",
217220
BootMethods: []string{
218221
"iso",

0 commit comments

Comments
 (0)