Skip to content
Closed
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: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/openshift/api => github.com/sanchezl/api v0.0.0-20240209164413-25ecd10c35d4
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/openshift/api v0.0.0-20240118221011-59fa376de7cb h1:JDdPPnz4PjemCCuXSEN1/vk+/yRGoqqwZ+2i+OUgrGI=
github.com/openshift/api v0.0.0-20240118221011-59fa376de7cb/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
github.com/openshift/build-machinery-go v0.0.0-20231128094528-1e9b1b0595c8 h1:cu3YUMVGsKIyFyJGO3F6BZKGYQZpCKxAv9cBPgQAca8=
github.com/openshift/build-machinery-go v0.0.0-20231128094528-1e9b1b0595c8/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
github.com/openshift/client-go v0.0.0-20240115204758-e6bf7d631d5e h1:qGjfKX8i0h4efMNEnhgTdxcdx6gwwOwhTfBJ20WFqA8=
Expand All @@ -163,6 +161,8 @@ github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfm
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sanchezl/api v0.0.0-20240209164413-25ecd10c35d4 h1:heD3CKP7KqGkprzzVDz2HdSMb2mtgjjqlQZRlBs1IGk=
github.com/sanchezl/api v0.0.0-20240209164413-25ecd10c35d4/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
Expand Down
17 changes: 17 additions & 0 deletions pkg/operator/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/openshift/library-go/pkg/operator/loglevel"
"github.com/openshift/library-go/pkg/operator/resource/resourceapply"
"github.com/openshift/library-go/pkg/operator/resourcesynccontroller"
"github.com/openshift/library-go/pkg/operator/staleconditions"
"github.com/openshift/library-go/pkg/operator/staticresourcecontroller"
"github.com/openshift/library-go/pkg/operator/status"
"github.com/openshift/library-go/pkg/operator/v1helpers"
Expand Down Expand Up @@ -263,6 +264,12 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
controllerConfig.EventRecorder,
)

staleConditionsController := staleconditions.NewRemoveStaleConditionsController(
[]string{"ImageRegistryAuthTokenTypeUpgradeable"},
opClient,
controllerConfig.EventRecorder,
)

ensureDaemonSetCleanup(ctx, kubeClient, controllerConfig.EventRecorder)

operatorConfigInformers.Start(ctx.Done())
Expand All @@ -277,6 +284,7 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
go clusterOperatorStatus.Run(ctx, 1)
go logLevelController.Run(ctx, 1)
go imagePullSecretCleanupController.Run(ctx, 1)
go staleConditionsController.Run(ctx, 1)

capabilityChangedCh := make(chan struct{})
if !buildCapabilityEnabled {
Expand Down Expand Up @@ -305,6 +313,15 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
}()
}

go wait.UntilWithContext(ctx, func(ctx context.Context) {
c, err := operatorClient.OperatorV1().OpenShiftControllerManagers().Get(ctx, "cluster", metav1.GetOptions{})
if err != nil {
klog.V(1).ErrorS(err, "getting OpenShiftControllerManager config")
return
}
klog.V(1).InfoS("OpenShiftControllerManager", "name", c.Name, "imageRegistryAuthTokenType", c.Spec.ImageRegistryAuthTokenType)
}, time.Minute)

select {
case <-capabilityChangedCh:
return fmt.Errorf("capability is enabled, stopping")
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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

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

Loading