mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
cli: use Bazel container images
This commit is contained in:
parent
bd889bd6a7
commit
9dfad32e33
19 changed files with 376 additions and 26 deletions
33
internal/config/imageversion/BUILD.bazel
Normal file
33
internal/config/imageversion/BUILD.bazel
Normal file
|
@ -0,0 +1,33 @@
|
|||
# gazelle:ignore
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("//bazel/oci:containers.bzl", "config_containers")
|
||||
load("//bazel/oci:pin.bzl", "oci_go_source")
|
||||
|
||||
GENERATED_SRCS = [
|
||||
":" + container["name"]
|
||||
for container in config_containers()
|
||||
]
|
||||
|
||||
go_library(
|
||||
name = "imageversion",
|
||||
srcs = ["imageversion.go"] + GENERATED_SRCS, # keep
|
||||
importpath = "github.com/edgelesssys/constellation/v2/internal/config/imageversion",
|
||||
visibility = ["//:__subpackages__"],
|
||||
deps = ["//internal/containerimage"],
|
||||
)
|
||||
|
||||
[
|
||||
oci_go_source(
|
||||
name = container["name"],
|
||||
identifier = container["identifier"],
|
||||
image_name = container["image_name"],
|
||||
oci = container["oci"],
|
||||
package = "imageversion",
|
||||
prefix = container["prefix"],
|
||||
registry = container["registry"],
|
||||
tag_file = container["tag_file"],
|
||||
visibility = ["//:__subpackages__"],
|
||||
)
|
||||
for container in config_containers()
|
||||
]
|
37
internal/config/imageversion/imageversion.go
Normal file
37
internal/config/imageversion/imageversion.go
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
// Package imageversion contains the pinned container images for the config.
|
||||
package imageversion
|
||||
|
||||
import "github.com/edgelesssys/constellation/v2/internal/containerimage"
|
||||
|
||||
// QEMUMetadata is the image of the QEMU metadata api service.
|
||||
func QEMUMetadata() string {
|
||||
return defaultQEMUMetadata.String()
|
||||
}
|
||||
|
||||
// Libvirt is the image of the libvirt container.
|
||||
func Libvirt() string {
|
||||
return defaultLibvirt.String()
|
||||
}
|
||||
|
||||
var (
|
||||
defaultQEMUMetadata = containerimage.Image{
|
||||
Registry: qemuMetadataRegistry,
|
||||
Prefix: qemuMetadataPrefix,
|
||||
Name: qemuMetadataName,
|
||||
Tag: qemuMetadataTag,
|
||||
Digest: qemuMetadataDigest,
|
||||
}
|
||||
defaultLibvirt = containerimage.Image{
|
||||
Registry: libvirtRegistry,
|
||||
Prefix: libvirtPrefix,
|
||||
Name: libvirtName,
|
||||
Tag: libvirtTag,
|
||||
Digest: libvirtDigest,
|
||||
}
|
||||
)
|
24
internal/config/imageversion/placeholder.go
Normal file
24
internal/config/imageversion/placeholder.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
package imageversion
|
||||
|
||||
// This file is only used if `go build` is used instead of Bazel.
|
||||
// It contains placeholder values for the container images so that everything
|
||||
// still compiles.
|
||||
|
||||
const (
|
||||
qemuMetadataRegistry = "placeholder"
|
||||
qemuMetadataPrefix = "placeholder"
|
||||
qemuMetadataName = "placeholder"
|
||||
qemuMetadataDigest = "placeholder"
|
||||
qemuMetadataTag = "placeholder"
|
||||
|
||||
libvirtRegistry = "placeholder"
|
||||
libvirtPrefix = "placeholder"
|
||||
libvirtName = "placeholder"
|
||||
libvirtDigest = "placeholder"
|
||||
libvirtTag = "placeholder"
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue