Skip to content

Commit 13bb12e

Browse files
EmilienMmandre
andcommitted
CARRY: openshift: CAPO v0.11.0 (v1beta1) adjustments
Co-Authored-By: Martin André <[email protected]>
1 parent a7c1104 commit 13bb12e

File tree

6 files changed

+7738
-9497
lines changed

6 files changed

+7738
-9497
lines changed

openshift/cmd/manager.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ import (
4242
)
4343

4444
var (
45-
scheme = caposcheme.DefaultScheme()
46-
setupLog = ctrl.Log.WithName("setup")
45+
scheme = caposcheme.DefaultScheme()
46+
setupLog = ctrl.Log.WithName("setup")
47+
scopeCacheMaxSize int
4748
)
4849

4950
func main() {
@@ -63,6 +64,8 @@ func main() {
6364

6465
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
6566

67+
scopeFactory := scope.NewFactory(scopeCacheMaxSize)
68+
6669
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
6770
Scheme: scheme,
6871
Metrics: metricsserver.Options{BindAddress: metricsAddr},
@@ -130,7 +133,7 @@ func main() {
130133
if err := (&infraclustercontroller.OpenShiftClusterReconciler{
131134
Client: mgr.GetClient(),
132135
Recorder: mgr.GetEventRecorderFor("openshiftcluster-controller"),
133-
ScopeFactory: scope.NewFactory(1),
136+
ScopeFactory: scopeFactory,
134137
}).SetupWithManager(mgr, controller.Options{}); err != nil {
135138
setupLog.Error(err, "unable to create controller", "controller", "OpenStackCluster")
136139
os.Exit(1)

openshift/e2e/e2e_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"context"
55
"testing"
66

7-
. "github.com/onsi/ginkgo/v2"
8-
. "github.com/onsi/gomega"
7+
. "github.com/onsi/ginkgo/v2" //nolint:revive
8+
. "github.com/onsi/gomega" //nolint:revive
99
configv1 "github.com/openshift/api/config/v1"
1010
mapiv1 "github.com/openshift/api/machine/v1beta1"
1111
utilruntime "k8s.io/apimachinery/pkg/util/runtime"

openshift/e2e/openstack_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package e2e
22

33
import (
4-
. "github.com/onsi/ginkgo/v2"
5-
. "github.com/onsi/gomega"
4+
. "github.com/onsi/ginkgo/v2" //nolint:revive
5+
. "github.com/onsi/gomega" //nolint:revive
66
"github.com/onsi/gomega/format"
77
configv1 "github.com/openshift/api/config/v1"
88
mapiv1alpha1 "github.com/openshift/api/machine/v1alpha1"
@@ -123,7 +123,7 @@ func createOpenStackMachineTemplate(cl client.Client, mapiProviderSpec *mapiv1al
123123
// We intentionally omit ports so the machine will default its network
124124
// from the OpenStackCluster created by the infracluster controller.
125125
openStackMachineSpec := infrav1.OpenStackMachineSpec{
126-
Flavor: mapiProviderSpec.Flavor,
126+
Flavor: ptr.To(mapiProviderSpec.Flavor),
127127
IdentityRef: &infrav1.OpenStackIdentityReference{
128128
CloudName: infraclustercontroller.CloudName,
129129
Name: infraclustercontroller.CredentialsSecretName,

openshift/kustomize/infrastructure-components/kustomization.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ replacements:
8181
version: v1
8282
kind: CustomResourceDefinition
8383
reject:
84-
# openstackfloatingippools.infrastructure.cluster.x-k8s.io doesn't have any
85-
# of these versions
84+
# The following types don't have any of these versions
8685
- name: openstackfloatingippools.infrastructure.cluster.x-k8s.io
86+
- name: openstackservers.infrastructure.cluster.x-k8s.io
8787
fieldPaths:
88-
- spec.versions.[name=v1alpha5].served
8988
- spec.versions.[name=v1alpha6].served
9089
- spec.versions.[name=v1alpha7].served

0 commit comments

Comments
 (0)