Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ vendor:
$(DOCKER_CMD) ./hack/go-mod.sh

.PHONY: check
check: lint fmt vet verify-codegen test ## Run code validations
check: lint fmt vet test ## Run code validations

.PHONY: build
build: machine-api-operator nodelink-controller machine-healthcheck machineset vsphere ## Build binaries
Expand All @@ -74,26 +74,6 @@ vsphere:
machineset:
$(DOCKER_CMD) ./hack/go-build.sh machineset

.PHONY: generate
generate: gen-crd gogen update-codegen goimports
./hack/verify-diff.sh

.PHONY: gogen
gogen:
$(DOCKER_CMD) ./hack/go-gen.sh

.PHONY: gen-crd
gen-crd:
$(DOCKER_CMD) ./hack/gen-crd.sh

.PHONY: update-codegen
update-codegen:
$(DOCKER_CMD) ./hack/update-codegen.sh

.PHONY: verify-codegen
verify-codegen:
$(DOCKER_CMD) ./hack/verify-codegen.sh

.PHONY: test-e2e
test-e2e: ## Run openshift specific e2e tests
./hack/e2e.sh test-e2e
Expand Down
2 changes: 1 addition & 1 deletion cmd/machine-api-operator/client_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"

osclientset "github.com/openshift/client-go/config/clientset/versioned"
mapiclientset "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned"
mapiclientset "github.com/openshift/client-go/machine/clientset/versioned"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
Expand Down
2 changes: 1 addition & 1 deletion cmd/machine-api-operator/controller_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

configinformersv1 "github.com/openshift/client-go/config/informers/externalversions"
machineinformersv1beta1 "github.com/openshift/machine-api-operator/pkg/generated/informers/externalversions"
machineinformersv1beta1 "github.com/openshift/client-go/machine/informers/externalversions"

