Skip to content

Commit

Permalink
feat: add talos_image_factory_url data source
Browse files Browse the repository at this point in the history
Add `talos_image_factory_url` data source.

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
frezbo committed Jul 18, 2024
1 parent ffc8102 commit 92fcb70
Show file tree
Hide file tree
Showing 15 changed files with 1,284 additions and 266 deletions.
1 change: 1 addition & 0 deletions .github/workflows/acceptance-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
libvirt-daemon-system \
qemu-kvm \
qemu-utils \
qemu-block-extra \
ovmf
sudo virtlockd -d
Expand Down
94 changes: 94 additions & 0 deletions docs/data-sources/image_factory_urls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "talos_image_factory_urls Data Source - talos"
subcategory: ""
description: |-
Generates URLs for different assets supported by the Talos image factory.
---

# talos_image_factory_urls (Data Source)

Generates URLs for different assets supported by the Talos image factory.

## Example Usage

```terraform
data "talos_image_factory_urls" "this" {
talos_version = "v1.7.5"
schematic_id = "376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba"
platform = "metal"
}
output "installer_image" {
value = data.talos_image_factory_urls.this.installer_image
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `schematic_id` (String) The schematic ID for which the URLs are generated.
- `talos_version` (String) The Talos version for which the URLs are generated.

### Optional

- `architecture` (String) The platform architecture for which the URLs are generated. Defaults to amd64.
- `platform` (String) The platform for which the URLs are generated.

#### Metal

- metal

#### Cloud Platforms
- aws
- gcp
- equinixMetal
- azure
- digital-ocean
- openstack
- vmware
- akamai
- hcloud
- nocloud
- oracle
- upcloud
- vultr
- `sbc` (String) The SBC's (Single Board Copmuters) for which the url are generated.

#### Single Board Computers
- rpi_generic
- bananapi_m64
- nanopi_r4s
- jetson_nano
- libretech_all_h3_cc_h5
- orangepi_r1_plus_lts
- pine64
- rock64
- rock4cplus
- rock4se
- rockpi_4
- rockpi_4c

### Read-Only

- `id` (String) The ID of this resource.
- `urls` (Attributes) The URLs for different assets supported by the Talos image factory. If the URL is not available for a specific asset, it will be an empty string. (see [below for nested schema](#nestedatt--urls))

<a id="nestedatt--urls"></a>
### Nested Schema for `urls`

Read-Only:

- `disk_image` (String) The URL for the disk image.
- `disk_image_secureboot` (String) The URL for the disk image with secure boot.
- `initramfs` (String) The URL for the initramfs image.
- `installer` (String) The URL for the installer image.
- `installer_secureboot` (String) The URL for the installer image with secure boot.
- `iso` (String) The URL for the ISO image.
- `iso_secureboot` (String) The URL for the ISO image with secure boot.
- `kernel` (String) The URL for the kernel image.
- `kernel_command_line` (String) The URL for the kernel command line.
- `pxe` (String) The URL for the PXE image.
- `uki` (String) The URL for the UKI image.
9 changes: 9 additions & 0 deletions examples/data-sources/talos_image_factory_urls/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
data "talos_image_factory_urls" "this" {
talos_version = "v1.7.5"
schematic_id = "376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba"
platform = "metal"
}

output "installer_image" {
value = data.talos_image_factory_urls.this.installer_image
}
70 changes: 65 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ require (
github.com/siderolabs/crypto v0.4.4
github.com/siderolabs/gen v0.5.0
github.com/siderolabs/go-blockdevice v0.4.7
github.com/siderolabs/image-factory v0.4.2
github.com/siderolabs/image-factory v0.4.3-0.20240718113440-8b4e0d9e9819
github.com/siderolabs/net v0.4.0
github.com/siderolabs/talos v1.8.0-alpha.1.0.20240716094326-980f9ebc0725
github.com/siderolabs/talos/pkg/machinery v1.8.0-alpha.1
github.com/stretchr/testify v1.9.0
golang.org/x/mod v0.19.0
google.golang.org/grpc v1.65.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/client-go v0.31.0-alpha.3
k8s.io/client-go v0.31.0-beta.0
)

require (
Expand Down Expand Up @@ -52,26 +52,49 @@ require (
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
github.com/containerd/go-cni v1.1.10 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/containernetworking/cni v1.2.2 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect
github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v24.0.7+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v27.0.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-chi/chi v4.1.2+incompatible // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/errors v0.22.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/runtime v0.28.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-openapi/validate v0.24.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/certificate-transparency-go v1.1.8 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-containerregistry v0.19.2 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/cli v1.1.6 // indirect
Expand All @@ -85,6 +108,7 @@ require (
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hc-install v0.7.0 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/hashicorp/hcl/v2 v2.21.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.21.0 // indirect
Expand All @@ -94,11 +118,16 @@ require (
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/in-toto/in-toto-golang v0.9.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/josharian/native v1.1.0 // indirect
github.com/jsimonetti/rtnetlink/v2 v2.0.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/letsencrypt/boulder v0.0.0-20231026200631-000cd05d5491 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand All @@ -108,31 +137,56 @@ require (
github.com/mdlayher/netlink v1.7.2 // indirect
github.com/mdlayher/socket v0.5.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nozzle/throttler v0.0.0-20180817012639-2ea982251481 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sassoftware/relic v7.2.1+incompatible // indirect
github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/siderolabs/go-circular v0.2.0 // indirect
github.com/siderolabs/go-kubernetes v0.2.10 // indirect
github.com/siderolabs/go-pointer v1.0.0 // indirect
github.com/siderolabs/go-procfs v0.1.2 // indirect
github.com/siderolabs/go-retry v0.3.3 // indirect
github.com/sigstore/cosign/v2 v2.2.4 // indirect
github.com/sigstore/rekor v1.3.6 // indirect
github.com/sigstore/sigstore v1.8.3 // indirect
github.com/sigstore/timestamp-authority v1.2.2 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/theupdateframework/go-tuf v0.7.0 // indirect
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
github.com/transparency-dev/merkle v0.0.2 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
Expand All @@ -141,6 +195,10 @@ require (
github.com/yuin/goldmark-meta v1.1.0 // indirect
github.com/zclconf/go-cty v1.14.4 // indirect
go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opentelemetry.io/otel v1.26.0 // indirect
go.opentelemetry.io/otel/metric v1.26.0 // indirect
go.opentelemetry.io/otel/trace v1.26.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/net v0.26.0 // indirect
Expand All @@ -155,13 +213,15 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/api v0.31.0-alpha.3 // indirect
k8s.io/apimachinery v0.31.0-alpha.3 // indirect
k8s.io/api v0.31.0-beta.0 // indirect
k8s.io/apimachinery v0.31.0-beta.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240703190633-0aa61b46e8c2 // indirect
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
Loading

0 comments on commit 92fcb70

Please sign in to comment.