Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/openshift/build-machinery-go v0.0.0-20241025131534-5f3bc3c56265
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f
github.com/openshift/library-go v0.0.0-20241025192116-97dc382cad13
github.com/openshift/multi-operator-manager v0.0.0-20241022160113-b880eaae93fc
github.com/openshift/multi-operator-manager v0.0.0-20241028172628-4e6de0af517a
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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f h1:FRc0bVNWpri
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f/go.mod h1:KiZi2mJRH1TOJ3FtBDYS6YvUL30s/iIXaGSUrSa36mo=
github.com/openshift/library-go v0.0.0-20241025192116-97dc382cad13 h1:59NslqHDdxffgFww2qnzc6HZ1OHvfVzkUpEICiZAvok=
github.com/openshift/library-go v0.0.0-20241025192116-97dc382cad13/go.mod h1:9B1MYPoLtP9tqjWxcbUNVpwxy68zOH/3EIP6c31dAM0=
github.com/openshift/multi-operator-manager v0.0.0-20241022160113-b880eaae93fc h1:DPatMo6iid7ruxVr3LEu0EHe3oll9CYZYO4A8vV3RYU=
github.com/openshift/multi-operator-manager v0.0.0-20241022160113-b880eaae93fc/go.mod h1:7u7Wj5yctFzwixEJdrnpZCCNuJwdwls3SwqHoxRlN7E=
github.com/openshift/multi-operator-manager v0.0.0-20241028172628-4e6de0af517a h1:ru37iQH7O+lqv4H8a2QTOYp+ZCajf6MS02a3HouEFrc=
github.com/openshift/multi-operator-manager v0.0.0-20241028172628-4e6de0af517a/go.mod h1:/gSz0z+w5wjpnbsCvE/uo+Tu4xKG7iZKKWMh3skmfRw=
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
2 changes: 1 addition & 1 deletion pkg/cmd/mom/apply_configuration_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func NewApplyConfigurationCommand(streams genericiooptions.IOStreams) *cobra.Command {
return libraryapplyconfiguration.NewApplyConfigurationCommand(RunApplyConfiguration, streams)
return libraryapplyconfiguration.NewApplyConfigurationCommand(RunApplyConfiguration, RunOutputResources, streams)
}

