-
Notifications
You must be signed in to change notification settings - Fork 48
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
Set degraded if nmstate is requested in networkAddonsConfig #1292
Set degraded if nmstate is requested in networkAddonsConfig #1292
Conversation
ce457b8
to
cd824e9
Compare
/hold |
/hold cancel |
289bc4c
to
2752eed
Compare
Hello @tiraboschi @qinqon @RamLavi |
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 think we don't need to check openshift.
reason := "InvalidConfiguration" | ||
message := "NMState deployment is not provided in CNV >= 4.11, please install Kubernetes NMState Operator" | ||
status.eventEmitter.EmitFailingForConfig(reason, message) | ||
conditionsv1.SetStatusConditionNoHeartbeat(&config.Status.Conditions, |
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 should change heartbeat right ? it's not a noop
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.
Right correct
}, | ||
) | ||
config.Status.ObservedVersion = operatorVersion | ||
if status.isRunningOnOpenshift411OrLater() && config.Spec.NMState != nil { |
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.
Maybe we don't need to check openshift at all at the end at this u/s release for wherever is running we will fail on invalid networkaddonsconfig meaning that if they ask for NMState we fail, openshift kubernetes or whatever.
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 thing is, if we don't check OCP 4.11, then we block not only upgrade from CNV 4.10 to 4.11, but also all z-stream upgrades on 4.10
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.
However, we could notify u/s users as you suggest
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 are not backporting this so this code will run only on OCP > 4.10
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.
IIUC, we have to backport this to 4.10. If we didn't backport this a have this code in 4.11, then by the time users upgrade OCP to 4.11 and CNV to 4.11, it's already too late.
} else { | ||
// If successfully deployed all components and is not failing on anything, mark as Available | ||
status.eventEmitter.EmitAvailableForConfig() | ||
conditionsv1.SetStatusConditionNoHeartbeat(&config.Status.Conditions, |
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 should change heratbeat if previous condition was not success, although I don't know if we can check that or if it's worth it.
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.
imo if we don't keep track about the heartbeat anymore then there's no need to update it in any scenario - neither good or bad.
We do have the TransitionTimestamp (when the status last changed value) which might be enough, no?
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.
Ah, so we don't want to update it in #1292 (comment) either, correct?
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.
Then feels like heartbeat is kind of obsolete and replaced by TransitionTimestamp ?
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.
[fixing the name of TransitionTimestamp
- exact name is LastTransitionTime
)
So, it doesn't replace LastTransitionTime
because LastTransitionTime
is already on the original SetStatusCondition()
function.
heartbeat is no longer published on CNAO. This is because it also causes a resourceVersion change (every 1 minute) and that triggers a repeating reconcile on HCO.
As a result, we decided to move to SetStatusConditionNoHeartbeat
on main and release-0.65 branches.
HCO will reconcile and see that the NAC status is degraded and in turn set it's status upgradeable to false. That will block upgrade until user installs KNO Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com>
2752eed
to
e436a2a
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qinqon 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 |
…evirt#1292)" This reverts commit 575bdd5.
…evirt#1292)" This reverts commit 575bdd5. Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com>
What this PR does / why we need it:
This PR aims to block upgrade if still using CNAO to deploy nmstate by Setting NetworkAddonsConfig Degraded Status to true.
HCO will reconcile it and see that the NAC status is degraded, consequently it will set it's status upgradeable to false.
See HCO: https://github.com/kubevirt/hyperconverged-cluster-operator/blob/main/controllers/hyperconverged/hyperconverged_controller.go#L740
That will block upgrade until user installs KNO (Kubernetes Nmstate Operator).
Special notes for your reviewer:
HCO change:
Release note: