Skip to content

Conversation

@dafsjr
Copy link
Contributor

@dafsjr dafsjr commented Mar 19, 2023

A code to implement the RFE-3765, I also modified the maxLength of the Syslog section to be the same of the Container section.

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

openshift-ci-robot commented Mar 19, 2023

@dafsjr: This pull request references RFE-3765 which is a valid jira issue.

Details

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.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 19, 2023
@dafsjr dafsjr marked this pull request as ready for review March 19, 2023 15:13
@openshift-ci openshift-ci bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Mar 19, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 19, 2023

Hi @dafsjr. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@openshift-ci openshift-ci bot requested review from lmzuccarelli and miheer March 19, 2023 15:14
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 19, 2023

@dafsjr: This pull request references RFE-3765 which is a valid jira issue.

Details

In response to this:

A code to implement the RFE-3765, I also modified the maxLength of the Syslog section to be the same of the Container section.

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.

1 similar comment
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 19, 2023

@dafsjr: This pull request references RFE-3765 which is a valid jira issue.

Details

In response to this:

A code to implement the RFE-3765, I also modified the maxLength of the Syslog section to be the same of the Container section.

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.

@candita
Copy link
Contributor

candita commented Apr 5, 2023

@dafsjr Thank you for your contribution. This PR requires a change in openshift/api, not just edits in the vendor files. Please make the change in the API and @candita me when you have completed it.

@dafsjr dafsjr changed the title RFE-3765: Allow Ingress to be modified the log length when using a sidecar RFE-3765 - Allow Ingress to Modify the HAProxy Log Length when using a Sidecar Apr 11, 2023
@openshift-ci-robot openshift-ci-robot removed the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 11, 2023
@openshift-ci-robot
Copy link
Contributor

@dafsjr: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

Details

In response to this:

A code to implement the RFE-3765, I also modified the maxLength of the Syslog section to be the same of the Container section.

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.

@dafsjr
Copy link
Contributor Author

dafsjr commented Apr 11, 2023

@candita if I understood correctly, it is done

@candita
Copy link
Contributor

candita commented Apr 11, 2023

@candita if I understood correctly, it is done

@dafsjr I replied to your message in Slack with an example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not need to change the Dockerfile, please revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I do not have access to the images in Dockerfile, I needed to use the origin image to compile.

RouterSyslogFacilityEnvName = "ROUTER_LOG_FACILITY"
RouterSyslogMaxLengthEnvName = "ROUTER_LOG_MAX_LENGTH"

RouterContainerMaxLengthEnvName = "ROUTER_LOG_MAX_LENGTH"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot use the same user-visible value for two different environment variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I tried something different.

@candita
Copy link
Contributor

candita commented Apr 12, 2023

/assign

@candita
Copy link
Contributor

candita commented Apr 24, 2023

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 24, 2023
Destination: operatorv1.LoggingDestination{
Type: operatorv1.ContainerLoggingDestinationType,
Container: &operatorv1.ContainerLoggingDestinationParameters{},
Type: operatorv1.ContainerLoggingDestinationType,
Copy link
Contributor

@candita candita Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add this later, but this section should be to test the default, so don't make these changes here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is for L519, will repost there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it does apply to the addition of MaxLength in this section. This should only be the default, not a changed value in MaxLength.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, understood

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is setting up the default for testing. Don't add MaxLength here.

{"ROUTER_CANONICAL_HOSTNAME", true, "router-" + ic.Name + "." + ic.Status.Domain},
{"ROUTER_LOG_FACILITY", false, ""},
{"ROUTER_LOG_MAX_LENGTH", false, ""},
{"ROUTER_LOG_MAX_LENGTH", true, "8192"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g. don't do this here. Add a new test elsewhere, which tests the change from default to a new value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See TestDeploymentConfigChanged for examples.

@dafsjr
Copy link
Contributor Author

dafsjr commented Apr 27, 2023

/retest-required

@dafsjr
Copy link
Contributor Author

dafsjr commented Apr 27, 2023

/test e2e-aws-ovn-single-node

@dafsjr
Copy link
Contributor Author

dafsjr commented Apr 28, 2023

/test e2e-gcp-operator

@dafsjr
Copy link
Contributor Author

dafsjr commented Apr 28, 2023

/test e2e-aws-ovn-single-node

@dafsjr
Copy link
Contributor Author

dafsjr commented Jul 19, 2023

/retest

@dafsjr
Copy link
Contributor Author

dafsjr commented Jul 19, 2023

/test e2e-aws-operator

maxLength:
default: 1024
description: "maxLength is the maximum length of the syslog message \n If this field is empty, the maxLength is set to \"1024\"."
description: "maxLength is the maximum length of the log message. \n Valid values are integers in the range 480 to 4096, inclusive. \n When omitted, the default value is 1024."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dafsjr why is the maximum different for syslog?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is the same of vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml, it is autogenerated/updated, Miciah asked me to modify the message for syslog too in the PR for openshift/api.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But don't you want the same numeric maximum for syslog and sidecar log?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I understood a total different thing, I will reply in slack

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked with @Miciah and this should be fine.

}).Stream(context.TODO())
if err != nil {
t.Errorf("failed to read logs from pod %s: %v", pod.Name, err)
return false, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be ok to return false, nil here, which would indicate we want to try again until the timer expires. @Miciah or @frobware can you verify?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please log the error with t.Logf instead of t.Errorf, and then return false, nil so that the polling loop retries after logging the error.

data, err := ioutil.ReadAll(readCloser)
if err != nil {
t.Errorf("failed to read logs from pod %s: %v", pod.Name, err)
return false, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, if I'm correct.

Suggested change
return false, err
return false, nil

@candita
Copy link
Contributor

candita commented Jul 19, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 19, 2023
Comment on lines 2409 to 2411
if err := readCloser.Close(); err != nil {
t.Errorf("failed to close logs reader for pod %s: %v", pod.Name, err)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned, please remove this and put in a defer function before starting scanner.Scan, here and in the other function you added.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 19, 2023
@candita
Copy link
Contributor

candita commented Jul 19, 2023

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 19, 2023
@candita
Copy link
Contributor

candita commented Jul 19, 2023

/remove-hold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 19, 2023
@dafsjr
Copy link
Contributor Author

dafsjr commented Jul 20, 2023

/retest

…n using a sidecar.

* pkg/operator/controller/ingress/deployment.go:
  - Changed the name of the var RouterSyslogMaxLengthEnvName to RouterLogMaxLengthEnvName,
    thus the same var is used to Syslog and Container options
  - Added a validation for containerLoggingParameters, if not null, return all the parameters
* pkg/operator/controller/ingress/rsyslog_configmap.go:
  - Added the parameter MaxMessageSize with value of 10k in the configMap generator for rsyslog.conf
* test/e2e/all_test.go:
  - Add tests TestContainerLoggingMaxLength and TestContainerLoggingMinLength
* test/e2e/operator_test.go:
  - Added the functions for the tests TestContainerLoggingMaxLength and TestContainerLoggingMinLength
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: candita

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Jul 20, 2023
@dafsjr
Copy link
Contributor Author

dafsjr commented Jul 20, 2023

/retest

@candita
Copy link
Contributor

candita commented Jul 20, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 20, 2023

@dafsjr: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-ovn 8184bce link false /test e2e-gcp-ovn

Full PR test history. Your PR dashboard.

Details

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.

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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants