-
Notifications
You must be signed in to change notification settings - Fork 584
Bug 1808118: Add OperatorSpec object to image registry config #640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1808118: Add OperatorSpec object to image registry config #640
Conversation
|
@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
DetailsIn response to this:
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. |
|
/assign @dmage @adambkaplan @deads2k |
|
/lgtm |
imageregistry/v1/types.go
Outdated
| // 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"` |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
- If
logLevel> 0, use that and ignorelogging. - If
logLevel== 0 andlogging> 0, write theloggingvalue tologLevelin 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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"?
|
/retest |
|
@adambkaplan @dmage |
imageregistry/v1/types.go
Outdated
| 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"` |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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:
logLevel = 0,logging = nil-> logs should use-v 0logLevel = 0,logging = <non-nil>-> logs should use-v <non-nil>.logLevel = <non-zero>-> logs should use-v <non-zero>
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I brought back the int64. Migration path will look like openshift/cluster-image-registry-operator@f2d81ee#diff-e3147933b179a3ade1d900049f1fa55bL26-R39
|
/bugzilla refresh |
|
@adambkaplan: This pull request references Bugzilla bug 1808118, which is invalid:
Comment DetailsIn response to this:
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. |
adambkaplan
left a comment
There was a problem hiding this 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.
|
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
|
@openshift-bot: This pull request references Bugzilla bug 1808118, which is invalid:
Comment DetailsIn response to this:
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. |
|
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
|
@openshift-bot: This pull request references Bugzilla bug 1808118, which is invalid:
Comment DetailsIn response to this:
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. |
|
@soltysh Updated to remove the pointer and bring back the int64 |
|
/hold still need to finish rebasing |
|
@soltysh Could I use your pair of eyes on this one? |
|
/unhold |
|
@dmage @adambkaplan @soltysh Is there something holding this up? Could we get it in? |
|
/lgtm |
|
/assign @soltysh |
soltysh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
|
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
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.
soltysh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@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. DetailsIn response to this:
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. |
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.