-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Propagate configuration/route conditions to KFService status object #145
Conversation
/retest |
@ellis-bigelow @cliveseldon @rakelkar This is ready to review. |
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.
Really cool Dan.
I was talking to the knative folks about knative/pkg. They were talking about how controller-runtime was not good enough to meet their needs which caused them to invent many of the utilities in knative/pkg. They described it as solving day-2 problems for writing controllers vs controller-runtime solving day-1 problems (i.e. getting something working ASAP). Ideally, this would be in a separate repo someday.
What do you think about holding off on this until the refactor is in. There's a little bit of collide, and I think that PR is probably closer.
// default configuration have reported readiness. | ||
ServiceConditionDefaultConfigurationsReady duckv1alpha1.ConditionType = "DefaultConfigurationReady" | ||
KFServiceConditionDefaultConfigurationsReady apis.ConditionType = "DefaultConfigurationReady" |
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 this should just be "DefaultReady" for the same reason about exposing knative configurations through our api.
How do you feel about two for now:
"DefaultReady"
"DefaultPredictorReady"
Each of the components will need to ready up and they can rollup.
// ServiceConditionCanaryConfigurationsReady is set when the service's underlying | ||
// canary configuration have reported readiness. | ||
ServiceConditionCanaryConfigurationsReady duckv1alpha1.ConditionType = "CanaryConfigurationReady" | ||
KFServiceConditionCanaryConfigurationsReady apis.ConditionType = "CanaryConfigurationReady" |
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.
likewise.
@@ -155,10 +155,12 @@ func (r *ReconcileService) Reconcile(request reconcile.Request) (reconcile.Resul | |||
configurationReconciler := knative.NewConfigurationReconciler(r.Client) | |||
routeReconciler := knative.NewRouteReconciler(r.Client) | |||
|
|||
// Initialize conditions | |||
kfsvc.Status.InitializeConditions() |
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 exactly is this doing? Setting them all to unknown? Why is this necessary to setup?
hmm, can you point me to the PR ? I was expecting these utilities exist in |
/retest |
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.
Awesome. LGTM, couple of tiny nits to simplify the code. Ready to LGTM/Approve right afterwards.
func (ss *KFServiceStatus) PropagateDefaultConfigurationStatus(defaultConfigurationStatus *knservingv1alpha1.ConfigurationStatus) { | ||
ss.Default.Name = defaultConfigurationStatus.LatestCreatedRevisionName | ||
configurationCondition := defaultConfigurationStatus.GetCondition(knservingv1alpha1.ConfigurationConditionReady) | ||
if configurationCondition == 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.
Can this go in the switch?
func (ss *KFServiceStatus) PropagateCanaryConfigurationStatus(canaryConfigurationStatus *knservingv1alpha1.ConfigurationStatus) { | ||
ss.Canary.Name = canaryConfigurationStatus.LatestCreatedRevisionName | ||
configurationCondition := canaryConfigurationStatus.GetCondition(knservingv1alpha1.ConfigurationConditionReady) | ||
if configurationCondition == 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.
Likewise.
@@ -65,5 +103,16 @@ func (ss *KFServiceStatus) PropagateRouteStatus(rs *knservingv1alpha1.RouteStatu | |||
} | |||
} | |||
|
|||
//TODO @yuzisun populate route status conditions | |||
rc := rs.GetCondition(knservingv1alpha1.RouteConditionReady) |
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.
And here
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ellis-bigelow 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 |
…serve#145) * Populate conditions on status object * Fix memory limit * Add conditions test * Address review comments * Fix test * Move nil check to switch statement
Includes resolution of etcd client vulnerability CVE-2018-1099 Note that we are keeping the Kubernetes libraries at 22.x level since there's now a transitive dependency on knative via the main kserve libraries and that's incompatible with Kube >= 23.0. Signed-off-by: Nick Hill <nickhill@us.ibm.com> Signed-off-by: Nick Hill <nickhill@us.ibm.com>
What this PR does / why we need it:
Populate following conditions on status object for
KFServiceReady condition is depending on
DefaultConfiguationReady
andRouteReady
conditions.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #113
Special notes for your reviewer:
VolatileTime
in place ofmetav1.Time
to exclude this from creatingequality.Semantic
difference when comparing status object, the side effect of this is that when updating status object I'am getting an errorstatus.conditions.lastTransitionTime in body must be of type object: "string"
becauselastTransitionTime
is now of typeobject
. I have chatted with kube builder guys, they suggested using marker+kubebuilder:validation:Type=string
which is supported incontroller-runtime
2.0, but we are still on 1.9.0 due to knative dep. For now I have walked around the issue by patching the generated crd with string type forlastTransitionTime
.Release note:
This change is