From 303fcf16177c3d766fd269c316f8457ad1c81b83 Mon Sep 17 00:00:00 2001 From: Michael McCune Date: Tue, 4 May 2021 11:35:56 -0400 Subject: [PATCH] Bug 1954177: Update mao dependency for webhook v1 changes --- go.mod | 2 +- go.sum | 6 ++++-- .../pkg/apis/machine/v1beta1/machine_webhook.go | 8 ++++---- .../pkg/controller/machine/controller.go | 9 +++++++-- vendor/modules.txt | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index a3e4271ef8..d95fa0cef6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/onsi/ginkgo v1.15.0 github.com/onsi/gomega v1.10.5 github.com/openshift/api v0.0.0-20210416115537-a60c0dc032fd - github.com/openshift/machine-api-operator v0.2.1-0.20210420092411-384733bfd62e + github.com/openshift/machine-api-operator v0.2.1-0.20210504014029-a132ec00f7dd // kube 1.18 k8s.io/api v0.21.0 diff --git a/go.sum b/go.sum index 6ab19c622f..d83d36ac97 100644 --- a/go.sum +++ b/go.sum @@ -600,8 +600,8 @@ github.com/openshift/machine-api-operator v0.2.1-0.20200722104429-f4f9b84df9b7/g github.com/openshift/machine-api-operator v0.2.1-0.20200926044412-b7d860f8074c/go.mod h1:cp/wPVzxHZeLUjOLkNPNqrk4wyyW6HuHd3Kz9+hl5xw= github.com/openshift/machine-api-operator v0.2.1-0.20201002104344-6abfb5440597/go.mod h1:+oAfoCl+TUd2TM79/6NdqLpFUHIJpmqkKdmiHe2O7mw= github.com/openshift/machine-api-operator v0.2.1-0.20201203125141-79567cb3368e/go.mod h1:Vxdx8K+8sbdcGozW86hSvcVl5JgJOqNFYhLRRhEM9HY= -github.com/openshift/machine-api-operator v0.2.1-0.20210420092411-384733bfd62e h1:4w69A/kY3LLep0io3Ap4bkfb/RT6jlowOTR0jj1qKPc= -github.com/openshift/machine-api-operator v0.2.1-0.20210420092411-384733bfd62e/go.mod h1:DFZBMPtC2TYZH5NE9+2JQIpbZAnruqc9F26QmbOm9pw= +github.com/openshift/machine-api-operator v0.2.1-0.20210504014029-a132ec00f7dd h1:8gwpgdXv0TPrvPRxms3CNqDwtktmOYxTWD4MrW1TVJk= +github.com/openshift/machine-api-operator v0.2.1-0.20210504014029-a132ec00f7dd/go.mod h1:DFZBMPtC2TYZH5NE9+2JQIpbZAnruqc9F26QmbOm9pw= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -1255,6 +1255,7 @@ k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8 k8s.io/code-generator v0.19.0/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= k8s.io/code-generator v0.21.0-rc.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= +k8s.io/code-generator v0.21.0 h1:LGWJOvkbBNpuRBqBRXUjzfvymUh7F/iR2KDpwLnqCM4= k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/component-base v0.17.0/go.mod h1:rKuRAokNMY2nn2A6LP/MiwpoaMRHpfRnrPaUJJj1Yoc= k8s.io/component-base v0.18.0-beta.2/go.mod h1:HVk5FpRnyzQ/MjBr9//e/yEBjTVa2qjGXCTuUzcD7ks= @@ -1272,6 +1273,7 @@ k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8 k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027 h1:Uusb3oh8XcdzDF/ndlI4ToKTYVlkCSJP39SRY2mfRAw= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go index 3d08bb5709..4257b9cecc 100644 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go @@ -341,7 +341,7 @@ func MachineValidatingWebhook() admissionregistrationv1.ValidatingWebhook { Port: pointer.Int32Ptr(defaultWebhookServicePort), } return admissionregistrationv1.ValidatingWebhook{ - AdmissionReviewVersions: []string{"v1beta1"}, + AdmissionReviewVersions: []string{"v1"}, Name: "validation.machine.machine.openshift.io", FailurePolicy: &webhookFailurePolicy, SideEffects: &webhookSideEffects, @@ -373,7 +373,7 @@ func MachineSetValidatingWebhook() admissionregistrationv1.ValidatingWebhook { Port: pointer.Int32Ptr(defaultWebhookServicePort), } return admissionregistrationv1.ValidatingWebhook{ - AdmissionReviewVersions: []string{"v1beta1"}, + AdmissionReviewVersions: []string{"v1"}, Name: "validation.machineset.machine.openshift.io", FailurePolicy: &webhookFailurePolicy, SideEffects: &webhookSideEffects, @@ -426,7 +426,7 @@ func MachineMutatingWebhook() admissionregistrationv1.MutatingWebhook { Port: pointer.Int32Ptr(defaultWebhookServicePort), } return admissionregistrationv1.MutatingWebhook{ - AdmissionReviewVersions: []string{"v1beta1"}, + AdmissionReviewVersions: []string{"v1"}, Name: "default.machine.machine.openshift.io", FailurePolicy: &webhookFailurePolicy, SideEffects: &webhookSideEffects, @@ -457,7 +457,7 @@ func MachineSetMutatingWebhook() admissionregistrationv1.MutatingWebhook { Port: pointer.Int32Ptr(defaultWebhookServicePort), } return admissionregistrationv1.MutatingWebhook{ - AdmissionReviewVersions: []string{"v1beta1"}, + AdmissionReviewVersions: []string{"v1"}, Name: "default.machineset.machine.openshift.io", FailurePolicy: &webhookFailurePolicy, SideEffects: &webhookSideEffects, diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/controller/machine/controller.go b/vendor/github.com/openshift/machine-api-operator/pkg/controller/machine/controller.go index 8511e54e9e..537a3883a5 100644 --- a/vendor/github.com/openshift/machine-api-operator/pkg/controller/machine/controller.go +++ b/vendor/github.com/openshift/machine-api-operator/pkg/controller/machine/controller.go @@ -353,9 +353,14 @@ func (r *ReconcileMachine) Reconcile(ctx context.Context, request reconcile.Requ )) // Machine resource created and instance does not exist yet. - if err := r.updateStatus(ctx, m, phaseProvisioning, nil, originalConditions); err != nil { - return reconcile.Result{}, err + if stringPointerDeref(m.Status.Phase) == "" { + klog.V(2).Infof("%v: setting phase to Provisioning and requeuing", machineName) + if err := r.updateStatus(ctx, m, phaseProvisioning, nil, originalConditions); err != nil { + return reconcile.Result{}, err + } + return reconcile.Result{RequeueAfter: requeueAfter}, nil } + klog.Infof("%v: reconciling machine triggers idempotent create", machineName) if err := r.actuator.Create(ctx, m); err != nil { klog.Warningf("%v: failed to create machine: %v", machineName, err) diff --git a/vendor/modules.txt b/vendor/modules.txt index 5d66c58084..6c3de10b72 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -213,7 +213,7 @@ github.com/openshift/client-go/config/clientset/versioned/scheme github.com/openshift/client-go/config/clientset/versioned/typed/config/v1 # github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201201000827-1117a4fc438c github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1 -# github.com/openshift/machine-api-operator v0.2.1-0.20210420092411-384733bfd62e +# github.com/openshift/machine-api-operator v0.2.1-0.20210504014029-a132ec00f7dd ## explicit github.com/openshift/machine-api-operator/pkg/apis/machine github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1