Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
eea2092
pkg/cvo/sync_worker: Generalize CancelError to ContextError
wking May 28, 2020
adf8fd6
pkg/cvo/sync_worker: Do not treat "All errors were context errors..."…
wking May 28, 2020
99f6ba5
Merge pull request #378 from openshift-cherrypick-robot/cherry-pick-3…
openshift-merge-robot Jun 3, 2020
202578a
Expand supported set of probe field mutations
ironcladlou Jun 15, 2020
40ec7e4
Merge pull request #389 from openshift-cherrypick-robot/cherry-pick-3…
openshift-merge-robot Jun 19, 2020
2326bcc
Bug 1855577: Updating the golang.org/x/text version to v0.3.3
LalatenduMohanty Jul 14, 2020
dc662b7
pkg/cvo: Set NoDesiredImage reason when desired.Image is empty
wking May 27, 2020
f00e20f
pkg/cvo/status: Raise Operator leveling grace-period to 20 minutes
wking Jul 31, 2020
b0f92e5
Merge pull request #427 from wking/raise-operator-leveling-timeout-4.5
openshift-merge-robot Aug 19, 2020
9713dc5
Merge pull request #409 from openshift-cherrypick-robot/cherry-pick-4…
openshift-merge-robot Aug 20, 2020
55ff603
pkg/start: Drop the internal EnableMetrics
wking Apr 15, 2020
d257c32
pkg/cvo/metrics: Graceful server shutdown
wking Apr 15, 2020
f8774c0
pkg/start: Register metrics directly
wking Apr 15, 2020
d8ca134
pkg/cvo/egress: Pull HTTPS/Proxy egress into separate file
wking Apr 21, 2020
905b305
pkg/start: Release leader lease on graceful shutdown
wking Aug 3, 2020
c8af639
pkg/start/start_integration_test: Do not assume "deleted" for ConfigM…
wking Aug 5, 2020
c8f99b2
pkg/start: Fill in deferred HandleCrash
wking Aug 6, 2020
a42bfb7
cmd/start: Include the version in the outgoing log line
wking Aug 25, 2020
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
Prev Previous commit
Next Next commit
pkg/start: Drop the internal EnableMetrics
We've had it since 2b81f47 (cvo: Release our leader lease when we
are gracefully terminated, 2019-01-16, #87), but it's redundant
vs. "ListenAddr is not an empty string".

I'm also switching to:

  o.ListenAddr != ""

instead of:

  len(o.ListenAddr) > 0

because it seems slightly easier to understand, but obviously either
will work.

Cherry-picked from 07e5809 (#349), around conflicts due to the lack
of TLS metrics in 4.5.
  • Loading branch information
wking committed Aug 26, 2020
commit 55ff6032a3920905bec670e3201707cf7fdf8e5c
6 changes: 2 additions & 4 deletions pkg/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ type Options struct {
Name string
Namespace string
PayloadOverride string
EnableMetrics bool
ResyncInterval time.Duration
}

Expand All @@ -91,7 +90,6 @@ func NewOptions() *Options {
Name: defaultEnv("CVO_NAME", defaultComponentName),
PayloadOverride: os.Getenv("PAYLOAD_OVERRIDE"),
ResyncInterval: minResyncPeriod,
EnableMetrics: true,
Exclude: os.Getenv("EXCLUDE_MANIFESTS"),
}
}
Expand Down Expand Up @@ -155,7 +153,7 @@ func (o *Options) Run() error {

func (o *Options) run(ctx context.Context, controllerCtx *Context, lock *resourcelock.ConfigMapLock) {
// listen on metrics
if len(o.ListenAddr) > 0 {
if o.ListenAddr != "" {
mux := http.NewServeMux()
mux.Handle("/metrics", promhttp.Handler())
go func() {
Expand Down Expand Up @@ -345,7 +343,7 @@ func (o *Options) NewControllerContext(cb *ClientBuilder) *Context {
sharedInformers.Config().V1().Proxies(),
cb.ClientOrDie(o.Namespace),
cb.KubeClientOrDie(o.Namespace, useProtobuf),
o.EnableMetrics,
o.ListenAddr != "",
o.Exclude,
),
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/start/start_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ func TestIntegrationCVO_initializeAndUpgrade(t *testing.T) {
options.NodeName = "test-node"
options.ReleaseImage = payloadImage1
options.PayloadOverride = filepath.Join(dir, "ignored")
options.EnableMetrics = false
controllers := options.NewControllerContext(cb)

worker := cvo.NewSyncWorker(retriever, cvo.NewResourceBuilder(cfg, cfg, nil), 5*time.Second, wait.Backoff{Steps: 3}, "")
Expand Down Expand Up @@ -390,7 +389,6 @@ func TestIntegrationCVO_initializeAndHandleError(t *testing.T) {
options.NodeName = "test-node"
options.ReleaseImage = payloadImage1
options.PayloadOverride = filepath.Join(dir, "ignored")
options.EnableMetrics = false
options.ResyncInterval = 3 * time.Second
controllers := options.NewControllerContext(cb)

Expand Down Expand Up @@ -497,7 +495,6 @@ func TestIntegrationCVO_gracefulStepDown(t *testing.T) {
options.Name = ns
options.ListenAddr = ""
options.NodeName = "test-node"
options.EnableMetrics = false
controllers := options.NewControllerContext(cb)

worker := cvo.NewSyncWorker(&mapPayloadRetriever{}, cvo.NewResourceBuilder(cfg, cfg, nil), 5*time.Second, wait.Backoff{Steps: 3}, "")
Expand Down Expand Up @@ -667,7 +664,6 @@ metadata:
options.NodeName = "test-node"
options.ReleaseImage = payloadImage1
options.PayloadOverride = payloadDir
options.EnableMetrics = false
controllers := options.NewControllerContext(cb)
if err := controllers.CVO.InitializeFromPayload(cb.RestConfig(defaultQPS), cb.RestConfig(highQPS)); err != nil {
t.Fatal(err)
Expand Down