Skip to content

Conversation

@ricardomaraschini
Copy link
Contributor

Creates a property on image registry configuration to hold operator
specific customization. With these extra options we can keep track of
different log levels for the operator and operand.

@ricardomaraschini ricardomaraschini changed the title Add OperatorSpec object to image registry config Bug 1808118: Add OperatorSpec object to image registry config May 5, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels May 5, 2020
@openshift-ci-robot
Copy link

@ricardomaraschini: This pull request references Bugzilla bug 1808118, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
Details

In response to this:

Bug 1808118: Add OperatorSpec object to image registry config

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ricardomaraschini
Copy link
Contributor Author

/assign @dmage @adambkaplan @deads2k

@dmage
Copy link
Contributor

dmage commented May 7, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 7, 2020
// logging determines the level of logging enabled in the registry.
LogLevel int64 `json:"logging" protobuf:"varint,11,opt,name=logging"`
// +optional
Logging int64 `json:"logging,omitempty" protobuf:"varint,11,opt,name=logging"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ricardomaraschini @dmage is this now a deprecated field, or will it be used to independently set the logging for the registry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For backwards compatibility the idea is to take this field into account if logLevel is not set. If both are set, use the "bigger" one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ricardomaraschini this approach IMO is confusing to admins - we need one field to be the source of truth. I would rather have the following:

  1. If logLevel > 0, use that and ignore logging.
  2. If logLevel == 0 and logging > 0, write the logging value to logLevel in the spec and proceed.

Because our APIs are forever, we will never remove the logging field. Therefore the operator should do the migration on the admin's behalf.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can say that logging is deprecated and logLevel is a preferred field.

Based on the discussion on Slack:

. logLevel is not set logLevel is set
logging is not set Normal (info) log level logLevel is honored
logging is set logging is honored if logging is error or warning, logging is honored (as these values cannot be represented by logLevel), otherwise logLevel is honored

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note informing that logging is deprecated and asking to use logLevel instead.

I agree with @adambkaplan and we should automatically migrate values from logging into logLevel when a conversion 1:1 is possible. The problem stated by @dmage is valid, we don't know if or how many customers are using error or warning, hopefully we will in the future(openshift/insights-operator#103).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deads2k @adambkaplan @dmage

There is not much I can do on this side as the migration path will happen on a PR against the Operator. Here we added new a field and tagged the old one as deprecated, nitty-gritty details on migrations should be discussed when a PR comes alive on controller's side.

Could we get this approved/merged?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deads2k @adambkaplan

The logging field is not an optional today, so it's always set. It can be set to

  • 0 (log only errors)
  • 1 (warning)
  • 2, 3 (info)
  • anything else (debug)

The normal log level is 2.

I wouldn't say that 0 is a proper value, because one may forget to set logging in their configuration object and expect the operator to use the default log level.

What are cons of the approach "when logLevel is set, use it, otherwise fallback to logging"?

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 12, 2020
@ricardomaraschini
Copy link
Contributor Author

/retest

@ricardomaraschini
Copy link
Contributor Author

@adambkaplan @dmage
Work to migrate Logging to LogLevel will be done through the following PR openshift/cluster-image-registry-operator#559

LogLevel int64 `json:"logging" protobuf:"varint,11,opt,name=logging"`
// logging is deprecated, use logLevel instead.
// +optional
Logging *int64 `json:"logging,omitempty" protobuf:"varint,11,opt,name=logging"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK we cannot change int64 -> *int64, but I'd like to get an input from @adambkaplan

Copy link
Contributor Author

@ricardomaraschini ricardomaraschini May 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This relates to #640 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. In normal circumstances this would be a breaking change, but in our case it is not.

In the golang code we are introducing the new field Logging, so technically this is not a breaking (golang) API change.

For the JSON API, we are converting a field from required -> optional, which I believe is a non-breaking change. However, not setting anything implies a default of 0, so we need to respect that in our migration code:

  1. logLevel = 0, logging = nil -> logs should use -v 0
  2. logLevel = 0, logging = <non-nil> -> logs should use -v <non-nil>.
  3. logLevel = <non-zero> -> logs should use -v <non-zero>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make this omitempty, but you can't change the type. @adambkaplan had similar discussion when working on #563 with @deads2k

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adambkaplan
Copy link
Contributor

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot removed the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 26, 2020
@openshift-ci-robot
Copy link

@adambkaplan: This pull request references Bugzilla bug 1808118, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "4.6.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label May 26, 2020
Copy link
Contributor

@adambkaplan adambkaplan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Note that we have pushed this bug fix to 4.6. The level of API changes makes this change potentially risky to include in the 4.5 release.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 26, 2020
@openshift-bot
Copy link

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci-robot
Copy link

@openshift-bot: This pull request references Bugzilla bug 1808118, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "4.6.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-bot
Copy link

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci-robot
Copy link

@openshift-bot: This pull request references Bugzilla bug 1808118, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "4.6.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 25, 2020
@ricardomaraschini
Copy link
Contributor Author

@soltysh Updated to remove the pointer and bring back the int64

@ricardomaraschini
Copy link
Contributor Author

/hold

still need to finish rebasing

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 3, 2020
@ricardomaraschini
Copy link
Contributor Author

@soltysh Could I use your pair of eyes on this one?

@ricardomaraschini
Copy link
Contributor Author

/unhold

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 4, 2020
@ricardomaraschini
Copy link
Contributor Author

@dmage @adambkaplan @soltysh Is there something holding this up? Could we get it in?

@dmage
Copy link
Contributor

dmage commented Aug 20, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2020
@dmage
Copy link
Contributor

dmage commented Aug 20, 2020

/assign @soltysh

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 24, 2020
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@ricardomaraschini
Copy link
Contributor Author

/retest

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 24, 2020
Creates a property on image registry configuration to hold operator
specific customization. With these extra options we can keep track of
different log levels for the operator and operand.
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 24, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adambkaplan, dmage, ricardomaraschini, soltysh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 8625127 into openshift:master Aug 24, 2020
@openshift-ci-robot
Copy link

@ricardomaraschini: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Bugzilla bug in order for it to move to the next state.

Bugzilla bug 1808118 has not been moved to the MODIFIED state.

Details

In response to this:

Bug 1808118: Add OperatorSpec object to image registry config

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants