Skip to content

Commit ca163e0

Browse files
Merge pull request #744 from deads2k/update-dep
API-1835: bring MOM up to date for testing and the like
2 parents 75c7842 + 4bdbff3 commit ca163e0

File tree

249 files changed

+2489
-735
lines changed

Some content is hidden

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

249 files changed

+2489
-735
lines changed

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ require (
66
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
77
github.com/ghodss/yaml v1.0.0
88
github.com/google/go-cmp v0.6.0
9-
github.com/openshift/api v0.0.0-20241001152557-e415140e5d5f
10-
github.com/openshift/build-machinery-go v0.0.0-20241031155326-6ae126a9cb72
9+
github.com/openshift/api v0.0.0-20241101202457-04eb3fd119d2
10+
github.com/openshift/build-machinery-go v0.0.0-20241126220845-0de670012c09
1111
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f
12-
github.com/openshift/library-go v0.0.0-20241120135057-fc703a7407c9
13-
github.com/openshift/multi-operator-manager v0.0.0-20241119235446-3c965870ef94
12+
github.com/openshift/library-go v0.0.0-20241127135410-64d8d9e80808
13+
github.com/openshift/multi-operator-manager v0.0.0-20241205181422-20aa3906b99d
1414
github.com/spf13/cobra v1.8.1
1515
github.com/stretchr/testify v1.9.0
1616
go.etcd.io/etcd/client/v3 v3.5.14

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,16 @@ github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA
148148
github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
149149
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
150150
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
151-
github.com/openshift/api v0.0.0-20241001152557-e415140e5d5f h1:ya1OmyZm3LIIxI3U9VE9Nyx3ehCHgBwxyFUPflYPWls=
152-
github.com/openshift/api v0.0.0-20241001152557-e415140e5d5f/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo=
153-
github.com/openshift/build-machinery-go v0.0.0-20241031155326-6ae126a9cb72 h1:kMM+Ea3YFrcoYS76RhhBA7uELy97JM0gwqnyoy7fxco=
154-
github.com/openshift/build-machinery-go v0.0.0-20241031155326-6ae126a9cb72/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
151+
github.com/openshift/api v0.0.0-20241101202457-04eb3fd119d2 h1:CguNy+2KzhJ3a3i7e4Bgm/ByfQpSSSPYmF9NLZskoUs=
152+
github.com/openshift/api v0.0.0-20241101202457-04eb3fd119d2/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo=
153+
github.com/openshift/build-machinery-go v0.0.0-20241126220845-0de670012c09 h1:NibXytu9e89emCQoRiKZR+warzC1bpQgYDyb9jpEI/s=
154+
github.com/openshift/build-machinery-go v0.0.0-20241126220845-0de670012c09/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
155155
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f h1:FRc0bVNWprihWS0GqQWzb3dY4dkCwpOP3mDw5NwSoR4=
156156
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f/go.mod h1:KiZi2mJRH1TOJ3FtBDYS6YvUL30s/iIXaGSUrSa36mo=
157-
github.com/openshift/library-go v0.0.0-20241120135057-fc703a7407c9 h1:bwIqO3LDkumwfDKTMRzixNHKUqU7yaKTTAKwENi6JOY=
158-
github.com/openshift/library-go v0.0.0-20241120135057-fc703a7407c9/go.mod h1:9B1MYPoLtP9tqjWxcbUNVpwxy68zOH/3EIP6c31dAM0=
159-
github.com/openshift/multi-operator-manager v0.0.0-20241119235446-3c965870ef94 h1:9Z5HQo1KSQogIpQ2tDzrCk4+sDjL/xF+YXBrDP4R36k=
160-
github.com/openshift/multi-operator-manager v0.0.0-20241119235446-3c965870ef94/go.mod h1:Fn/rmcwj4bCuS11UT5TZvzONt7qTjzcd9BCSQkIwQOI=
157+
github.com/openshift/library-go v0.0.0-20241127135410-64d8d9e80808 h1:IUVlNRH6tuA0djyJsfGVTACsjE16hncfU1c/YKOobGw=
158+
github.com/openshift/library-go v0.0.0-20241127135410-64d8d9e80808/go.mod h1:l/3SegTa9x+ry2J213bh7+DBofXOOvdrqU4JC9ktJa0=
159+
github.com/openshift/multi-operator-manager v0.0.0-20241205181422-20aa3906b99d h1:Rzx23P63JFNNz5D23ubhC0FCN5rK8CeJhKcq5QKcdyU=
160+
github.com/openshift/multi-operator-manager v0.0.0-20241205181422-20aa3906b99d/go.mod h1:iVi9Bopa5cLhjG5ie9DoZVVqkH8BGb1FQVTtecOLn4I=
161161
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
162162
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
163163
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

pkg/cmd/mom/apply_configuration_command.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,14 @@ func NewApplyConfigurationCommand(streams genericiooptions.IOStreams) *cobra.Com
1414
return libraryapplyconfiguration.NewApplyConfigurationCommand(RunApplyConfiguration, runOutputResources, streams)
1515
}
1616

17-
func RunApplyConfiguration(ctx context.Context, input libraryapplyconfiguration.ApplyConfigurationInput) (libraryapplyconfiguration.AllDesiredMutationsGetter, error) {
17+
func RunApplyConfiguration(ctx context.Context, input libraryapplyconfiguration.ApplyConfigurationInput) (*libraryapplyconfiguration.ApplyConfigurationRunResult, libraryapplyconfiguration.AllDesiredMutationsGetter, error) {
1818
authenticationOperatorInput, err := operator.CreateOperatorInputFromMOM(ctx, input)
1919
if err != nil {
20-
return nil, fmt.Errorf("unable to configure operator input: %w", err)
20+
return nil, nil, fmt.Errorf("unable to configure operator input: %w", err)
2121
}
2222
operatorStarter, err := operator.CreateOperatorStarter(ctx, authenticationOperatorInput)
2323
if err != nil {
24-
return nil, fmt.Errorf("unable to configure operators: %w", err)
24+
return nil, nil, fmt.Errorf("unable to configure operators: %w", err)
2525
}
26-
var operatorRunError error
27-
if err := operatorStarter.RunOnce(ctx); err != nil {
28-
operatorRunError = fmt.Errorf("unable to run operators: %w", err)
29-
}
30-
31-
return libraryapplyconfiguration.NewApplyConfigurationFromClient(input.MutationTrackingClient.GetMutations()), operatorRunError
26+
return operatorStarter.RunOnce(ctx, input)
3227
}

pkg/cmd/mom/output_resources_command.go

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,22 @@ func runOutputResources(ctx context.Context) (*libraryoutputresources.OutputReso
2222
ManagementResources: libraryoutputresources.ResourceList{
2323
ExactResources: []libraryoutputresources.ExactResourceID{
2424
libraryoutputresources.ExactClusterOperator("authentication"),
25+
libraryoutputresources.ExactLowLevelOperator("authentications"),
26+
libraryoutputresources.ExactNamespace("openshift-authentication"),
27+
libraryoutputresources.ExactNamespace("openshift-oauth-apiserver"),
28+
2529
libraryoutputresources.ExactConfigMap("openshift-authentication", "audit"),
2630
libraryoutputresources.ExactConfigMap("openshift-authentication", "v4-0-config-system-trusted-ca-bundle"),
2731
libraryoutputresources.ExactDeployment("openshift-authentication", "oauth-openshift"),
28-
libraryoutputresources.ExactLowLevelOperator("authentications"),
29-
exactNamespace("openshift-authentication"),
30-
exactRole("openshift-config-managed", "system:openshift:oauth-servercert-trust"),
31-
exactRoleBinding("openshift-config-managed", "system:openshift:oauth-servercert-trust"),
3232
libraryoutputresources.ExactSecret("openshift-authentication", "v4-0-config-system-session"),
3333
libraryoutputresources.ExactSecret("openshift-authentication", "v4-0-config-system-ocp-branding-template"),
34-
exactService("openshift-authentication", "oauth-openshift"),
34+
libraryoutputresources.ExactService("openshift-authentication", "oauth-openshift"),
3535
libraryoutputresources.ExactServiceAccount("openshift-authentication", "oauth-openshift"),
36+
37+
libraryoutputresources.ExactRole("openshift-config-managed", "system:openshift:oauth-servercert-trust"),
38+
libraryoutputresources.ExactRoleBinding("openshift-config-managed", "system:openshift:oauth-servercert-trust"),
39+
40+
libraryoutputresources.ExactPDB("openshift-oauth-apiserver", "oauth-apiserver-pdb"),
3641
},
3742
EventingNamespaces: []string{
3843
"openshift-authentication-operator",
@@ -41,33 +46,20 @@ func runOutputResources(ctx context.Context) (*libraryoutputresources.OutputReso
4146
UserWorkloadResources: libraryoutputresources.ResourceList{
4247
ExactResources: []libraryoutputresources.ExactResourceID{
4348
libraryoutputresources.ExactClusterRoleBinding("system:openshift:openshift-authentication"),
44-
exactOAuthClient("openshift-browser-client"),
45-
exactOAuthClient("openshift-challenging-client"),
46-
exactOAuthClient("openshift-cli-client"),
49+
libraryoutputresources.ExactClusterRoleBinding("system:openshift:oauth-apiserver"),
50+
libraryoutputresources.ExactClusterRoleBinding("system:openshift:useroauthaccesstoken-manager"),
51+
libraryoutputresources.ExactClusterRole("system:openshift:useroauthaccesstoken-manager"),
52+
libraryoutputresources.ExactOAuthClient("openshift-browser-client"),
53+
libraryoutputresources.ExactOAuthClient("openshift-challenging-client"),
54+
libraryoutputresources.ExactOAuthClient("openshift-cli-client"),
55+
56+
// these are used to access resources in the user workload cluster
57+
libraryoutputresources.ExactServiceAccount("openshift-oauth-apiserver", "oauth-apiserver-sa"),
58+
libraryoutputresources.ExactService("openshift-oauth-apiserver", "api"),
4759
},
4860
GeneratedNameResources: []libraryoutputresources.GeneratedResourceID{
4961
libraryoutputresources.GeneratedCSR("system:openshift:openshift-authenticator-"),
5062
},
5163
},
5264
}, nil
5365
}
54-
55-
func exactOAuthClient(name string) libraryoutputresources.ExactResourceID {
56-
return libraryoutputresources.ExactResource("oauth.openshift.io", "v1", "oauthclients", "", name)
57-
}
58-
59-
func exactNamespace(name string) libraryoutputresources.ExactResourceID {
60-
return libraryoutputresources.ExactNamespace(name)
61-
}
62-
63-
func exactService(namespace, name string) libraryoutputresources.ExactResourceID {
64-
return libraryoutputresources.ExactResource("", "v1", "services", namespace, name)
65-
}
66-
67-
func exactRole(namespace, name string) libraryoutputresources.ExactResourceID {
68-
return libraryoutputresources.ExactRole(namespace, name)
69-
}
70-
71-
func exactRoleBinding(namespace, name string) libraryoutputresources.ExactResourceID {
72-
return libraryoutputresources.ExactRoleBinding(namespace, name)
73-
}

pkg/operator/starter.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ func prepareOauthAPIServerOperator(
551551
).WithAuditPolicyController(
552552
"openshift-oauth-apiserver",
553553
"audit",
554-
informerFactories.operatorConfigInformer.Config().V1().APIServers().Lister(),
555554
informerFactories.operatorConfigInformer,
556555
informerFactories.kubeInformersForNamespaces.InformersFor("openshift-oauth-apiserver"),
557556
authOperatorInput.kubeClient,
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
apiVersion: operator.openshift.io/v1
22
kind: Authentication
33
metadata:
4-
annotations:
5-
synthetic.mom.openshift.io/controller-instance-name: TODO-metadataController
64
name: cluster
75
status:
86
conditions:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: TODO-metadataController
3+
fieldManager: openshift-authentication-Metadata
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: operator.openshift.io/v1
2+
kind: Authentication
3+
metadata:
4+
name: cluster
5+
status:
6+
conditions:
7+
- lastTransitionTime: "2024-10-14T22:38:20Z"
8+
message: configmap "audit" not found
9+
reason: ContentCreationError
10+
status: "True"
11+
type: RevisionControllerDegraded
12+
latestAvailableRevision: 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: RevisionController
3+
fieldManager: oauth-apiserver-RevisionController
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fieldManager: oauth-apiserver-RevisionController
2+
force: true
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
apiVersion: operator.openshift.io/v1
22
kind: Authentication
33
metadata:
4-
annotations:
5-
synthetic.mom.openshift.io/controller-instance-name: TODO-configOverridesController
64
name: cluster
75
status:
86
conditions:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: TODO-configOverridesController
3+
fieldManager: openshift-authentication-UnsupportedConfigOverrides
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: operator.openshift.io/v1
2+
kind: Authentication
3+
metadata:
4+
name: cluster
5+
status:
6+
conditions:
7+
- lastTransitionTime: "2024-10-14T22:38:20Z"
8+
message: endpoints "api" not found
9+
reason: ErrorCheckingPrecondition
10+
status: "False"
11+
type: APIServicesAvailable
12+
- lastTransitionTime: "2024-10-14T22:38:20Z"
13+
status: "False"
14+
type: APIServicesDegraded
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: openshift-apiserver-APIService
3+
fieldManager: openshift-apiserver-APIService
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fieldManager: openshift-apiserver-APIService
2+
force: true
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
apiVersion: operator.openshift.io/v1
22
kind: Authentication
33
metadata:
4-
annotations:
5-
synthetic.mom.openshift.io/controller-instance-name: TODO-resourceSyncer
64
name: cluster
75
status:
86
conditions:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: TODO-resourceSyncer
3+
fieldManager: oauth-server-ResourceSync
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: operator.openshift.io/v1
2+
kind: Authentication
3+
metadata:
4+
name: cluster
5+
status:
6+
conditions:
7+
- lastTransitionTime: "2024-10-14T22:38:20Z"
8+
reason: PreconditionNotFulfilled
9+
status: "False"
10+
type: APIServerDeploymentAvailable
11+
- lastTransitionTime: "2024-10-14T22:38:20Z"
12+
message: |
13+
waiting for .status.latestAvailableRevision to be available
14+
reason: PreconditionNotFulfilled
15+
status: "True"
16+
type: APIServerDeploymentDegraded
17+
- lastTransitionTime: "2024-10-14T22:38:20Z"
18+
reason: PreconditionNotFulfilled
19+
status: "False"
20+
type: APIServerDeploymentProgressing
21+
- lastTransitionTime: "2024-10-14T22:38:20Z"
22+
message: |
23+
waiting for .status.latestAvailableRevision to be available
24+
reason: PreconditionNotFulfilled
25+
status: "True"
26+
type: APIServerWorkloadDegraded
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: OAuthAPIServerController-WorkloadWorkloadController
3+
fieldManager: OAuthAPIServerController-Workload
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fieldManager: OAuthAPIServerController-Workload
2+
force: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: operator.openshift.io/v1
2+
kind: Authentication
3+
metadata:
4+
name: cluster
5+
status:
6+
conditions:
7+
- lastTransitionTime: "2024-10-14T22:38:20Z"
8+
status: "False"
9+
type: EncryptionKeyControllerDegraded
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: openshift-oauth-apiserver-EncryptionKey
3+
fieldManager: openshift-oauth-apiserver-EncryptionKey
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fieldManager: openshift-oauth-apiserver-EncryptionKey
2+
force: true
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
apiVersion: operator.openshift.io/v1
22
kind: Authentication
33
metadata:
4-
annotations:
5-
synthetic.mom.openshift.io/controller-instance-name: TODO-ingressStateController
64
name: cluster
75
status:
86
conditions:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: TODO-ingressStateController
3+
fieldManager: openshift-authentication-IngressState
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: operator.openshift.io/v1
2+
kind: Authentication
3+
metadata:
4+
name: cluster
5+
status:
6+
conditions:
7+
- lastTransitionTime: "2024-10-14T22:38:20Z"
8+
status: "False"
9+
type: Encrypted
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: openshift-oauth-apiserver-EncryptionCondition
3+
fieldManager: openshift-oauth-apiserver-EncryptionCondition
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fieldManager: openshift-oauth-apiserver-EncryptionCondition
2+
force: true
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
apiVersion: operator.openshift.io/v1
22
kind: Authentication
33
metadata:
4-
annotations:
5-
synthetic.mom.openshift.io/controller-instance-name: TODO-other-configObserver
64
name: cluster
75
status:
86
conditions:
97
- lastTransitionTime: "2024-10-14T22:38:20Z"
108
message: |-
11-
oauth.config.openshift.io "cluster" not found
129
endpoints/host-etcd-2 in the openshift-etcd namespace: not found
1310
configmap openshift-etcd/etcd-endpoints not found, and fallback observer failed
11+
oauth.config.openshift.io "cluster" not found
1412
reason: Error
1513
status: "True"
1614
type: OAuthAPIServerConfigObservationDegraded
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
action: ApplyStatus
2+
controllerInstanceName: TODO-other-configObserver
3+
fieldManager: oauth-apiserver-ConfigObserver
4+
generateName: ""
5+
mame: cluster
6+
resourceType:
7+
Group: operator.openshift.io
8+
Resource: authentications
9+
Version: v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: operator.openshift.io/v1
2+
kind: Authentication
3+
metadata:
4+
name: cluster
5+
status:
6+
conditions:
7+
- lastTransitionTime: "2024-10-14T22:38:20Z"
8+
status: "False"
9+
type: EncryptionStateControllerDegraded

0 commit comments

Comments
 (0)