-
Notifications
You must be signed in to change notification settings - Fork 141
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
LOG-5062: align validation with documentation #2394
Conversation
@vparfonov: This pull request references LOG-5062 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.8.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/hold |
if spec.Forwarder != nil || spec.LogStore != nil || spec.Curation != nil || spec.Visualization != nil { | ||
return errors.NewValidationError("Only spec.collection is allowed when using multiple instances of ClusterLogForwarder: %s/%s", cl.Namespace, cl.Name) | ||
key := types.NamespacedName{Name: cl.Name, Namespace: cl.Namespace} | ||
clf := runtime.NewClusterLogForwarder(cl.Namespace, cl.Name) |
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 don't think this needs to be anything other then "&logging.ClusterLogForwarder{}" since the "get" will fill in all the pieces if it is found using the key
clf := runtime.NewClusterLogForwarder(cl.Namespace, cl.Name) | ||
if err := k8sClient.Get(context.TODO(), key, clf); err != nil { | ||
if apierrors.IsNotFound(err) { | ||
return errors.NewValidationError("ClusterLogForwarder: %s/%s instance not found, ClusterLogging object in %q not named %q also "+ |
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 based upon my first comment. As-is the message is really long and difficult to understand
internal/validations/clusterlogging/validate_clusterlogging_spec_test.go
Outdated
Show resolved
Hide resolved
089c68e
to
feb1974
Compare
/test functional |
/retest |
clf := &v1.ClusterLogForwarder{} | ||
if err := k8sClient.Get(context.TODO(), key, clf); err != nil { | ||
if apierrors.IsNotFound(err) { | ||
return errors.NewValidationError("ClusterLogging: %s/%s instance requires to have a ClusterLogForwarder deployed in the same namespace named the same", cl.Namespace, cl.Name) |
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 consider a custom error message depending upon the usecase; and CLF is not always required
- CL(openshift-logging/instance) only - This is a valid LEGACY usecase
- CL(openshift-logging/instance) & CLF(openshift-logging/instance) - This is a valid LEGACY usecase
- CL(ANY_NS/OTHER) - This is an invalid usecase
- CLF(ANY_NS/ANY_NAME) - This is a valid mCLF usecase
- CL(ANY_NS/ANY_NAME) && CLF(ANY_NS/ANY_NAME) - This is a valid mCLF usecase
ANY_NAME is any name other then "instance" in "openshift-logging"
It looks like this still does not support the expected outcome for #1. It may make more sense to refactor the method to try to load CLF first and then use a switch depending upon the outcome and ns/name combination:
clf, err := k8sClient.Get(NS, Name)
switch: {
case legacy CL only:
case legacy CL and CLF:
case mclf CL only:
case mclf CLF only:
case mCLF CLF and CL:
}
internal/validations/clusterlogging/validate_clusterlogging_spec_test.go
Show resolved
Hide resolved
/retest |
/test e2e-target |
1 similar comment
/test e2e-target |
/retest |
/test e2e-target |
1 similar comment
/test e2e-target |
internal/validations/clusterlogging/validate_clusterlogging_spec_test.go
Outdated
Show resolved
Hide resolved
@vparfonov one nit but we will keep this on hold until after the release |
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
/approve |
/test ci/prow/e2e-target |
@jcantrill: The specified target(s) for
The following commands are available to trigger optional jobs:
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test e2e-target |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcantrill, vparfonov 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 |
/retest |
/hold cancel |
/cherrypick release-5.9 |
@jcantrill: once the present PR merges, I will cherry-pick it on top of release-5.9 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
1 similar comment
/retest |
@vparfonov: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
Manually merging. job was retired after PR was created |
@jcantrill: new pull request created: #2437 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Description
This PR address to align validation feature with current documentation. During validation for
ClusterLogging
we will check isClusterLogForwarder
in the same namespace named the same exist if not, exception will throw./cc @cahartma @Clee2691
/assign @jcantrill
/cherry-pick
Links