Skip to content

Commit

Permalink
Merge pull request #744 from deads2k/update-dep
Browse files Browse the repository at this point in the history
API-1835: bring MOM up to date for testing and the like
  • Loading branch information
openshift-merge-bot[bot] authored Dec 12, 2024
2 parents 75c7842 + 4bdbff3 commit ca163e0
Show file tree
Hide file tree
Showing 249 changed files with 2,489 additions and 735 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/ghodss/yaml v1.0.0
github.com/google/go-cmp v0.6.0
github.com/openshift/api v0.0.0-20241001152557-e415140e5d5f
github.com/openshift/build-machinery-go v0.0.0-20241031155326-6ae126a9cb72
github.com/openshift/api v0.0.0-20241101202457-04eb3fd119d2
github.com/openshift/build-machinery-go v0.0.0-20241126220845-0de670012c09
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f
github.com/openshift/library-go v0.0.0-20241120135057-fc703a7407c9
github.com/openshift/multi-operator-manager v0.0.0-20241119235446-3c965870ef94
github.com/openshift/library-go v0.0.0-20241127135410-64d8d9e80808
github.com/openshift/multi-operator-manager v0.0.0-20241205181422-20aa3906b99d
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.9.0
go.etcd.io/etcd/client/v3 v3.5.14
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,16 @@ github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA
github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
github.com/openshift/api v0.0.0-20241001152557-e415140e5d5f h1:ya1OmyZm3LIIxI3U9VE9Nyx3ehCHgBwxyFUPflYPWls=
github.com/openshift/api v0.0.0-20241001152557-e415140e5d5f/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo=
github.com/openshift/build-machinery-go v0.0.0-20241031155326-6ae126a9cb72 h1:kMM+Ea3YFrcoYS76RhhBA7uELy97JM0gwqnyoy7fxco=
github.com/openshift/build-machinery-go v0.0.0-20241031155326-6ae126a9cb72/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
github.com/openshift/api v0.0.0-20241101202457-04eb3fd119d2 h1:CguNy+2KzhJ3a3i7e4Bgm/ByfQpSSSPYmF9NLZskoUs=
github.com/openshift/api v0.0.0-20241101202457-04eb3fd119d2/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo=
github.com/openshift/build-machinery-go v0.0.0-20241126220845-0de670012c09 h1:NibXytu9e89emCQoRiKZR+warzC1bpQgYDyb9jpEI/s=
github.com/openshift/build-machinery-go v0.0.0-20241126220845-0de670012c09/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f h1:FRc0bVNWprihWS0GqQWzb3dY4dkCwpOP3mDw5NwSoR4=
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f/go.mod h1:KiZi2mJRH1TOJ3FtBDYS6YvUL30s/iIXaGSUrSa36mo=
github.com/openshift/library-go v0.0.0-20241120135057-fc703a7407c9 h1:bwIqO3LDkumwfDKTMRzixNHKUqU7yaKTTAKwENi6JOY=
github.com/openshift/library-go v0.0.0-20241120135057-fc703a7407c9/go.mod h1:9B1MYPoLtP9tqjWxcbUNVpwxy68zOH/3EIP6c31dAM0=
github.com/openshift/multi-operator-manager v0.0.0-20241119235446-3c965870ef94 h1:9Z5HQo1KSQogIpQ2tDzrCk4+sDjL/xF+YXBrDP4R36k=
github.com/openshift/multi-operator-manager v0.0.0-20241119235446-3c965870ef94/go.mod h1:Fn/rmcwj4bCuS11UT5TZvzONt7qTjzcd9BCSQkIwQOI=
github.com/openshift/library-go v0.0.0-20241127135410-64d8d9e80808 h1:IUVlNRH6tuA0djyJsfGVTACsjE16hncfU1c/YKOobGw=
github.com/openshift/library-go v0.0.0-20241127135410-64d8d9e80808/go.mod h1:l/3SegTa9x+ry2J213bh7+DBofXOOvdrqU4JC9ktJa0=
github.com/openshift/multi-operator-manager v0.0.0-20241205181422-20aa3906b99d h1:Rzx23P63JFNNz5D23ubhC0FCN5rK8CeJhKcq5QKcdyU=
github.com/openshift/multi-operator-manager v0.0.0-20241205181422-20aa3906b99d/go.mod h1:iVi9Bopa5cLhjG5ie9DoZVVqkH8BGb1FQVTtecOLn4I=
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
13 changes: 4 additions & 9 deletions pkg/cmd/mom/apply_configuration_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,14 @@ func NewApplyConfigurationCommand(streams genericiooptions.IOStreams) *cobra.Com
return libraryapplyconfiguration.NewApplyConfigurationCommand(RunApplyConfiguration, runOutputResources, streams)
}

func RunApplyConfiguration(ctx context.Context, input libraryapplyconfiguration.ApplyConfigurationInput) (libraryapplyconfiguration.AllDesiredMutationsGetter, error) {
func RunApplyConfiguration(ctx context.Context, input libraryapplyconfiguration.ApplyConfigurationInput) (*libraryapplyconfiguration.ApplyConfigurationRunResult, libraryapplyconfiguration.AllDesiredMutationsGetter, error) {
authenticationOperatorInput, err := operator.CreateOperatorInputFromMOM(ctx, input)
if err != nil {
return nil, fmt.Errorf("unable to configure operator input: %w", err)
return nil, nil, fmt.Errorf("unable to configure operator input: %w", err)
}
operatorStarter, err := operator.CreateOperatorStarter(ctx, authenticationOperatorInput)
if err != nil {
return nil, fmt.Errorf("unable to configure operators: %w", err)
return nil, nil, fmt.Errorf("unable to configure operators: %w", err)
}
var operatorRunError error
if err := operatorStarter.RunOnce(ctx); err != nil {
operatorRunError = fmt.Errorf("unable to run operators: %w", err)
}

return libraryapplyconfiguration.NewApplyConfigurationFromClient(input.MutationTrackingClient.GetMutations()), operatorRunError
return operatorStarter.RunOnce(ctx, input)
}
48 changes: 20 additions & 28 deletions pkg/cmd/mom/output_resources_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@ func runOutputResources(ctx context.Context) (*libraryoutputresources.OutputReso
ManagementResources: libraryoutputresources.ResourceList{
ExactResources: []libraryoutputresources.ExactResourceID{
libraryoutputresources.ExactClusterOperator("authentication"),
libraryoutputresources.ExactLowLevelOperator("authentications"),
libraryoutputresources.ExactNamespace("openshift-authentication"),
libraryoutputresources.ExactNamespace("openshift-oauth-apiserver"),

libraryoutputresources.ExactConfigMap("openshift-authentication", "audit"),
libraryoutputresources.ExactConfigMap("openshift-authentication", "v4-0-config-system-trusted-ca-bundle"),
libraryoutputresources.ExactDeployment("openshift-authentication", "oauth-openshift"),
libraryoutputresources.ExactLowLevelOperator("authentications"),
exactNamespace("openshift-authentication"),
exactRole("openshift-config-managed", "system:openshift:oauth-servercert-trust"),
exactRoleBinding("openshift-config-managed", "system:openshift:oauth-servercert-trust"),
libraryoutputresources.ExactSecret("openshift-authentication", "v4-0-config-system-session"),
libraryoutputresources.ExactSecret("openshift-authentication", "v4-0-config-system-ocp-branding-template"),
exactService("openshift-authentication", "oauth-openshift"),
libraryoutputresources.ExactService("openshift-authentication", "oauth-openshift"),
libraryoutputresources.ExactServiceAccount("openshift-authentication", "oauth-openshift"),

libraryoutputresources.ExactRole("openshift-config-managed", "system:openshift:oauth-servercert-trust"),
libraryoutputresources.ExactRoleBinding("openshift-config-managed", "system:openshift:oauth-servercert-trust"),

libraryoutputresources.ExactPDB("openshift-oauth-apiserver", "oauth-apiserver-pdb"),
},
EventingNamespaces: []string{
"openshift-authentication-operator",
Expand All @@ -41,33 +46,20 @@ func runOutputResources(ctx context.Context) (*libraryoutputresources.OutputReso
UserWorkloadResources: libraryoutputresources.ResourceList{
ExactResources: []libraryoutputresources.ExactResourceID{
libraryoutputresources.ExactClusterRoleBinding("system:openshift:openshift-authentication"),
exactOAuthClient("openshift-browser-client"),
exactOAuthClient("openshift-challenging-client"),
exactOAuthClient("openshift-cli-client"),
libraryoutputresources.ExactClusterRoleBinding("system:openshift:oauth-apiserver"),
libraryoutputresources.ExactClusterRoleBinding("system:openshift:useroauthaccesstoken-manager"),
libraryoutputresources.ExactClusterRole("system:openshift:useroauthaccesstoken-manager"),
libraryoutputresources.ExactOAuthClient("openshift-browser-client"),
libraryoutputresources.ExactOAuthClient("openshift-challenging-client"),
libraryoutputresources.ExactOAuthClient("openshift-cli-client"),

// these are used to access resources in the user workload cluster
libraryoutputresources.ExactServiceAccount("openshift-oauth-apiserver", "oauth-apiserver-sa"),
libraryoutputresources.ExactService("openshift-oauth-apiserver", "api"),
},
GeneratedNameResources: []libraryoutputresources.GeneratedResourceID{
libraryoutputresources.GeneratedCSR("system:openshift:openshift-authenticator-"),
},
},
}, nil
}

func exactOAuthClient(name string) libraryoutputresources.ExactResourceID {
return libraryoutputresources.ExactResource("oauth.openshift.io", "v1", "oauthclients", "", name)
}

func exactNamespace(name string) libraryoutputresources.ExactResourceID {
return libraryoutputresources.ExactNamespace(name)
}

func exactService(namespace, name string) libraryoutputresources.ExactResourceID {
return libraryoutputresources.ExactResource("", "v1", "services", namespace, name)
}

func exactRole(namespace, name string) libraryoutputresources.ExactResourceID {
return libraryoutputresources.ExactRole(namespace, name)
}

func exactRoleBinding(namespace, name string) libraryoutputresources.ExactResourceID {
return libraryoutputresources.ExactRoleBinding(namespace, name)
}
1 change: 0 additions & 1 deletion pkg/operator/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ func prepareOauthAPIServerOperator(
).WithAuditPolicyController(
"openshift-oauth-apiserver",
"audit",
informerFactories.operatorConfigInformer.Config().V1().APIServers().Lister(),
informerFactories.operatorConfigInformer,
informerFactories.kubeInformersForNamespaces.InformersFor("openshift-oauth-apiserver"),
authOperatorInput.kubeClient,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
annotations:
synthetic.mom.openshift.io/controller-instance-name: TODO-metadataController
name: cluster
status:
conditions:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: TODO-metadataController
fieldManager: openshift-authentication-Metadata
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
name: cluster
status:
conditions:
- lastTransitionTime: "2024-10-14T22:38:20Z"
message: configmap "audit" not found
reason: ContentCreationError
status: "True"
type: RevisionControllerDegraded
latestAvailableRevision: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: RevisionController
fieldManager: oauth-apiserver-RevisionController
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fieldManager: oauth-apiserver-RevisionController
force: true
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
annotations:
synthetic.mom.openshift.io/controller-instance-name: TODO-configOverridesController
name: cluster
status:
conditions:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: TODO-configOverridesController
fieldManager: openshift-authentication-UnsupportedConfigOverrides
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
name: cluster
status:
conditions:
- lastTransitionTime: "2024-10-14T22:38:20Z"
message: endpoints "api" not found
reason: ErrorCheckingPrecondition
status: "False"
type: APIServicesAvailable
- lastTransitionTime: "2024-10-14T22:38:20Z"
status: "False"
type: APIServicesDegraded
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: openshift-apiserver-APIService
fieldManager: openshift-apiserver-APIService
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fieldManager: openshift-apiserver-APIService
force: true
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
annotations:
synthetic.mom.openshift.io/controller-instance-name: TODO-resourceSyncer
name: cluster
status:
conditions:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: TODO-resourceSyncer
fieldManager: oauth-server-ResourceSync
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
name: cluster
status:
conditions:
- lastTransitionTime: "2024-10-14T22:38:20Z"
reason: PreconditionNotFulfilled
status: "False"
type: APIServerDeploymentAvailable
- lastTransitionTime: "2024-10-14T22:38:20Z"
message: |
waiting for .status.latestAvailableRevision to be available
reason: PreconditionNotFulfilled
status: "True"
type: APIServerDeploymentDegraded
- lastTransitionTime: "2024-10-14T22:38:20Z"
reason: PreconditionNotFulfilled
status: "False"
type: APIServerDeploymentProgressing
- lastTransitionTime: "2024-10-14T22:38:20Z"
message: |
waiting for .status.latestAvailableRevision to be available
reason: PreconditionNotFulfilled
status: "True"
type: APIServerWorkloadDegraded
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: OAuthAPIServerController-WorkloadWorkloadController
fieldManager: OAuthAPIServerController-Workload
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fieldManager: OAuthAPIServerController-Workload
force: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
name: cluster
status:
conditions:
- lastTransitionTime: "2024-10-14T22:38:20Z"
status: "False"
type: EncryptionKeyControllerDegraded
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: openshift-oauth-apiserver-EncryptionKey
fieldManager: openshift-oauth-apiserver-EncryptionKey
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fieldManager: openshift-oauth-apiserver-EncryptionKey
force: true
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
annotations:
synthetic.mom.openshift.io/controller-instance-name: TODO-ingressStateController
name: cluster
status:
conditions:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: TODO-ingressStateController
fieldManager: openshift-authentication-IngressState
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
name: cluster
status:
conditions:
- lastTransitionTime: "2024-10-14T22:38:20Z"
status: "False"
type: Encrypted
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: openshift-oauth-apiserver-EncryptionCondition
fieldManager: openshift-oauth-apiserver-EncryptionCondition
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fieldManager: openshift-oauth-apiserver-EncryptionCondition
force: true
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
annotations:
synthetic.mom.openshift.io/controller-instance-name: TODO-other-configObserver
name: cluster
status:
conditions:
- lastTransitionTime: "2024-10-14T22:38:20Z"
message: |-
oauth.config.openshift.io "cluster" not found
endpoints/host-etcd-2 in the openshift-etcd namespace: not found
configmap openshift-etcd/etcd-endpoints not found, and fallback observer failed
oauth.config.openshift.io "cluster" not found
reason: Error
status: "True"
type: OAuthAPIServerConfigObservationDegraded
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action: ApplyStatus
controllerInstanceName: TODO-other-configObserver
fieldManager: oauth-apiserver-ConfigObserver
generateName: ""
mame: cluster
resourceType:
Group: operator.openshift.io
Resource: authentications
Version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: operator.openshift.io/v1
kind: Authentication
metadata:
name: cluster
status:
conditions:
- lastTransitionTime: "2024-10-14T22:38:20Z"
status: "False"
type: EncryptionStateControllerDegraded
Loading

0 comments on commit ca163e0

Please sign in to comment.