Skip to content

Manual backport of #2905 into release/1.1.x#2924

Merged
Ganeshrockz merged 3 commits intorelease/1.1.xfrom
backport/net-5513/release-1.1.x
Sep 8, 2023
Merged

Manual backport of #2905 into release/1.1.x#2924
Ganeshrockz merged 3 commits intorelease/1.1.xfrom
backport/net-5513/release-1.1.x

Conversation

@Ganeshrockz
Copy link
Copy Markdown
Contributor

Backport

This PR is manually backported from the #2905 and raised against 1.1.x.

The below text is copied from the body of the original PR.


Changes proposed in this PR:

  • Fixes a bug in parsing the following audit log helm configuration
server:
  auditLogs:
      enabled: true
      sinks:
        - name: My Sink
          type: file
          format: json
          path: /tmp/audit.json
          delivery_guarantee: best-effort
          rotate_duration: 24h
          rotate_max_files: 15
          rotate_bytes: 25165824

where rotate_max_files and rotate_bytes get passed as string inputs to the server configuration file. This PR makes sure to perform special handling for rotate_max_files and rotate_bytes where they don't get passed with quotes.

Generated config (Before the fix)

    {
      "audit": {
        "enabled": true,
        "sink": {
          "MySink": {
              "delivery_guarantee": "best-effort",
              "format": "json",
              "path": "/tmp/audit.json",
              "rotate_bytes": "12455355", // note the presence of braces here
              "rotate_duration": "24h",
              "rotate_max_files": "20",
              "type": "file"
          }
        }
      }
    }

Generated config (After the fix)

    {
      "audit": {
        "enabled": true,
        "sink": {
          "MySink": {
              "delivery_guarantee": "best-effort",
              "format": "json",
              "path": "/tmp/audit.json",
              "rotate_bytes": 12455355, // note the absence of braces here
              "rotate_duration": "24h",
              "rotate_max_files": 20,
              "type": "file"
          }
        }
      }
    }

How I've tested this PR:

  1. CI
  2. Verified manually that the server no longer crashes with this issue.

How I expect reviewers to test this PR:

👀

Checklist:


@Ganeshrockz Ganeshrockz added the pr/no-backport signals that a PR will not contain a backport label label Sep 8, 2023
@Ganeshrockz Ganeshrockz merged commit a1f4916 into release/1.1.x Sep 8, 2023
@Ganeshrockz Ganeshrockz deleted the backport/net-5513/release-1.1.x branch September 8, 2023 09:36
@Ganeshrockz Ganeshrockz added the consul-india PRs/Issues assigned to Consul India team label Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consul-india PRs/Issues assigned to Consul India team pr/no-backport signals that a PR will not contain a backport label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants