Skip to content

Commit 0104de0

Browse files
committed
chore: fixes from review
1 parent 015f22a commit 0104de0

File tree

12 files changed

+221
-177
lines changed

12 files changed

+221
-177
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ libvirt:
1616
### Using Docker
1717
1818
copy the provider credentials created in omni to an `.env` file
19+
1920
```env
2021
# your omni instance URL
2122
OMNI_ENDPOINT=https://<OMNI_INSTANCE_NAME>.<REGION>.omni.siderolabs.io
@@ -24,6 +25,7 @@ OMNI_SERVICE_ACCOUNT_KEY=<PROVIDER_KEY>
2425
```
2526

2627
example for using the above `ssh` based connection method:
28+
2729
```bash
2830
docker run --name omni-infra-provider-libvirt --rm -it -e USER=user --env-file /tmp/omni-provider-libvirt.env -v /tmp/omni-provider-libvirt.yaml:/config.yaml -v /home/user/.ssh:/.ssh:ro ghcr.io/siderolabs/omni-infra-provider-libvirt --config-file /config.yaml
2931
```
@@ -37,6 +39,7 @@ see [test/](./test/) for some examples
3739
see `make help` for general build info.
3840

3941
build an image:
42+
4043
```shell
4144
make generate image-omni-infra-provider-libvirt-linux-amd64
4245
```

api/specs/specs.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/specs/specs.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
syntax = "proto3";
22
package emuspecs;
33

4-
option go_package = "github.com/siderolabs/omni-infra-provider-proxmox/api/specs";
4+
option go_package = "github.com/siderolabs/omni-infra-provider-libvirt/api/specs";
55

66
// MachineSpec is stored in Omni in the infra provisioner state.
77
message MachineSpec {

cmd/omni-infra-provider-libvirt/data/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"memory": {
99
"type": "integer",
1010
"minimum": 2048,
11-
"description": "In MB"
11+
"description": "In MiB"
1212
},
1313
"disk_size": {
1414
"type": "integer",
1515
"minimum": 10,
16-
"description": "In GB"
16+
"description": "In GiB"
1717
},
1818
"storage_pool": {
1919
"type": "string",

cmd/omni-infra-provider-libvirt/main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,13 @@ var rootCmd = &cobra.Command{
7070

7171
libvirtConfig := config.LibVirt
7272

73+
//nolint:errcheck
7374
uri, _ := url.Parse(string(libvirt.QEMUSystem))
7475
if libvirtConfig.URI != "" {
75-
uri, _ = url.Parse(string(libvirtConfig.URI))
76+
uri, err = url.Parse(libvirtConfig.URI)
77+
if err != nil {
78+
return fmt.Errorf("bad libvirt connection URI: %s", libvirtConfig.URI)
79+
}
7680
}
7781

7882
logger.Info("libvirt URI", zap.String("URI", uri.String()))
@@ -85,7 +89,8 @@ var rootCmd = &cobra.Command{
8589
if !libvirtClient.IsConnected() {
8690
return errors.New("client is not connected")
8791
}
88-
if ver, err := libvirtClient.ConnectGetVersion(); err != nil {
92+
ver, err := libvirtClient.ConnectGetVersion()
93+
if err != nil {
8994
return fmt.Errorf("error fetching version: %w", err)
9095
} else {
9196
logger.Info(fmt.Sprintf("libvirtVersion: %d", ver))

go.mod

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/siderolabs/omni-infra-provider-libvirt
22

3-
go 1.25.0
3+
go 1.25.3
44

55
// forked go-yaml that introduces RawYAML interface, which can be used to populate YAML fields using bytes
66
// which are then encoded as a valid YAML blocks with proper indentation
@@ -11,10 +11,10 @@ require (
1111
github.com/digitalocean/go-libvirt v0.0.0-20251014225438-3d9fc6d90050
1212
github.com/google/uuid v1.6.0
1313
github.com/planetscale/vtprotobuf v0.6.1-0.20241121165744-79df5c4772f2
14-
github.com/siderolabs/omni/client v0.51.0-beta.1.0.20250903122553-faf5432552c3
14+
github.com/siderolabs/omni/client v1.2.0-beta.3.0.20251030232529-3f2021b05f62
1515
github.com/spf13/cobra v1.10.1
1616
go.uber.org/zap v1.27.0
17-
google.golang.org/protobuf v1.36.9
17+
google.golang.org/protobuf v1.36.10
1818
gopkg.in/yaml.v3 v3.0.3
1919
libvirt.org/go/libvirtxml v1.11008.0
2020
)
@@ -26,63 +26,61 @@ require (
2626
github.com/ProtonMail/gopenpgp/v2 v2.9.0 // indirect
2727
github.com/adrg/xdg v0.5.3 // indirect
2828
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
29-
github.com/blang/semver v3.5.1+incompatible // indirect
3029
github.com/blang/semver/v4 v4.0.0 // indirect
3130
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
3231
github.com/cloudflare/circl v1.6.1 // indirect
33-
github.com/containerd/go-cni v1.1.12 // indirect
32+
github.com/containerd/go-cni v1.1.13 // indirect
3433
github.com/containernetworking/cni v1.3.0 // indirect
3534
github.com/dustin/go-humanize v1.0.1 // indirect
3635
github.com/gertd/go-pluralize v0.2.1 // indirect
3736
github.com/google/btree v1.1.3 // indirect
38-
github.com/google/cel-go v0.26.0 // indirect
37+
github.com/google/cel-go v0.26.1 // indirect
3938
github.com/google/go-cmp v0.7.0 // indirect
40-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
39+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
4140
github.com/hashicorp/errwrap v1.1.0 // indirect
4241
github.com/hashicorp/go-multierror v1.1.1 // indirect
4342
github.com/inconshreveable/mousetrap v1.1.0 // indirect
44-
github.com/josharian/native v1.1.0 // indirect
4543
github.com/jsimonetti/rtnetlink/v2 v2.0.5 // indirect
4644
github.com/jxskiss/base62 v1.1.0 // indirect
4745
github.com/klauspost/compress v1.18.0 // indirect
48-
github.com/mdlayher/ethtool v0.4.0 // indirect
46+
github.com/mdlayher/ethtool v0.5.0 // indirect
4947
github.com/mdlayher/genetlink v1.3.2 // indirect
50-
github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 // indirect
48+
github.com/mdlayher/netlink v1.8.0 // indirect
5149
github.com/mdlayher/socket v0.5.1 // indirect
5250
github.com/onsi/ginkgo/v2 v2.22.0 // indirect
5351
github.com/onsi/gomega v1.36.1 // indirect
5452
github.com/opencontainers/runtime-spec v1.2.1 // indirect
55-
github.com/petermattis/goid v0.0.0-20250721140440-ea1c0173183e // indirect
53+
github.com/petermattis/goid v0.0.0-20250904145737-900bdf8bb490 // indirect
5654
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
5755
github.com/pkg/errors v0.9.1 // indirect
5856
github.com/ryanuber/go-glob v1.0.0 // indirect
59-
github.com/sasha-s/go-deadlock v0.3.5 // indirect
60-
github.com/siderolabs/crypto v0.6.3 // indirect
57+
github.com/sasha-s/go-deadlock v0.3.6 // indirect
58+
github.com/siderolabs/crypto v0.6.4 // indirect
6159
github.com/siderolabs/gen v0.8.5 // indirect
62-
github.com/siderolabs/go-api-signature v0.3.8 // indirect
60+
github.com/siderolabs/go-api-signature v0.3.9 // indirect
6361
github.com/siderolabs/go-pointer v1.0.1 // indirect
6462
github.com/siderolabs/image-factory v0.8.4 // indirect
6563
github.com/siderolabs/net v0.4.0 // indirect
6664
github.com/siderolabs/proto-codec v0.1.2 // indirect
67-
github.com/siderolabs/protoenc v0.2.3 // indirect
65+
github.com/siderolabs/protoenc v0.2.4 // indirect
6866
github.com/siderolabs/siderolink v0.3.15 // indirect
69-
github.com/siderolabs/talos/pkg/machinery v1.11.1 // indirect
67+
github.com/siderolabs/talos/pkg/machinery v1.12.0-alpha.2 // indirect
7068
github.com/spf13/pflag v1.0.10 // indirect
7169
github.com/stoewer/go-strcase v1.3.1 // indirect
7270
github.com/stretchr/objx v0.5.2 // indirect
7371
go.uber.org/multierr v1.11.0 // indirect
7472
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
7573
golang.org/x/crypto v0.43.0 // indirect
76-
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect
77-
golang.org/x/net v0.45.0 // indirect
74+
golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect
75+
golang.org/x/net v0.46.0 // indirect
7876
golang.org/x/sync v0.17.0 // indirect
7977
golang.org/x/sys v0.37.0 // indirect
8078
golang.org/x/text v0.30.0 // indirect
81-
golang.org/x/time v0.13.0 // indirect
79+
golang.org/x/time v0.14.0 // indirect
8280
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
8381
golang.zx2c4.com/wireguard v0.0.0-20250521234502-f333402bd9cb // indirect
8482
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10 // indirect
85-
google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
86-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 // indirect
87-
google.golang.org/grpc v1.75.1 // indirect
83+
google.golang.org/genproto/googleapis/api v0.0.0-20251020155222-88f65dc88635 // indirect
84+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251020155222-88f65dc88635 // indirect
85+
google.golang.org/grpc v1.76.0 // indirect
8886
)

0 commit comments

Comments
 (0)