"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/informers"
Expand Down
5 changes: 3 additions & 2 deletions cmd/machine-healthcheck/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (
"github.com/openshift/machine-api-operator/pkg/metrics"
"github.com/openshift/machine-api-operator/pkg/util"

mapiv1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
machinev1 "github.com/openshift/api/machine/v1beta1"

"github.com/openshift/machine-api-operator/pkg/controller"
sdkVersion "github.com/operator-framework/operator-sdk/version"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
Expand Down Expand Up @@ -96,7 +97,7 @@ func main() {
klog.Infof("Registering Components.")

// Setup Scheme for all resources
if err := mapiv1.AddToScheme(mgr.GetScheme()); err != nil {
if err := machinev1.AddToScheme(mgr.GetScheme()); err != nil {
klog.Fatal(err)
}

Expand Down
21 changes: 11 additions & 10 deletions cmd/machineset/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import (
"log"
"time"

"github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
machinev1 "github.com/openshift/api/machine/v1beta1"
"github.com/openshift/machine-api-operator/pkg/controller"
"github.com/openshift/machine-api-operator/pkg/controller/machineset"
"github.com/openshift/machine-api-operator/pkg/metrics"
"github.com/openshift/machine-api-operator/pkg/util"
mapiwebhooks "github.com/openshift/machine-api-operator/pkg/webhooks"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client/config"
Expand Down Expand Up @@ -113,39 +114,39 @@ func main() {
}

// Enable defaulting and validating webhooks
machineDefaulter, err := v1beta1.NewMachineDefaulter()
machineDefaulter, err := mapiwebhooks.NewMachineDefaulter()
if err != nil {
log.Fatal(err)
}

machineValidator, err := v1beta1.NewMachineValidator(mgr.GetClient())
machineValidator, err := mapiwebhooks.NewMachineValidator(mgr.GetClient())
if err != nil {
log.Fatal(err)
}

machineSetDefaulter, err := v1beta1.NewMachineSetDefaulter()
machineSetDefaulter, err := mapiwebhooks.NewMachineSetDefaulter()
if err != nil {
log.Fatal(err)
}

machineSetValidator, err := v1beta1.NewMachineSetValidator(mgr.GetClient())
machineSetValidator, err := mapiwebhooks.NewMachineSetValidator(mgr.GetClient())
if err != nil {
log.Fatal(err)
}

if *webhookEnabled {
mgr.GetWebhookServer().Port = *webhookPort
mgr.GetWebhookServer().CertDir = *webhookCertdir
mgr.GetWebhookServer().Register(v1beta1.DefaultMachineMutatingHookPath, &webhook.Admission{Handler: machineDefaulter})
mgr.GetWebhookServer().Register(v1beta1.DefaultMachineValidatingHookPath, &webhook.Admission{Handler: machineValidator})
mgr.GetWebhookServer().Register(v1beta1.DefaultMachineSetMutatingHookPath, &webhook.Admission{Handler: machineSetDefaulter})
mgr.GetWebhookServer().Register(v1beta1.DefaultMachineSetValidatingHookPath, &webhook.Admission{Handler: machineSetValidator})
mgr.GetWebhookServer().Register(mapiwebhooks.DefaultMachineMutatingHookPath, &webhook.Admission{Handler: machineDefaulter})
mgr.GetWebhookServer().Register(mapiwebhooks.DefaultMachineValidatingHookPath, &webhook.Admission{Handler: machineValidator})
mgr.GetWebhookServer().Register(mapiwebhooks.DefaultMachineSetMutatingHookPath, &webhook.Admission{Handler: machineSetDefaulter})
mgr.GetWebhookServer().Register(mapiwebhooks.DefaultMachineSetValidatingHookPath, &webhook.Admission{Handler: machineSetValidator})
}

log.Printf("Registering Components.")

// Setup Scheme for all resources
if err := v1beta1.AddToScheme(mgr.GetScheme()); err != nil {
if err := machinev1.AddToScheme(mgr.GetScheme()); err != nil {
log.Fatal(err)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/nodelink-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"flag"
"runtime"

mapiv1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
machinev1 "github.com/openshift/api/machine/v1beta1"
"github.com/openshift/machine-api-operator/pkg/controller"
"github.com/openshift/machine-api-operator/pkg/controller/nodelink"
"github.com/openshift/machine-api-operator/pkg/util"
Expand Down Expand Up @@ -81,7 +81,7 @@ func main() {
klog.Infof("Registering Components.")

// Setup Scheme for all resources
if err := mapiv1.AddToScheme(mgr.GetScheme()); err != nil {
if err := machinev1.AddToScheme(mgr.GetScheme()); err != nil {
klog.Fatal(err)
}

Expand Down
7 changes: 3 additions & 4 deletions cmd/vsphere/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
"time"

configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
vsphereapis "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider"
machinev1 "github.com/openshift/api/machine/v1beta1"
capimachine "github.com/openshift/machine-api-operator/pkg/controller/machine"
machine "github.com/openshift/machine-api-operator/pkg/controller/vsphere"
machinesetcontroller "github.com/openshift/machine-api-operator/pkg/controller/vsphere/machineset"
Expand Down Expand Up @@ -114,11 +113,11 @@ func main() {
klog.Fatal(err)
}

if err := vsphereapis.AddToScheme(mgr.GetScheme()); err != nil {
if err := machinev1.AddToScheme(mgr.GetScheme()); err != nil {
klog.Fatal(err)
}

if err := v1beta1.AddToScheme(mgr.GetScheme()); err != nil {
if err := machinev1.AddToScheme(mgr.GetScheme()); err != nil {
klog.Fatal(err)
}

Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.14.0
github.com/openshift/api v0.0.0-20211025104849-a11323ccb6ea
github.com/openshift/client-go v0.0.0-20210730113412-1811c1b3fc0e
github.com/openshift/client-go v0.0.0-20211025111749-96ca2abfc56c
github.com/openshift/library-go v0.0.0-20210811133500-5e31383de2a7
github.com/operator-framework/operator-sdk v0.5.1-0.20190301204940-c2efe6f74e7b
github.com/prometheus/client_golang v1.11.0
Expand All @@ -21,10 +21,11 @@ require (
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023
gopkg.in/gcfg.v1 v1.2.3
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/apiserver v0.22.0
k8s.io/client-go v0.22.0
k8s.io/client-go v0.22.1
k8s.io/code-generator v0.22.1
k8s.io/klog/v2 v2.9.0
k8s.io/kubectl v0.22.0
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,9 @@ github.com/openshift/api v0.0.0-20210730095913-85e1d547cdee/go.mod h1:ntkQrC1Z6A
github.com/openshift/api v0.0.0-20211025104849-a11323ccb6ea h1:aCtko94sKCpceywj0I293WDFXtBJe+/Gg3v5ZuErq+Y=
github.com/openshift/api v0.0.0-20211025104849-a11323ccb6ea/go.mod h1:RsQCVJu4qhUawxxDP7pGlwU3IA4F01wYm3qKEu29Su8=
github.com/openshift/build-machinery-go v0.0.0-20210712174854-1bb7fd1518d3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
github.com/openshift/client-go v0.0.0-20210730113412-1811c1b3fc0e h1:vhwzeXUxLd6JZlWZ+miBzTEpmVctHyHNq9z43ScYxWI=
github.com/openshift/client-go v0.0.0-20210730113412-1811c1b3fc0e/go.mod h1:P1pjphFOgm/nYjmtouHGaSLGtdP25dQICJnYtcYhfEs=
github.com/openshift/client-go v0.0.0-20211025111749-96ca2abfc56c h1:2yUcA5LUiKqEnRnqW8MYaB3/7tEAFqCjLtVcbDFlIjg=
github.com/openshift/client-go v0.0.0-20211025111749-96ca2abfc56c/go.mod h1:xigLF97kzy1PZuDsC0Lfu6GlzChRt62+2Ts/nG3sPHY=
github.com/openshift/library-go v0.0.0-20210811133500-5e31383de2a7 h1:aCoE+Q7jLvV7MFL2aZOnzO3dK6rpSuEE7273ijnAIWU=
github.com/openshift/library-go v0.0.0-20210811133500-5e31383de2a7/go.mod h1:3GagmGg6gikg+hAqma7E7axBzs2pjx4+GrAbdl4OYdY=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
Expand Down Expand Up @@ -1221,8 +1222,9 @@ k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k=
k8s.io/client-go v0.18.0-beta.2/go.mod h1:UvuVxHjKWIcgy0iMvF+bwNDW7l0mskTNOaOW1Qv5BMA=
k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU=
k8s.io/client-go v0.22.0-rc.0/go.mod h1:BZGppBKJh4UtgDZcIIh6vHJsJ1iZiXS7EwKZYWhyklo=
k8s.io/client-go v0.22.0 h1:sD6o9O6tCwUKCENw8v+HFsuAbq2jCu8cWC61/ydwA50=
k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg=
k8s.io/client-go v0.22.1 h1:jW0ZSHi8wW260FvcXHkIa0NLxFBQszTlhiAVsU5mopw=
k8s.io/client-go v0.22.1/go.mod h1:BquC5A4UOo4qVDUtoc04/+Nxp1MeHcVc1HJm1KmG8kk=
k8s.io/code-generator v0.17.0/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s=
k8s.io/code-generator v0.18.0-beta.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc=
k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo=
Expand Down
43 changes: 0 additions & 43 deletions hack/gen-crd.sh

This file was deleted.

4 changes: 0 additions & 4 deletions hack/go-gen.sh

This file was deleted.

38 changes: 0 additions & 38 deletions hack/update-codegen.sh

This file was deleted.

48 changes: 0 additions & 48 deletions hack/verify-codegen.sh

This file was deleted.

Empty file modified hack/verify-diff.sh
100755 → 100644
Empty file.
8 changes: 0 additions & 8 deletions pkg/apis/machine/register.go

This file was deleted.

Loading