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

Display nicely Networks (CIDR) in runtime configuration #6029

Merged
merged 2 commits into from
Jul 23, 2019

Conversation

pierresouchay
Copy link
Contributor

@pierresouchay pierresouchay commented Jun 26, 2019

CIDR mask is displayed in binary in configuration.
This add support for nicely displaying CIDR in runtime configuration.

Currently, if a configuration contains the following lines:

  "http_config": {
    "allow_write_http_from": [
      "127.0.0.0/8",
      "::1/128"
    ]
  }

A call to /v1/agent/self?pretty would display

  "AllowWriteHTTPFrom": [
            {
                "IP": "127.0.0.0",
                "Mask": "/wAAAA=="
            },
            {
                "IP": "::1",
                "Mask": "/////////////////////w=="
            }
  ]

This PR fixes it and it will now display:

   "AllowWriteHTTPFrom": [ "127.0.0.0/8", "::1/128" ]

CIDR mask is displayed in binary in configuration.
This add support for nicely displaying CIDR in runtime configuration.

Currently, if a configuration contains the following lines:

  "http_config": {
    "allow_write_http_from": [
      "127.0.0.0/8",
      "::1/128"
    ]
  }

A call to `/v1/agent/self?pretty` would display

  "AllowWriteHTTPFrom": [
            {
                "IP": "127.0.0.0",
                "Mask": "/wAAAA=="
            },
            {
                "IP": "::1",
                "Mask": "/////////////////////w=="
            }
  ]

This PR fixes it and it will now display:

   "AllowWriteHTTPFrom": [ "127.0.0.0/8", "::1/128" ]
@pierresouchay
Copy link
Contributor Author

Note: it will also benefit to #5916 once hashicorp/memberlist#196 is merged (cc @mkeeler)

Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

I like this, could you add data into TestSanitize to validate this functionality

@pierresouchay
Copy link
Contributor Author

@mkeeler DONE

Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

Thanks a lot @pierresouchay

@mkeeler mkeeler added this to the 1.6.0 milestone Jun 28, 2019
@pierresouchay
Copy link
Contributor Author

damned unstable tests

@mkeeler
Copy link
Member

mkeeler commented Jun 28, 2019

One day our test suite will run reliably. Its been improving for sure but we aren't quite there yet.

@pearkes pearkes modified the milestones: 1.6.0-beta1, 1.6.0-beta2 Jul 5, 2019
@pearkes pearkes modified the milestones: 1.6.0-beta2, 1.6.0-beta3 Jul 12, 2019
@mkeeler mkeeler changed the base branch from master to release/1-6 July 23, 2019 20:29
@mkeeler mkeeler merged commit b4590fb into hashicorp:release/1-6 Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants