Skip to content

Commit a8a3164

Browse files
Merge pull request #73 from neisw/trt-1208-revert-72
Revert "Merge pull request #72 from RadekManak/azure-zone-no-pointer"
2 parents 761536e + 9f545b0 commit a8a3164

File tree

91 files changed

+728
-7773
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+728
-7773
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/mitchellh/mapstructure v1.5.0
1616
github.com/onsi/ginkgo/v2 v2.9.5
1717
github.com/onsi/gomega v1.27.7
18-
github.com/openshift/api v0.0.0-20230822121351-cd0541be0908
18+
github.com/openshift/api v0.0.0-20230707123100-21c0ce73add5
1919
github.com/openshift/machine-api-operator v0.2.1-0.20230531233206-931f6f67c1c7
2020
github.com/pkg/errors v0.9.1
2121
github.com/spf13/cobra v1.7.0

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
449449
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
450450
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
451451
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
452+
github.com/mresvanis/api v0.0.0-20230706123929-dd9b8275a496 h1:OsDBTmU3l2/HwWVIQfUlv0DEZvFVxO8Bi6F6+W7OLRo=
453+
github.com/mresvanis/api v0.0.0-20230706123929-dd9b8275a496/go.mod h1:4VWG+W22wrB4HfBL88P40DxLEpSOaiBVxUnfalfJo9k=
452454
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
453455
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
454456
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
@@ -467,8 +469,8 @@ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGV
467469
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
468470
github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
469471
github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4=
470-
github.com/openshift/api v0.0.0-20230822121351-cd0541be0908 h1:q8xDLVUi3GidJZeyYwGY5GQTeKQpdwfqwRgffMvGq/A=
471-
github.com/openshift/api v0.0.0-20230822121351-cd0541be0908/go.mod h1:yimSGmjsI+XF1mr+AKBs2//fSXIOhhetHGbMlBEfXbs=
472+
github.com/openshift/api v0.0.0-20230707123100-21c0ce73add5 h1:htabZ4P4mMAPTaTU0H0p++o/fmowJD5lnHR16ZBq3Js=
473+
github.com/openshift/api v0.0.0-20230707123100-21c0ce73add5/go.mod h1:yimSGmjsI+XF1mr+AKBs2//fSXIOhhetHGbMlBEfXbs=
472474
github.com/openshift/client-go v0.0.0-20230503144108-75015d2347cb h1:Nij5OnaECrkmcRQMAE9LMbQXPo95aqFnf+12B7SyFVI=
473475
github.com/openshift/client-go v0.0.0-20230503144108-75015d2347cb/go.mod h1:Rhb3moCqeiTuGHAbXBOlwPubUMlOZEkrEWTRjIF3jzs=
474476
github.com/openshift/library-go v0.0.0-20230508110756-9b7abe2c9cbf h1:ZpFAN2qprgp7jEhGPrOAwP8mmuYC9BRYzvDefg+k4GM=

pkg/cloud/azure/actuators/machine/actuator_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,23 +414,23 @@ func TestAvailabilityZones(t *testing.T) {
414414
fakeScope := newFakeScope(t, actuators.ControlPlane)
415415
fakeReconciler := newFakeReconcilerWithScope(t, fakeScope)
416416

417-
fakeReconciler.scope.MachineConfig.Zone = "2"
417+
fakeReconciler.scope.MachineConfig.Zone = to.StringPtr("2")
418418
fakeReconciler.virtualMachinesSvc = &FakeVMCheckZonesService{
419419
checkZones: []string{"2"},
420420
}
421421
if err := fakeReconciler.Create(context.Background()); err != nil {
422422
t.Errorf("failed to create machine: %+v", err)
423423
}
424424

425-
fakeReconciler.scope.MachineConfig.Zone = ""
425+
fakeReconciler.scope.MachineConfig.Zone = nil
426426
fakeReconciler.virtualMachinesSvc = &FakeVMCheckZonesService{
427427
checkZones: []string{""},
428428
}
429429
if err := fakeReconciler.Create(context.Background()); err != nil {
430430
t.Errorf("failed to create machine: %+v", err)
431431
}
432432

433-
fakeReconciler.scope.MachineConfig.Zone = "1"
433+
fakeReconciler.scope.MachineConfig.Zone = to.StringPtr("1")
434434
fakeReconciler.virtualMachinesSvc = &FakeVMCheckZonesService{
435435
checkZones: []string{"3"},
436436
}
@@ -441,15 +441,15 @@ func TestAvailabilityZones(t *testing.T) {
441441

442442
func TestGetZone(t *testing.T) {
443443
testCases := []struct {
444-
inputZone string
444+
inputZone *string
445445
expected string
446446
}{
447447
{
448-
inputZone: "",
448+
inputZone: nil,
449449
expected: "",
450450
},
451451
{
452-
inputZone: "3",
452+
inputZone: pointer.StringPtr("3"),
453453
expected: "3",
454454
},
455455
}

pkg/cloud/azure/actuators/machine/reconciler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727

2828
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute"
2929
"github.com/Azure/go-autorest/autorest"
30+
"github.com/Azure/go-autorest/autorest/to"
3031
machinev1 "github.com/openshift/api/machine/v1beta1"
3132
machinecontroller "github.com/openshift/machine-api-operator/pkg/controller/machine"
3233
"github.com/openshift/machine-api-operator/pkg/metrics"
@@ -546,7 +547,7 @@ func (s *Reconciler) Delete(ctx context.Context) error {
546547
}
547548

548549
func (s *Reconciler) getZone(ctx context.Context) (string, error) {
549-
return s.scope.MachineConfig.Zone, nil
550+
return to.String(s.scope.MachineConfig.Zone), nil
550551
}
551552

552553
func (s *Reconciler) createNetworkInterface(ctx context.Context, nicName string) error {

vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_dns-Default.crd.yaml

Lines changed: 0 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_infrastructure-CustomNoUpgrade.crd.yaml

Lines changed: 0 additions & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)