Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
Update dependencies and add preserveUnknownFields=false
Browse files Browse the repository at this point in the history
for CRD generation. THis is to enable upgrades from v1alpha2 to
v1alpha3
  • Loading branch information
maelk committed Feb 20, 2020
1 parent a05817e commit 508e2f0
Show file tree
Hide file tree
Showing 15 changed files with 627 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ bin/*
hack/tools/bin/*
examples/_out/*
examples/provider-components/provider-components-*
examples/provider-components/*-components.yaml
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Build the manager binary on golang image
FROM registry.hub.docker.com/library/golang:1.12.9 as builder
FROM registry.hub.docker.com/library/golang:1.13 as builder
WORKDIR /workspace

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ generate-go: $(CONTROLLER_GEN) $(MOCKGEN) $(CONVERSION_GEN) $(KUBEBUILDER) $(KUS
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) \
paths=./api/... \
crd:trivialVersions=true \
crd:trivialVersions=true,preserveUnknownFields=false \
output:crd:dir=$(CRD_ROOT) \
output:webhook:dir=$(WEBHOOK_ROOT) \
webhook
Expand Down
4 changes: 2 additions & 2 deletions baremetal/baremetalmachine_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ import (
"k8s.io/utils/pointer"

bmh "github.com/metal3-io/baremetal-operator/pkg/apis/metal3/v1alpha1"
capbm "github.com/metal3-io/cluster-api-provider-baremetal/api/v1alpha2"
"github.com/pkg/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
clientcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
capbm "github.com/metal3-io/cluster-api-provider-baremetal/api/v1alpha2"
capi "sigs.k8s.io/cluster-api/api/v1alpha2"
capierrors "sigs.k8s.io/cluster-api/errors"
"sigs.k8s.io/cluster-api/util"
Expand Down Expand Up @@ -339,7 +339,7 @@ func (m *MachineManager) Delete(ctx context.Context) error {
// TODO? remove empty string that is the status without BMO running
case bmh.StateRegistrationError, bmh.StateRegistering,
bmh.StateMatchProfile, bmh.StateInspecting,
bmh.StateReady, bmh.StateValidationError, bmh.StateNone:
bmh.StateReady, bmh.StateNone:
// Host is not provisioned
waiting = false
case bmh.StateExternallyProvisioned:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: baremetalclusters.infrastructure.cluster.x-k8s.io
spec:
Expand All @@ -24,10 +26,13 @@ spec:
categories:
- cluster-api
kind: BareMetalCluster
listKind: BareMetalClusterList
plural: baremetalclusters
shortNames:
- bmc
- bmcluster
singular: baremetalcluster
preserveUnknownFields: false
scope: Namespaced
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: baremetalmachines.infrastructure.cluster.x-k8s.io
spec:
Expand All @@ -28,10 +30,13 @@ spec:
categories:
- cluster-api
kind: BareMetalMachine
listKind: BareMetalMachineList
plural: baremetalmachines
shortNames:
- bmm
- bmmachine
singular: baremetalmachine
preserveUnknownFields: false
scope: Namespaced
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: baremetalmachinetemplates.infrastructure.cluster.x-k8s.io
spec:
Expand All @@ -11,7 +13,10 @@ spec:
categories:
- cluster-api
kind: BareMetalMachineTemplate
listKind: BareMetalMachineTemplateList
plural: baremetalmachinetemplates
singular: baremetalmachinetemplate
preserveUnknownFields: false
scope: Namespaced
validation:
openAPIV3Schema:
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_image_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
spec:
containers:
# Change the value of image field below to your controller image URL
- image: quay.io/metal3-io/cluster-api-provider-baremetal:v0.2.1
- image: quay.io/metal3-io/cluster-api-provider-baremetal:release-0.2
name: manager
7 changes: 4 additions & 3 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,21 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

infrastructurev1alpha2 "github.com/metal3-io/cluster-api-provider-baremetal/api/v1alpha2"
infrav1 "github.com/metal3-io/cluster-api-provider-baremetal/api/v1alpha2"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/klog"
infrastructurev1alpha2 "github.com/metal3-io/cluster-api-provider-baremetal/api/v1alpha2"
infrav1 "github.com/metal3-io/cluster-api-provider-baremetal/api/v1alpha2"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha2"

bmh "github.com/metal3-io/baremetal-operator/pkg/apis/metal3/v1alpha1"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
// +kubebuilder:scaffold:imports
Expand Down Expand Up @@ -81,7 +82,7 @@ func TestAPIs(t *testing.T) {

RunSpecsWithDefaultAndCustomReporters(t,
"Controller Suite",
[]Reporter{envtest.NewlineReporter{}})
[]Reporter{printer.NewlineReporter{}})
}

var _ = BeforeSuite(func(done Done) {
Expand Down
59 changes: 36 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,44 @@ module github.com/metal3-io/cluster-api-provider-baremetal
go 1.13

require (
cloud.google.com/go v0.53.0 // indirect
github.com/coreos/etcd v3.3.15+incompatible // indirect
github.com/emicklei/go-restful v2.11.2+incompatible // indirect
github.com/go-logr/logr v0.1.0
github.com/go-logr/zapr v0.1.1 // indirect
github.com/gogo/protobuf v1.3.0 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/golang/mock v1.3.1
github.com/metal3-io/baremetal-operator v0.0.0-20191004200613-f048f3bc5f05
github.com/onsi/ginkgo v1.10.1
github.com/onsi/gomega v1.7.0
github.com/pkg/errors v0.8.1
github.com/prometheus/common v0.6.0 // indirect
github.com/prometheus/procfs v0.0.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/go-openapi/spec v0.19.6 // indirect
github.com/go-openapi/swag v0.19.7 // indirect
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/mock v1.4.0
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.4.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.8 // indirect
github.com/mailru/easyjson v0.7.1 // indirect
github.com/metal3-io/baremetal-operator v0.0.0-20200219190700-ab6db428b878
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.8.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.4.1 // indirect
github.com/prometheus/procfs v0.0.10 // indirect
go.uber.org/atomic v1.4.0 // indirect
go.uber.org/zap v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 // indirect
golang.org/x/tools v0.0.0-20191017101817-846f856e7d71 // indirect
google.golang.org/appengine v1.6.1 // indirect
k8s.io/api v0.0.0-20191016110408-35e52d86657a
k8s.io/apimachinery v0.0.0-20191004115801-a2eda9f80ab8
k8s.io/client-go v0.0.0-20191016111102-bec269661e48
golang.org/x/crypto v0.0.0-20200219234226-1ad67e1f0ef4 // indirect
golang.org/x/net v0.0.0-20200219183655-46282727080f
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
k8s.io/api v0.17.3
k8s.io/apiextensions-apiserver v0.17.3 // indirect
k8s.io/apimachinery v0.17.3
k8s.io/client-go v11.0.0+incompatible
k8s.io/klog v1.0.0
k8s.io/utils v0.0.0-20190809000727-6c36bc71fc4a
sigs.k8s.io/cluster-api v0.2.7
sigs.k8s.io/controller-runtime v0.3.1-0.20191029211253-40070e2a1958
k8s.io/kube-openapi v0.0.0-20200204173128-addea2498afe // indirect
k8s.io/utils v0.0.0-20200124190032-861946025e34
sigs.k8s.io/cluster-api v0.2.10
sigs.k8s.io/controller-runtime v0.5.0
sigs.k8s.io/yaml v1.2.0 // indirect
)

replace (
github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.4.0
k8s.io/client-go => k8s.io/client-go v0.17.3
)
Loading

0 comments on commit 508e2f0

Please sign in to comment.