-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: add svc export trackability #1061
base: main
Are you sure you want to change the base?
Conversation
87efd16
to
e49aff2
Compare
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 be separated into two PRs, one just for upgrade controller runtime and the other for serviceExport check
upgrade controller runtime changes are addressed in #1067 (will need to be merged before this) |
9b3574b
to
593b6b3
Compare
593b6b3
to
c47b06c
Compare
74d71eb
to
6b43ca2
Compare
|
||
weight, err := objectmeta.ExtractWeightFromServiceExport(&svcExport) | ||
if err != nil { | ||
klog.V(2).InfoS("ServiceExport has invalid weight", "serviceExport", svcExportObj, "error", err) |
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.
klog.V(2).InfoS("ServiceExport has invalid weight", "serviceExport", svcExportObj, "error", err) | |
klog.Errorf(err, "ServiceExport has invalid weight", "serviceExport", svcExportObj) |
weight, err := objectmeta.ExtractWeightFromServiceExport(&svcExport) | ||
if err != nil { | ||
klog.V(2).InfoS("ServiceExport has invalid weight", "serviceExport", svcExportObj, "error", err) | ||
return ManifestProcessingAvailabilityResultTypeFailed, err |
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.
return ManifestProcessingAvailabilityResultTypeFailed, err | |
return ManifestProcessingAvailabilityResultTypeNotYetAvailable, err |
ManifestProcessingAvailabilityResultTypeFailed means the checking the availability itself is failed.
return ManifestProcessingAvailabilityResultTypeNotYetAvailable, nil | ||
} | ||
|
||
weight := svcExport.Annotations[objectmeta.ServiceExportAnnotationWeight] | ||
if weight != "0" { | ||
weight, err := objectmeta.ExtractWeightFromServiceExport(&svcExport) |
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.
could you please add a comment here to indicate why we check the annotation here?
eg,
"Updating the annotation won't change the object generation, so the current status is not reliable and we validate the annotation again here."
Name: "test-svcExport", | ||
Namespace: nsName, | ||
Annotations: map[string]string{}, | ||
Generation: 3, | ||
}, | ||
} | ||
|
||
testCases := []struct { |
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.
add a test if the weight annotation is invalid
Description of your changes
Fixes #
I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer