I would like to use the following function in my controller https://github.com/openshift/machine-api-operator/blob/05041eaab5a6b9e22dd26df421d8d51050c39072/pkg/controller/vsphere/util.go#L221 Thefore in my code I do the following import
package controllers
import (
"context"
vsphere "github.com/openshift/machine-api-operator/pkg/controller"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
)
However, when I do go mod tidy, I get the following error:
bitbucket.bit.admin.ch/BOSC/bosc-drs-vm-group-controller/controllers imports
github.com/openshift/machine-api-operator/pkg/controller imports
github.com/openshift/machine-api-operator/pkg/controller/machinehealthcheck imports
sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1: module sigs.k8s.io/cluster-api@latest found (v1.3.2), but does not contain package sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1
bitbucket.bit.admin.ch/BOSC/bosc-drs-vm-group-controller/controllers imports
github.com/openshift/machine-api-operator/pkg/controller imports
github.com/openshift/machine-api-operator/pkg/controller/machinehealthcheck imports
github.com/openshift/machine-api-operator/pkg/apis/healthchecking/v1alpha1 imports
sigs.k8s.io/controller-runtime/pkg/runtime/scheme: module sigs.k8s.io/controller-runtime@latest found (v0.14.1), but does not contain package sigs.k8s.io/controller-runtime/pkg/runtime/scheme
It seems that there are some dependencies issues, however I am not sure how to solve them. I tried in go.mod to set sigs.k8s.io/controller-runtime to reference a branch and not to latest, but it doesn't seem that it has any effect.
require (
...
)
require (
...
sigs.k8s.io/cluster-api release-1.3 //indirect
)
How am I suppose to solve package dependencies issues?