Bug 2043709 - Logging flags no longer being bound to command line
Summary: Logging flags no longer being bound to command line
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: config-operator
Version: 4.10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.10.0
Assignee: Ehila
QA Contact: Rahul Gangwar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-21 19:59 UTC by Ehila
Modified: 2022-03-10 16:42 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-10 16:41:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-config-operator pull 230 0 None open Bug 2043709: fix component-base logging flags 2022-01-24 14:59:55 UTC
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-10 16:42:08 UTC

Description Ehila 2022-01-21 19:59:23 UTC
Description of problem:

PR #229 updated component-base to 0.23.0 which included an underlying change in how logging command line flags were being added, as a result logging flags are no longer added to the built binary.

How reproducible:

Every built binary from master no longer contains logging flags

Steps to Reproduce:

Checkout master or any hash after commit 5db9cdfe879102f68246bf3d8ee44ceb2ca353f8

1. git checkout master
2. make build
3. ./cluster-config-operator -h

Actual results:

```
OpenShift cluster config operator

Usage:
  cluster-config-operator [flags]
  cluster-config-operator [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  operator    Start the Cluster Config Operator
  render      Render kubernetes API server bootstrap manifests, secrets and configMaps

Flags:
  -h, --help      help for cluster-config-operator
  -v, --version   version for cluster-config-operator

Use "cluster-config-operator [command] --help" for more information about a command.
```

Expected results:

```
OpenShift cluster config operator

Usage:
  cluster-config-operator [flags]
  cluster-config-operator [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  operator    Start the Cluster Config Operator
  render      Render kubernetes API server bootstrap manifests, secrets and configMaps

Flags:
      --add-dir-header                   If true, adds the file directory to the header of the log messages (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --alsologtostderr                  log to standard error as well as files (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  -h, --help                             help for cluster-config-operator
      --log-backtrace-at traceLocation   when logging hits line file:N, emit a stack trace (default :0) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-dir string                   If non-empty, write log files in this directory (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-file string                  If non-empty, use this log file (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-file-max-size uint           Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-flush-frequency duration     Maximum number of seconds between log flushes (default 5s)
      --logtostderr                      log to standard error instead of files (default true) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --one-output                       If true, only write logs to their native severity level (vs also writing to each lower severity level) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --skip-headers                     If true, avoid header prefixes in the log messages (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --skip-log-headers                 If true, avoid headers when opening log files (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --stderrthreshold severity         logs at or above this threshold go to stderr (default 2) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  -v, --v Level                          number for the log level verbosity
      --version                          version for cluster-config-operator
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging

Use "cluster-config-operator [command] --help" for more information about a command.
```

Additional Info:

PR https://github.com/openshift/cluster-config-operator/pull/230 fixes the above

Comment 2 Rahul Gangwar 2022-01-25 05:58:44 UTC
go version
go version go1.17.6 darwin/amd64
rahulgangwar@rgangwar-mac cluster-config-operator % make build                                                  
go build -mod=vendor -trimpath -ldflags "-X github.com/openshift/cluster-config-operator/pkg/version.versionFromGit="v0.0.0-alpha.0-402-ga726e3e" -X github.com/openshift/cluster-config-operator/pkg/version.commitFromGit="a726e3ee" -X github.com/openshift/cluster-config-operator/pkg/version.gitTreeState="clean" -X github.com/openshift/cluster-config-operator/pkg/version.buildDate="2022-01-25T05:55:58Z" " github.com/openshift/cluster-config-operator/cmd/cluster-config-operator
rahulgangwar@rgangwar-mac cluster-config-operator % ./cluster-config-operator -h
OpenShift cluster config operator

Usage:
  cluster-config-operator [flags]
  cluster-config-operator [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  operator    Start the Cluster Config Operator
  render      Render kubernetes API server bootstrap manifests, secrets and configMaps

Flags:
      --add-dir-header                   If true, adds the file directory to the header of the log messages (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --alsologtostderr                  log to standard error as well as files (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  -h, --help                             help for cluster-config-operator
      --log-backtrace-at traceLocation   when logging hits line file:N, emit a stack trace (default :0) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-dir string                   If non-empty, write log files in this directory (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-file string                  If non-empty, use this log file (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-file-max-size uint           Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-flush-frequency duration     Maximum number of seconds between log flushes (default 5s)
      --logtostderr                      log to standard error instead of files (default true) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --one-output                       If true, only write logs to their native severity level (vs also writing to each lower severity level) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --skip-headers                     If true, avoid header prefixes in the log messages (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --skip-log-headers                 If true, avoid headers when opening log files (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --stderrthreshold severity         logs at or above this threshold go to stderr (default 2) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  -v, --v Level                          number for the log level verbosity
      --version                          version for cluster-config-operator
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging

Use "cluster-config-operator [command] --help" for more information about a command.

Comment 6 errata-xmlrpc 2022-03-10 16:41:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056


Note You need to log in before you can comment on or make changes to this bug.