Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 2099293: cluster API provider should use latest go-ovirt-client #142

Merged
merged 1 commit into from Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions go.mod
Expand Up @@ -7,8 +7,8 @@ require (
github.com/openshift/api v0.0.0-20220531073726-6c4f186339a7
github.com/openshift/client-go v0.0.0-20220603133046-984ee5ebedcf
github.com/openshift/machine-api-operator v0.2.1-0.20220601192856-d7fb6b5b87ef
github.com/ovirt/go-ovirt-client v1.0.0-alpha4
github.com/ovirt/go-ovirt-client-log-klog v1.0.0
github.com/ovirt/go-ovirt-client v1.0.0
github.com/ovirt/go-ovirt-client-log-klog/v2 v2.0.0
github.com/pkg/errors v0.9.1
k8s.io/api v0.24.1
k8s.io/apimachinery v0.24.1
Expand Down Expand Up @@ -69,7 +69,7 @@ require (
github.com/onsi/gomega v1.18.1 // indirect
github.com/openshift/library-go v0.0.0-20220525173854-9b950a41acdc // indirect
github.com/ovirt/go-ovirt v0.0.0-20220427092237-114c47f2835c // indirect
github.com/ovirt/go-ovirt-client-log/v2 v2.2.0 // indirect
github.com/ovirt/go-ovirt-client-log/v3 v3.0.0 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
Expand Down
257 changes: 6 additions & 251 deletions go.sum

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions pkg/actuators/machine/machine.go
Expand Up @@ -111,7 +111,7 @@ func (ms *machineScope) create() error {
return errors.Wrap(err, "error Listing hosts")
}

hostIDs := make([]string, 0)
hostIDs := make([]ovirtC.HostID, 0)
for _, host := range hosts {
if string(host.ClusterID()) == clusterId {
hostIDs = append(hostIDs, host.ID())
Expand Down Expand Up @@ -182,7 +182,7 @@ func (ms *machineScope) create() error {
ms.machineProviderSpec.TemplateName)
}
optionalVMParams = optionalVMParams.MustWithDisks([]ovirtC.OptionalVMDiskParameters{
ovirtC.MustNewBuildableVMDiskParameters(tempDiskAttachment[0].DiskID()).MustWithStorageDomainID(ms.machineProviderSpec.StorageDomainId),
ovirtC.MustNewBuildableVMDiskParameters(tempDiskAttachment[0].DiskID()).MustWithStorageDomainID(ovirtC.StorageDomainID(ms.machineProviderSpec.StorageDomainId)),
})
}

Expand Down Expand Up @@ -253,7 +253,7 @@ func (ms *machineScope) create() error {

//re-create NICs According to the machinespec
for i, nic := range ms.machineProviderSpec.NetworkInterfaces {
_, err := instance.CreateNIC(fmt.Sprintf("nic%d", i+1), nic.VNICProfileID, ovirtC.CreateNICParams())
_, err := instance.CreateNIC(fmt.Sprintf("nic%d", i+1), ovirtC.VNICProfileID(nic.VNICProfileID), ovirtC.CreateNICParams())

if err != nil {
return err
Expand Down Expand Up @@ -365,13 +365,13 @@ func (ms *machineScope) reconcileMachine(ctx context.Context) error {
id := instance.ID()
status := instance.Status()
name := instance.Name()
ms.reconcileMachineProviderID(id)
ms.reconcileMachineAnnotations(string(status), id)
err = ms.reconcileMachineNetwork(ctx, status, name, id)
ms.reconcileMachineProviderID(string(id))
ms.reconcileMachineAnnotations(string(status), string(id))
err = ms.reconcileMachineNetwork(ctx, status, name, string(id))
if err != nil {
return errors.Wrap(err, "error reconciling machine network")
}
err = ms.reconcileMachineProviderStatus(string(status), &id)
err = ms.reconcileMachineProviderStatus(string(status), (*string)(&id))
if err != nil {
return errors.Wrap(err, "error reconciling machine provider status")
}
Expand Down Expand Up @@ -473,7 +473,7 @@ func (ms *machineScope) findUsableInternalAddress(ctx context.Context, vmID stri
IPParams = IPParams.WithExcludedRange(*ipnet)
}

nics, err := ms.ovirtClient.GetVMIPAddresses(vmID, IPParams, ovirtC.ContextStrategy(ms.Context))
nics, err := ms.ovirtClient.GetVMIPAddresses(ovirtC.VMID(vmID), IPParams, ovirtC.ContextStrategy(ms.Context))
if err != nil {
return "", errors.Wrapf(err, "failed to get reported devices list")
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/controllers/common.go
Expand Up @@ -2,12 +2,12 @@ package ovirt

import (
"fmt"
ovirtclient "github.com/ovirt/go-ovirt-client"
kloglogger "github.com/ovirt/go-ovirt-client-log-klog"
"time"

"github.com/go-logr/logr"
"github.com/openshift/cluster-api-provider-ovirt/pkg/utils"
ovirtclient "github.com/ovirt/go-ovirt-client"
kloglogger "github.com/ovirt/go-ovirt-client-log-klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)
Expand Down
Expand Up @@ -82,7 +82,7 @@ func (r *providerIDController) fetchOvirtVmID(nodeName string) (string, error) {
return "", fmt.Errorf("failed getting VM %s from oVirt: %w", nodeName, err)
}

return vm.ID(), nil
return string(vm.ID()), nil
}

// Creates a new ProviderID Controller and adds it to the manager
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/ovirt/go-ovirt-client/.golangci.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions vendor/github.com/ovirt/go-ovirt-client/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.