Skip to content

Commit

Permalink
Merge pull request #151 from enxebre/vendor
Browse files Browse the repository at this point in the history
Vendor
  • Loading branch information
openshift-merge-robot authored May 3, 2019
2 parents 8fd28ea + 46e00f1 commit d6d2d46
Show file tree
Hide file tree
Showing 43 changed files with 96 additions and 953 deletions.
9 changes: 5 additions & 4 deletions Gopkg.lock

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

12 changes: 6 additions & 6 deletions cmd/libvirt-actuator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1"
"k8s.io/apimachinery/pkg/util/wait"

"github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework"
Expand Down Expand Up @@ -212,17 +212,17 @@ func bootstrapCommand() *cobra.Command {

machinePrefix := cmd.Flag("environment-id").Value.String()

testCluster := &machinev1.Cluster{
testCluster := &clusterv1.Cluster{
ObjectMeta: metav1.ObjectMeta{
Name: machinePrefix,
Namespace: testNamespace.Name,
},
Spec: machinev1.ClusterSpec{
ClusterNetwork: machinev1.ClusterNetworkingConfig{
Services: machinev1.NetworkRanges{
Spec: clusterv1.ClusterSpec{
ClusterNetwork: clusterv1.ClusterNetworkingConfig{
Services: clusterv1.NetworkRanges{
CIDRBlocks: []string{"10.0.0.1/24"},
},
Pods: machinev1.NetworkRanges{
Pods: clusterv1.NetworkRanges{
CIDRBlocks: []string{"10.0.0.1/24"},
},
ServiceDomain: "example.com",
Expand Down
5 changes: 3 additions & 2 deletions cmd/libvirt-actuator/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import (
machineactuator "github.com/openshift/cluster-api-provider-libvirt/pkg/cloud/libvirt/actuators/machine"
libvirtclient "github.com/openshift/cluster-api-provider-libvirt/pkg/cloud/libvirt/client"
"github.com/openshift/cluster-api-provider-libvirt/test"
clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1"
machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
kubernetesfake "k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/tools/record"
)

func ReadClusterResources(clusterLoc, machineLoc, userDataLoc string) (*machinev1.Cluster, *machinev1.Machine, *apiv1.Secret, error) {
func ReadClusterResources(clusterLoc, machineLoc, userDataLoc string) (*clusterv1.Cluster, *machinev1.Machine, *apiv1.Secret, error) {
machine := &machinev1.Machine{}
{
bytes, err := ioutil.ReadFile(machineLoc)
Expand All @@ -31,7 +32,7 @@ func ReadClusterResources(clusterLoc, machineLoc, userDataLoc string) (*machinev
}
}

cluster := &machinev1.Cluster{}
cluster := &clusterv1.Cluster{}
{
bytes, err := ioutil.ReadFile(clusterLoc)
if err != nil {
Expand Down
9 changes: 5 additions & 4 deletions pkg/cloud/libvirt/actuators/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/record"

clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1"
machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
clusterclient "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset"
apierrors "github.com/openshift/cluster-api/pkg/errors"
Expand Down Expand Up @@ -109,7 +110,7 @@ func (a *Actuator) handleMachineError(machine *machinev1.Machine, err *apierrors
}

// Create creates a machine and is invoked by the Machine Controller
func (a *Actuator) Create(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error {
func (a *Actuator) Create(context context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) error {
glog.Infof("Creating machine %q", machine.Name)
errWrapper := errorWrapper{machine: machine}

Expand Down Expand Up @@ -149,7 +150,7 @@ func (a *Actuator) Create(context context.Context, cluster *machinev1.Cluster, m
}

// Delete deletes a machine and is invoked by the Machine Controller
func (a *Actuator) Delete(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error {
func (a *Actuator) Delete(context context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) error {
glog.Infof("Deleting machine %q", machine.Name)

machineProviderConfig, err := ProviderConfigMachine(a.codec, &machine.Spec)
Expand All @@ -176,7 +177,7 @@ func (a *Actuator) Delete(context context.Context, cluster *machinev1.Cluster, m
}

// Update updates a machine and is invoked by the Machine Controller
func (a *Actuator) Update(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error {
func (a *Actuator) Update(context context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) error {
glog.Infof("Updating machine %v", machine.Name)
errWrapper := errorWrapper{machine: machine}

Expand Down Expand Up @@ -209,7 +210,7 @@ func (a *Actuator) Update(context context.Context, cluster *machinev1.Cluster, m
}

// Exists test for the existance of a machine and is invoked by the Machine Controller
func (a *Actuator) Exists(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) (bool, error) {
func (a *Actuator) Exists(context context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) (bool, error) {
glog.Infof("Checking if machine %v exists.", machine.Name)
errWrapper := errorWrapper{machine: machine}

Expand Down
27 changes: 14 additions & 13 deletions pkg/cloud/libvirt/actuators/machine/actuator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
libvirtclient "github.com/openshift/cluster-api-provider-libvirt/pkg/cloud/libvirt/client"
mocklibvirt "github.com/openshift/cluster-api-provider-libvirt/pkg/cloud/libvirt/client/mock"
fakeclusterclientset "github.com/openshift/cluster-api-provider-libvirt/test"
clusterv1beta1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1"
machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
kubernetesfake "k8s.io/client-go/kubernetes/fake"

Expand Down Expand Up @@ -48,7 +49,7 @@ func TestMachineEvents(t *testing.T) {
name string
machine *machinev1beta1.Machine
error string
operation func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine)
operation func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine)
event string
createVolumeErr error
deleteVolumeErr error
Expand All @@ -62,7 +63,7 @@ func TestMachineEvents(t *testing.T) {
{
name: "Create machine event failed (invalid configuration)",
machine: machineInvalidProviderConfig,
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Create(context.TODO(), cluster, machine)
},
event: "Warning FailedCreate InvalidConfiguration",
Expand All @@ -71,7 +72,7 @@ func TestMachineEvents(t *testing.T) {
name: "Create machine event failed (error creating libvirt client)",
machine: machine,
error: libvirtClientError,
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Create(context.TODO(), cluster, machine)
},
event: "Warning FailedCreate CreateError",
Expand All @@ -80,7 +81,7 @@ func TestMachineEvents(t *testing.T) {
name: "Create machine event failed (error creating volume)",
machine: machine,
createVolumeErr: fmt.Errorf("error"),
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Create(context.TODO(), cluster, machine)
},
event: "Warning FailedCreate CreateError",
Expand All @@ -89,7 +90,7 @@ func TestMachineEvents(t *testing.T) {
name: "Create machine event failed (error creating domain)",
machine: machine,
createDomainErr: fmt.Errorf("error"),
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Create(context.TODO(), cluster, machine)
},
event: "Warning FailedCreate CreateError",
Expand All @@ -98,23 +99,23 @@ func TestMachineEvents(t *testing.T) {
name: "Create machine event failed (error looking up domain)",
machine: machine,
lookupDomainErr: fmt.Errorf("error"),
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Create(context.TODO(), cluster, machine)
},
event: "Warning FailedCreate CreateError",
},
{
name: "Create machine event succeed",
machine: machine,
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Create(context.TODO(), cluster, machine)
},
event: "Normal Created Created Machine libvirt-actuator-testing-machine",
},
{
name: "Delete machine event failed (invalid configuration)",
machine: machineInvalidProviderConfig,
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Delete(context.TODO(), cluster, machine)
},
event: "Warning FailedDelete InvalidConfiguration",
Expand All @@ -123,7 +124,7 @@ func TestMachineEvents(t *testing.T) {
name: "Delete machine event failed (error creating libvirt client)",
machine: machine,
error: libvirtClientError,
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Delete(context.TODO(), cluster, machine)
},
event: "Warning FailedDelete DeleteError",
Expand All @@ -132,7 +133,7 @@ func TestMachineEvents(t *testing.T) {
name: "Delete machine event failed (error getting domain)",
machine: machine,
domainExistsErr: fmt.Errorf("error"),
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Delete(context.TODO(), cluster, machine)
},
event: "Warning FailedDelete DeleteError",
Expand All @@ -142,7 +143,7 @@ func TestMachineEvents(t *testing.T) {
machine: machine,
domainExists: true,
deleteDomainErr: fmt.Errorf("error"),
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Delete(context.TODO(), cluster, machine)
},
event: "Warning FailedDelete DeleteError",
Expand All @@ -152,7 +153,7 @@ func TestMachineEvents(t *testing.T) {
machine: machine,
domainExists: true,
deleteVolumeErr: fmt.Errorf("error"),
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Delete(context.TODO(), cluster, machine)
},
event: "Warning FailedDelete DeleteError",
Expand All @@ -161,7 +162,7 @@ func TestMachineEvents(t *testing.T) {
name: "Delete machine event succeeds",
machine: machine,
domainExists: true,
operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) {
operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) {
actuator.Delete(context.TODO(), cluster, machine)
},
event: "Normal Deleted Deleted Machine libvirt-actuator-testing-machine",
Expand Down
5 changes: 3 additions & 2 deletions pkg/cloud/libvirt/actuators/machine/stubs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

providerconfigv1 "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1"
clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1"
machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
)

Expand Down Expand Up @@ -65,8 +66,8 @@ func stubMachine() (*machinev1.Machine, error) {
return machine, nil
}

func stubCluster() *machinev1.Cluster {
return &machinev1.Cluster{
func stubCluster() *clusterv1.Cluster {
return &clusterv1.Cluster{
ObjectMeta: metav1.ObjectMeta{
Name: clusterID,
Namespace: defaultNamespace,
Expand Down
22 changes: 11 additions & 11 deletions test/machines/machines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/openshift/cluster-api-actuator-pkg/pkg/manifests"
"github.com/openshift/cluster-api-provider-libvirt/test/utils"

machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -124,17 +124,17 @@ var _ = framework.SigKubeDescribe("Machines", func() {
clusterID = "cluster-" + string(uuid.NewUUID())
}

cluster := &machinev1beta1.Cluster{
cluster := &clusterv1alpha1.Cluster{
ObjectMeta: metav1.ObjectMeta{
Name: clusterID,
Namespace: testNamespace.Name,
},
Spec: machinev1beta1.ClusterSpec{
ClusterNetwork: machinev1beta1.ClusterNetworkingConfig{
Services: machinev1beta1.NetworkRanges{
Spec: clusterv1alpha1.ClusterSpec{
ClusterNetwork: clusterv1alpha1.ClusterNetworkingConfig{
Services: clusterv1alpha1.NetworkRanges{
CIDRBlocks: []string{"10.0.0.1/24"},
},
Pods: machinev1beta1.NetworkRanges{
Pods: clusterv1alpha1.NetworkRanges{
CIDRBlocks: []string{"10.0.0.1/24"},
},
ServiceDomain: "example.com",
Expand Down Expand Up @@ -186,17 +186,17 @@ var _ = framework.SigKubeDescribe("Machines", func() {
clusterID = "cluster-" + clusterUUID[:8]
}

cluster := &machinev1beta1.Cluster{
cluster := &clusterv1alpha1.Cluster{
ObjectMeta: metav1.ObjectMeta{
Name: clusterID,
Namespace: testNamespace.Name,
},
Spec: machinev1beta1.ClusterSpec{
ClusterNetwork: machinev1beta1.ClusterNetworkingConfig{
Services: machinev1beta1.NetworkRanges{
Spec: clusterv1alpha1.ClusterSpec{
ClusterNetwork: clusterv1alpha1.ClusterNetworkingConfig{
Services: clusterv1alpha1.NetworkRanges{
CIDRBlocks: []string{"10.0.0.1/24"},
},
Pods: machinev1beta1.NetworkRanges{
Pods: clusterv1alpha1.NetworkRanges{
CIDRBlocks: []string{"10.0.0.1/24"},
},
ServiceDomain: "example.com",
Expand Down
10 changes: 6 additions & 4 deletions vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.lock

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.

Loading

0 comments on commit d6d2d46

Please sign in to comment.