Skip to content
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-3948: [Vector] No error message shown on collector pods when the syslog output url is wrong in CLF #1954

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

syedriko
Copy link
Contributor

@syedriko syedriko commented Apr 14, 2023

Description

Before this PR, when vector forwarded logs to a syslog endpoint, the scheme of the endpoint URL defaulted to 'tcp' (including 'tls') unless it was 'udp'. No error was produced for an invalid URL scheme.
With this PR, a URL scheme that is not 'tcp', 'tls' or 'udp', results in the status of the corresponding ClusterLogForwarder output set to False with an error message:

apiVersion: logging.openshift.io/v1
kind: ClusterLogForwarder
metadata:
  name: instance
  namespace: openshift-logging
spec:
  outputs:
  - name: rsyslog
    syslog:
      facility: local0
      rfc: RFC5424
      severity: informational
    type: syslog
    url: xyz://rsyslogd.syslog.svc.cluster.local:24224
...
status:
  outputs:
    rsyslog:
    - lastTransitionTime: "2023-04-14T21:27:26Z"
      message: 'invalid URL scheme: xyz'
      reason: Invalid
      status: "False"
      type: Ready

/cc @cahartma
/assign @jcantrill

Links

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 14, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 14, 2023

@syedriko: This pull request references LOG-3948 which is a valid jira issue.

In response to this:

Description

Before this PR, when vector forwarded logs to a syslog endpoint, the scheme of the endpoint URL defaulted to 'tcp' (including 'tls') unless it was 'udp'. No error was produced for an invalid URL scheme.
This PR changes this so that the URL scheme is passed on to vector, unless it is 'tls', which is mapped to 'tcp'.
For an invalid scheme, vector now refuses to start, with an error message like this:

2023-04-14T19:22:36.455964Z ERROR vector::cli: Configuration error. error=unknown variant `xyz`, expected one of `tcp`, `udp`, `unix` for key `sinks.rsyslog`

/cc @cahartma
/assign @jcantrill

Links

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.

@jcantrill
Copy link
Contributor

Please add a validation so users get an earlier failure then a pod collector not starting. Ref: https://github.com/openshift/cluster-logging-operator/blob/master/internal/validations/clusterlogforwarder/validate_clusterlogforwarderspec.go#L255

@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 14, 2023

@syedriko: This pull request references LOG-3948 which is a valid jira issue.

In response to this:

Description

Before this PR, when vector forwarded logs to a syslog endpoint, the scheme of the endpoint URL defaulted to 'tcp' (including 'tls') unless it was 'udp'. No error was produced for an invalid URL scheme.
With this PR, a URL scheme that is not 'tcp', 'tls' or 'udp', results in the status of the corresponding ClusterLogForwarder output set to False with an error message:

apiVersion: logging.openshift.io/v1
kind: ClusterLogForwarder
metadata:
 name: instance
 namespace: openshift-logging
spec:
 outputs:
 - name: rsyslog
   syslog:
     facility: local0
     rfc: RFC5424
     severity: informational
   type: syslog
   url: xyz://rsyslogd.syslog.svc.cluster.local:24224
...
status:
 outputs:
   rsyslog:
   - lastTransitionTime: "2023-04-14T21:27:26Z"
     message: 'invalid URL scheme: xyz'
     reason: Invalid
     status: "False"
     type: Ready

/cc @cahartma
/assign @jcantrill

Links

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.

@jcantrill
Copy link
Contributor

/hold
/approve

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 17, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcantrill, syedriko

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 17, 2023
@jcantrill
Copy link
Contributor

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 17, 2023

@syedriko: all tests passed!

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.

@jcantrill
Copy link
Contributor

/hold cancel
/lgtm

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Apr 17, 2023
@jcantrill
Copy link
Contributor

/lgtm

@openshift-merge-robot openshift-merge-robot merged commit 90fa2f7 into openshift:master Apr 17, 2023
@syedriko syedriko deleted the syedriko-log-3948 branch April 17, 2023 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. release/5.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants