-
Notifications
You must be signed in to change notification settings - Fork 30
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
new custom state check #784
Conversation
/test pull-lifecycle-mgr-build |
# Conflicts: # internal/manifest/ready_check.go
# Conflicts: # internal/manifest/ready_check.go
|
internal/manifest/ready_check.go
Outdated
stateResult[stateCheck.MappedState] = stateFromCR == stateCheck.Value | ||
} | ||
} | ||
return calculateFinalState(stateResult), true, 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.
Shouldn't we add some validation in case all the jsonPaths are configured wrong, then the manifest would be in Warning state? because in this case, it will be Processing forever, although there is an error from the user
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 you define the "jsonPaths are configured wrong" a bit more concretely? If you mean the jsonPath can't be found, then it will fail in the stateFromCR, stateExists, err := unstructured.NestedString
.
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.
yes I mean it can't be found. I tried a non-existing path, but the err was still nil here. Only the stateExists is false, and the stateFromCR is "" but no error
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.
ok, good point, that's valid, which means
if !stateExists {
continue
}
should not continue, it's better we indicate user this provided path not exists.
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 decided to check against the manifest CR creation timestamp to know when to put processing or warning state, please check here 2928408#diff-98067b6967c5fe86151bd1d8629e4107ff72feef3ac1a237c4b56e6eb2ad14e0R95-R99
/test pull-lifecycle-mgr-tests |
# Conflicts: # api/v1beta2/operator_annotations.go
/test pull-lifecycle-mgr-build |
1 similar comment
/test pull-lifecycle-mgr-build |
/unhold |
related issue: #196