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

WINC-674: [vendor] move to openshift/api #788

Merged
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
4 changes: 2 additions & 2 deletions controllers/windowsmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"

oconfig "github.com/openshift/api/config/v1"
mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
mclient "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1"
mapi "github.com/openshift/api/machine/v1beta1"
mclient "github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1"
"github.com/pkg/errors"
core "k8s.io/api/core/v1"
k8sapierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down
2 changes: 1 addition & 1 deletion controllers/windowsmachine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
mapi "github.com/openshift/api/machine/v1beta1"
"github.com/stretchr/testify/require"
core "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down
17 changes: 6 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,28 @@ module github.com/openshift/windows-machine-config-operator

go 1.16

replace (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest naming this commit [vendor] Update openshift/api and openshift/client-go.

// These are coming from the machine-api repo
sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210622023641-c69a3acaee27
sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20210816141152-a7c40345b994
)

require (
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/aws/aws-sdk-go v1.38.23
github.com/go-logr/logr v0.4.0
github.com/openshift/api v0.0.0-20210816181336-8ff39b776da3
github.com/openshift/client-go v0.0.0-20210730113412-1811c1b3fc0e
github.com/openshift/api v0.0.0-20211103131146-a0807454a876
github.com/openshift/client-go v0.0.0-20211025111749-96ca2abfc56c
github.com/openshift/library-go v0.0.0-20210811133500-5e31383de2a7
github.com/openshift/machine-api-operator v0.2.1-0.20210820103535-d50698c302f5
github.com/operator-framework/api v0.10.5
github.com/operator-framework/operator-lib v0.4.0
github.com/pkg/errors v0.9.1
github.com/pkg/sftp v1.11.0
github.com/prometheus-operator/prometheus-operator/pkg/client v0.45.0
github.com/spf13/cobra v1.2.1 // indirect
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
golang.org/x/mod v0.4.2
golang.org/x/tools v0.1.5 // indirect
k8s.io/api v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
k8s.io/kubectl v0.22.1
sigs.k8s.io/cluster-api-provider-aws v0.0.0-00010101000000-000000000000
sigs.k8s.io/cluster-api-provider-azure v0.0.0-00010101000000-000000000000
k8s.io/utils v0.0.0-20210802155522-efc7438f0176 // indirect
sigs.k8s.io/controller-runtime v0.9.6
)
292 changes: 5 additions & 287 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"strings"

mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
mapi "github.com/openshift/api/machine/v1beta1"
operators "github.com/operator-framework/api/pkg/operators/v2"
"github.com/operator-framework/operator-lib/leader"
"github.com/spf13/pflag"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/clusterinfo/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
config "github.com/openshift/api/config/v1"
configClient "github.com/openshift/client-go/config/clientset/versioned"
imageClient "github.com/openshift/client-go/image/clientset/versioned/typed/image/v1"
mapiClient "github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1"
operatorClient "github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1"
routeClient "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1"
mapiClient "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1"
monitoringClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
k8sclient "k8s.io/client-go/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

config "github.com/openshift/api/config/v1"
mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
mapi "github.com/openshift/api/machine/v1beta1"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

config "github.com/openshift/api/config/v1"
mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
mapi "github.com/openshift/api/machine/v1beta1"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
15 changes: 7 additions & 8 deletions test/e2e/providers/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ import (
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
"github.com/aws/aws-sdk-go/service/iam"
config "github.com/openshift/api/config/v1"
mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
mapi "github.com/openshift/api/machine/v1beta1"
core "k8s.io/api/core/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
awsprovider "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1beta1"

"github.com/openshift/windows-machine-config-operator/test/e2e/clusterinfo"
)
Expand Down Expand Up @@ -344,27 +343,27 @@ func (a *awsProvider) GenerateMachineSet(withWindowsLabel bool, replicas int32)
machineLabels[k] = v
}

providerSpec := &awsprovider.AWSMachineProviderConfig{
AMI: awsprovider.AWSResourceReference{
providerSpec := &mapi.AWSMachineProviderConfig{
AMI: mapi.AWSResourceReference{
ID: &a.imageID,
},
InstanceType: a.instanceType,
IAMInstanceProfile: &awsprovider.AWSResourceReference{
IAMInstanceProfile: &mapi.AWSResourceReference{
ID: instanceProfile.Name,
},
CredentialsSecret: &core.LocalObjectReference{
Name: "aws-cloud-credentials",
},
SecurityGroups: []awsprovider.AWSResourceReference{
SecurityGroups: []mapi.AWSResourceReference{
{
ID: &sgID,
},
},
Subnet: awsprovider.AWSResourceReference{
Subnet: mapi.AWSResourceReference{
ID: subnet.SubnetId,
},
// query placement
Placement: awsprovider.Placement{
Placement: mapi.Placement{
Region: a.region,
AvailabilityZone: *subnet.AvailabilityZone,
},
Expand Down
15 changes: 7 additions & 8 deletions test/e2e/providers/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"fmt"

config "github.com/openshift/api/config/v1"
mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
mapi "github.com/openshift/api/machine/v1beta1"
core "k8s.io/api/core/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
azureprovider "sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1"

"github.com/openshift/windows-machine-config-operator/test/e2e/clusterinfo"
)
Expand Down Expand Up @@ -48,7 +47,7 @@ func New(clientset *clusterinfo.OpenShift, hasCustomVXLANPort bool) (*Provider,
}

// newAzureMachineProviderSpec returns an AzureMachineProviderSpec generated from the inputs, or an error
func newAzureMachineProviderSpec(clusterID string, status *config.PlatformStatus, location, zone, vmSize string) (*azureprovider.AzureMachineProviderSpec, error) {
func newAzureMachineProviderSpec(clusterID string, status *config.PlatformStatus, location, zone, vmSize string) (*mapi.AzureMachineProviderSpec, error) {
if clusterID == "" {
return nil, fmt.Errorf("clusterID is empty")
}
Expand All @@ -64,7 +63,7 @@ func newAzureMachineProviderSpec(clusterID string, status *config.PlatformStatus
rg := status.Azure.ResourceGroupName
netrg := status.Azure.NetworkResourceGroupName

return &azureprovider.AzureMachineProviderSpec{
return &mapi.AzureMachineProviderSpec{
TypeMeta: meta.TypeMeta{
APIVersion: "azureproviderconfig.openshift.io/v1beta1",
Kind: "AzureMachineProviderSpec",
Expand All @@ -80,16 +79,16 @@ func newAzureMachineProviderSpec(clusterID string, status *config.PlatformStatus
Location: location,
Zone: &zone,
VMSize: vmSize,
Image: azureprovider.Image{
Image: mapi.Image{
Publisher: defaultImagePublisher,
Offer: defaultImageOffer,
SKU: defaultImageSKU,
Version: defaultImageVersion,
},
OSDisk: azureprovider.OSDisk{
OSDisk: mapi.OSDisk{
OSType: "Windows",
DiskSizeGB: defaultOSDiskSizeGB,
ManagedDisk: azureprovider.ManagedDiskParameters{
ManagedDisk: mapi.ManagedDiskParameters{
StorageAccountType: defaultStorageAccountType,
},
},
Expand Down Expand Up @@ -118,7 +117,7 @@ func (p *Provider) GenerateMachineSet(withWindowsLabel bool, replicas int32) (*m
if err != nil {
return nil, fmt.Errorf("failed to get master-0 machine resource: %v", err)
}
masterProviderSpec := new(azureprovider.AzureMachineProviderSpec)
masterProviderSpec := new(mapi.AzureMachineProviderSpec)
err = json.Unmarshal(machines.Spec.ProviderSpec.Value.Raw, masterProviderSpec)
if err != nil {
return nil, fmt.Errorf("failed to unmarshal master-0 azure machine provider spec: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/providers/cloudprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

config "github.com/openshift/api/config/v1"
mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
mapi "github.com/openshift/api/machine/v1beta1"
"github.com/pkg/errors"

oc "github.com/openshift/windows-machine-config-operator/test/e2e/clusterinfo"
Expand Down
15 changes: 7 additions & 8 deletions test/e2e/providers/vsphere/vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import (
"github.com/pkg/errors"

config "github.com/openshift/api/config/v1"
mapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
vsphere "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1"
mapi "github.com/openshift/api/machine/v1beta1"
core "k8s.io/api/core/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -34,7 +33,7 @@ func New(clientset *clusterinfo.OpenShift) (*Provider, error) {
}

// newVSphereMachineProviderSpec returns a vSphereMachineProviderSpec generated from the inputs, or an error
func (p *Provider) newVSphereMachineProviderSpec(clusterID string) (*vsphere.VSphereMachineProviderSpec, error) {
func (p *Provider) newVSphereMachineProviderSpec(clusterID string) (*mapi.VSphereMachineProviderSpec, error) {
if clusterID == "" {
return nil, fmt.Errorf("clusterID is empty")
}
Expand All @@ -53,7 +52,7 @@ func (p *Provider) newVSphereMachineProviderSpec(clusterID string) (*vsphere.VSp

log.Printf("creating machineset based on template %s\n", vmTemplate)

return &vsphere.VSphereMachineProviderSpec{
return &mapi.VSphereMachineProviderSpec{
TypeMeta: meta.TypeMeta{
APIVersion: "vsphereprovider.openshift.io/v1beta1",
Kind: "VSphereMachineProviderSpec",
Expand All @@ -63,8 +62,8 @@ func (p *Provider) newVSphereMachineProviderSpec(clusterID string) (*vsphere.VSp
},
DiskGiB: int32(128),
MemoryMiB: int64(16384),
Network: vsphere.NetworkSpec{
Devices: []vsphere.NetworkDeviceSpec{{NetworkName: getNetwork()}},
Network: mapi.NetworkSpec{
Devices: []mapi.NetworkDeviceSpec{{NetworkName: getNetwork()}},
},
NumCPUs: int32(4),
NumCoresPerSocket: int32(1),
Expand All @@ -74,7 +73,7 @@ func (p *Provider) newVSphereMachineProviderSpec(clusterID string) (*vsphere.VSp
}

// getWorkspaceFromExistingMachineSet returns Workspace from a machineset provisioned during installation
func (p *Provider) getWorkspaceFromExistingMachineSet(clusterID string) (*vsphere.Workspace, error) {
func (p *Provider) getWorkspaceFromExistingMachineSet(clusterID string) (*mapi.Workspace, error) {
if clusterID == "" {
return nil, fmt.Errorf("clusterID is empty")
}
Expand All @@ -93,7 +92,7 @@ func (p *Provider) getWorkspaceFromExistingMachineSet(clusterID string) (*vspher
if providerSpecRaw == nil || providerSpecRaw.Raw == nil {
return nil, errors.Wrap(err, "no provider spec found")
}
var providerSpec vsphere.VSphereMachineProviderSpec
var providerSpec mapi.VSphereMachineProviderSpec
err = json.Unmarshal(providerSpecRaw.Raw, &providerSpec)
if err != nil {
return nil, errors.Wrap(err, "unable to unmarshal providerSpec")
Expand Down