Skip to content

Commit db50de8

Browse files
committed
fix: updated initializations and tests
updated controller initializations to pass down clock param for testing updated tests results to be in lexical order and timestamp to reflect test.yaml Signed-off-by: ehila <ehila@redhat.com>
1 parent cde38c5 commit db50de8

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

pkg/cmd/operator/cmd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package operator
22

33
import (
44
"github.com/spf13/cobra"
5-
65
"k8s.io/utils/clock"
76

87
"github.com/openshift/cluster-authentication-operator/pkg/operator"

pkg/operator/replacement_starter.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"time"
88

99
kubeinformers "k8s.io/client-go/informers"
10+
"k8s.io/utils/clock"
1011

1112
kubemigratorclient "sigs.k8s.io/kube-storage-version-migrator/pkg/clients/clientset"
1213
migrationv1alpha1informer "sigs.k8s.io/kube-storage-version-migrator/pkg/clients/informer"
@@ -51,6 +52,7 @@ type authenticationOperatorInput struct {
5152
apiregistrationv1Client apiregistrationclient.Interface
5253
migrationClient kubemigratorclient.Interface
5354
eventRecorder events.Recorder
55+
clock clock.PassiveClock
5456

5557
informerFactories []libraryapplyconfiguration.SimplifiedInformerFactory
5658
}
@@ -129,6 +131,7 @@ func CreateOperatorInputFromMOM(ctx context.Context, momInput libraryapplyconfig
129131
apiregistrationv1Client: apiregistrationv1Client,
130132
migrationClient: migrationClient,
131133
eventRecorder: eventRecorder,
134+
clock: momInput.Clock,
132135
informerFactories: []libraryapplyconfiguration.SimplifiedInformerFactory{
133136
libraryapplyconfiguration.DynamicInformerFactoryAdapter(dynamicInformers), // we don't share the dynamic informers, but we only want to start when requested
134137
},
@@ -199,6 +202,7 @@ func CreateControllerInputFromControllerContext(ctx context.Context, controllerC
199202
apiregistrationv1Client: apiregistrationv1Client,
200203
migrationClient: migrationClient,
201204
eventRecorder: eventRecorder,
205+
clock: clock.RealClock{},
202206
informerFactories: []libraryapplyconfiguration.SimplifiedInformerFactory{
203207
libraryapplyconfiguration.DynamicInformerFactoryAdapter(dynamicInformers), // we don't share the dynamic informers, but we only want to start when requested
204208
},

pkg/operator/starter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ func prepareOauthAPIServerOperator(
435435
"oauth-apiserver",
436436
authOperatorInput.authenticationOperatorClient,
437437
eventRecorder,
438+
authOperatorInput.clock,
438439
).WithWorkloadController(
439440
"OAuthAPIServerController",
440441
"openshift-authentication-operator",

test-data/apply-configuration/overall/minimal-cluster/expected-output/Management/ApplyStatus/cluster-scoped-resources/operator.openshift.io/authentications/4dff-body-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ status:
66
conditions:
77
- lastTransitionTime: "2024-10-14T22:38:20Z"
88
message: |-
9-
endpoints/host-etcd-2 in the openshift-etcd namespace: not found
109
configmap openshift-etcd/etcd-endpoints not found, and fallback observer failed
10+
endpoints/host-etcd-2 in the openshift-etcd namespace: not found
1111
oauth.config.openshift.io "cluster" not found
1212
reason: Error
1313
status: "True"

test-data/apply-configuration/overall/minimal-cluster/expected-output/Management/UpdateStatus/cluster-scoped-resources/config.openshift.io/clusteroperators/0598-body-authentication.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ metadata:
66
spec: {}
77
status:
88
conditions:
9-
- lastTransitionTime: "2024-12-05T18:54:45Z"
9+
- lastTransitionTime: "2024-10-14T22:38:20Z"
1010
reason: NoData
1111
status: Unknown
1212
type: Degraded
13-
- lastTransitionTime: "2024-12-05T18:54:45Z"
13+
- lastTransitionTime: "2024-10-14T22:38:20Z"
1414
reason: NoData
1515
status: Unknown
1616
type: Progressing
17-
- lastTransitionTime: "2024-12-05T18:54:45Z"
17+
- lastTransitionTime: "2024-10-14T22:38:20Z"
1818
reason: NoData
1919
status: Unknown
2020
type: Available
21-
- lastTransitionTime: "2024-12-05T18:54:45Z"
21+
- lastTransitionTime: "2024-10-14T22:38:20Z"
2222
reason: NoData
2323
status: Unknown
2424
type: Upgradeable
25-
- lastTransitionTime: "2024-12-05T18:54:45Z"
25+
- lastTransitionTime: "2024-10-14T22:38:20Z"
2626
reason: NoData
2727
status: Unknown
2828
type: EvaluationConditionsDetected

test-data/apply-configuration/overall/minimal-cluster/expected-output/controller-results.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ controllerResults:
5555
- controllerName: TODO-other-configObserver
5656
errors:
5757
- message: |-
58-
endpoints/host-etcd-2 in the openshift-etcd namespace: not found
5958
configmap openshift-etcd/etcd-endpoints not found, and fallback observer failed
59+
endpoints/host-etcd-2 in the openshift-etcd namespace: not found
6060
oauth.config.openshift.io "cluster" not found
6161
status: Failed
6262
- controllerName: TODO-payloadConfigController

0 commit comments

Comments
 (0)