func RunApplyConfiguration(ctx context.Context, input libraryapplyconfiguration.ApplyConfigurationInput) (libraryapplyconfiguration.AllDesiredMutationsGetter, error) {
Expand Down
16 changes: 8 additions & 8 deletions pkg/cmd/mom/output_resources_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ func NewOutputResourcesCommand(streams genericiooptions.IOStreams) *cobra.Comman
func RunOutputResources(ctx context.Context) (*libraryoutputresources.OutputResources, error) {
return &libraryoutputresources.OutputResources{
ConfigurationResources: libraryoutputresources.ResourceList{
ExactResources: []libraryoutputresources.ExactResource{
ExactResources: []libraryoutputresources.ExactResourceID{
exactResource("config.openshift.io", "ingresses", "", "cluster"),
},
},
ManagementResources: libraryoutputresources.ResourceList{
ExactResources: []libraryoutputresources.ExactResource{
ExactResources: []libraryoutputresources.ExactResourceID{
exactResource("config.openshift.io", "clusteroperators", "", "authentication"),
exactResource("openshift.openshift.io", "authentications", "", "cluster"),
},
},
UserWorkloadResources: libraryoutputresources.ResourceList{
ExactResources: []libraryoutputresources.ExactResource{
ExactResources: []libraryoutputresources.ExactResourceID{
exactResource("", "secrets", "openshift-authentication", "v4-0-config-system-session"),
exactResource("", "secrets", "openshift-authentication", "v4-0-config-system-ocp-branding-template"),
exactResource("", "serviceaccounts", "openshift-authentication", "oauth-openshift"),
Expand All @@ -38,15 +38,15 @@ func RunOutputResources(ctx context.Context) (*libraryoutputresources.OutputReso
exactResource("rbac.authorization.k8s.io", "rolebindings", "openshift-config-managed", "system:openshift:oauth-servercert-trust"),
exactResource("rbac.authorization.k8s.io", "roles", "openshift-config-managed", "system:openshift:oauth-servercert-trust"),
},
GeneratedNameResources: []libraryoutputresources.GeneratedNameResource{
GeneratedNameResources: []libraryoutputresources.GeneratedResourceID{
generatedResource("certificates.k8s.io", "certificatesigningrequests", "", "system:openshift:openshift-authenticator-"),
},
},
}, nil
}

func exactResource(group, resource, namespace, name string) libraryoutputresources.ExactResource {
return libraryoutputresources.ExactResource{
func exactResource(group, resource, namespace, name string) libraryoutputresources.ExactResourceID {
return libraryoutputresources.ExactResourceID{
OutputResourceTypeIdentifier: libraryoutputresources.OutputResourceTypeIdentifier{
Group: group,
Resource: resource,
Expand All @@ -56,8 +56,8 @@ func exactResource(group, resource, namespace, name string) libraryoutputresourc
}
}

func generatedResource(group, resource, namespace, name string) libraryoutputresources.GeneratedNameResource {
return libraryoutputresources.GeneratedNameResource{
func generatedResource(group, resource, namespace, name string) libraryoutputresources.GeneratedResourceID {
return libraryoutputresources.GeneratedResourceID{
OutputResourceTypeIdentifier: libraryoutputresources.OutputResourceTypeIdentifier{
Group: group,
Resource: resource,
Expand Down
10 changes: 5 additions & 5 deletions pkg/operator/replacement_starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,29 +280,29 @@ func CreateOperatorStarter(ctx context.Context, authOperatorInput *authenticatio
authOperatorInput.eventRecorder,
)
ret.ControllerRunFns = append(ret.ControllerRunFns, libraryapplyconfiguration.AdaptRunFn(resourceSyncer.Run))
ret.ControllerRunOnceFns = append(ret.ControllerRunOnceFns, libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, resourceSyncer.Sync))
ret.ControllerNamedRunOnceFns = append(ret.ControllerNamedRunOnceFns, libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-resourceSyncer", resourceSyncer.Sync))

configOverridesController := unsupportedconfigoverridescontroller.NewUnsupportedConfigOverridesController("openshift-authentication", authOperatorInput.authenticationOperatorClient, authOperatorInput.eventRecorder)
ret.ControllerRunFns = append(ret.ControllerRunFns, libraryapplyconfiguration.AdaptRunFn(configOverridesController.Run))
ret.ControllerRunOnceFns = append(ret.ControllerRunOnceFns, libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, configOverridesController.Sync))
ret.ControllerNamedRunOnceFns = append(ret.ControllerNamedRunOnceFns, libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-configOverridesController", configOverridesController.Sync))

logLevelController := loglevel.NewClusterOperatorLoggingController(authOperatorInput.authenticationOperatorClient, authOperatorInput.eventRecorder)
ret.ControllerRunFns = append(ret.ControllerRunFns, libraryapplyconfiguration.AdaptRunFn(logLevelController.Run))
ret.ControllerRunOnceFns = append(ret.ControllerRunOnceFns, libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, logLevelController.Sync))
ret.ControllerNamedRunOnceFns = append(ret.ControllerNamedRunOnceFns, libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-logLevelController", logLevelController.Sync))

oauthRunOnceFns, oauthRunFns, err := prepareOauthOperator(ctx, authOperatorInput, informerFactories, resourceSyncer, versionRecorder)
if err != nil {
return nil, fmt.Errorf("unable to prepare oauth server: %w", err)
}
ret.ControllerRunFns = append(ret.ControllerRunFns, oauthRunFns...)
ret.ControllerRunOnceFns = append(ret.ControllerRunOnceFns, oauthRunOnceFns...)
ret.ControllerNamedRunOnceFns = append(ret.ControllerNamedRunOnceFns, oauthRunOnceFns...)

oauthAPIServerRunOnceFns, oauthAPIServerRunFns, err := prepareOauthAPIServerOperator(ctx, authOperatorInput, informerFactories, resourceSyncer, versionRecorder)
if err != nil {
return nil, fmt.Errorf("unable to prepare oauth server: %w", err)
}
ret.ControllerRunFns = append(ret.ControllerRunFns, oauthAPIServerRunFns...)
ret.ControllerRunOnceFns = append(ret.ControllerRunOnceFns, oauthAPIServerRunOnceFns...)
ret.ControllerNamedRunOnceFns = append(ret.ControllerNamedRunOnceFns, oauthAPIServerRunOnceFns...)

return ret, nil
}
56 changes: 28 additions & 28 deletions pkg/operator/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func prepareOauthOperator(
informerFactories authenticationOperatorInformerFactories,
resourceSyncController *resourcesynccontroller.ResourceSyncController,
versionRecorder status.VersionGetter,
) ([]libraryapplyconfiguration.RunOnceFunc, []libraryapplyconfiguration.RunFunc, error) {
) ([]libraryapplyconfiguration.NamedRunOnce, []libraryapplyconfiguration.RunFunc, error) {

clusterVersion, err := authOperatorInput.configClient.ConfigV1().ClusterVersions().Get(ctx, "version", metav1.GetOptions{})
if err != nil {
Expand Down Expand Up @@ -318,26 +318,26 @@ func prepareOauthOperator(
authOperatorInput.eventRecorder,
)

runOnceFns := []libraryapplyconfiguration.RunOnceFunc{
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, configObserver.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, deploymentController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, managementStateController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, metadataController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, oauthClientsController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, payloadConfigController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, routerCertsController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, serviceCAController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, staticResourceController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, wellKnownReadyController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, authRouteCheckController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, authServiceCheckController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, authServiceEndpointCheckController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, workersAvailableController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, proxyConfigController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, customRouteController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, trustDistributionController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, staleConditions.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, ingressStateController.Sync),
runOnceFns := []libraryapplyconfiguration.NamedRunOnce{
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-configObserver", configObserver.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-deploymentController", deploymentController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-managementStateController", managementStateController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-metadataController", metadataController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-oauthClientsController", oauthClientsController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-payloadConfigController", payloadConfigController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-routerCertsController", routerCertsController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-serviceCAController", serviceCAController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-staticResourceController", staticResourceController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-wellKnownReadyController", wellKnownReadyController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-authRouteCheckController", authRouteCheckController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-authServiceCheckController", authServiceCheckController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-authServiceEndpointCheckController", authServiceEndpointCheckController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-workersAvailableController", workersAvailableController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-proxyConfigController", proxyConfigController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-customRouteController", customRouteController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-trustDistributionController", trustDistributionController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-staleConditions", staleConditions.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-ingressStateController", ingressStateController.Sync),
}

runFns := []libraryapplyconfiguration.RunFunc{
Expand Down Expand Up @@ -370,7 +370,7 @@ func prepareOauthOperator(
informerFactories.operatorConfigInformer,
authOperatorInput.eventRecorder,
)
runOnceFns = append(runOnceFns, libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, terminationController.Sync))
runOnceFns = append(runOnceFns, libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-terminationController", terminationController.Sync))
runFns = append(runFns, libraryapplyconfiguration.AdaptRunFn(terminationController.Run))
}

Expand All @@ -383,7 +383,7 @@ func prepareOauthAPIServerOperator(
informerFactories authenticationOperatorInformerFactories,
resourceSyncController *resourcesynccontroller.ResourceSyncController,
versionRecorder status.VersionGetter,
) ([]libraryapplyconfiguration.RunOnceFunc, []libraryapplyconfiguration.RunFunc, error) {
) ([]libraryapplyconfiguration.NamedRunOnce, []libraryapplyconfiguration.RunFunc, error) {
eventRecorder := authOperatorInput.eventRecorder.ForComponent("oauth-apiserver")

// add syncing for etcd certs for oauthapi-server
Expand Down Expand Up @@ -651,11 +651,11 @@ func prepareOauthAPIServerOperator(
eventRecorder,
)

runOnceFns := []libraryapplyconfiguration.RunOnceFunc{
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, configObserver.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, authenticatorCertRequester.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, webhookAuthController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, webhookCertsApprover.Sync),
runOnceFns := []libraryapplyconfiguration.NamedRunOnce{
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-other-configObserver", configObserver.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-authenticatorCertRequester", authenticatorCertRequester.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-webhookAuthController", webhookAuthController.Sync),
libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, "TODO-webhookCertsApprover", webhookCertsApprover.Sync),
// TODO missing :(
//libraryapplyconfiguration.AdaptSyncFn(authOperatorInput.eventRecorder, apiServerControllers.Sync),
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading