-
Notifications
You must be signed in to change notification settings - Fork 47
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
refactor: add default update and status functions #544
Conversation
Added default update and status functions for most resources that are reconciled by the operator. Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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
|
||
case *core.Service: | ||
foundService := foundObj.(*core.Service) | ||
// ClusterIP should not be updated |
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.
What does this mean?
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 ClusterIP
field is set be the API server and is immutable. The problem is that newObj
does not have the ClusterIP
set, so if we would simply set the sepc:
foundObj.spec = newObj.spec
it would set ClusterIP
to nil
, and the update would fail.
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.
ACK
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 0xFelix The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
lgtm (not adding /, for awareness of Ben) |
foundObj.(*promv1.ServiceMonitor).Spec = newTyped.Spec | ||
|
||
default: | ||
panic(fmt.Sprintf("Default update is not supported for type: %T", newObj)) |
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'll need to add also pipeline.Task
and pipeline.Pipeline
after your PR is merged, right?
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
What this PR does / why we need it:
Added default update and status functions for most resources that are reconciled by the operator.
Release note: