Merge pull request #10560 from jkirschner-hashicorp/change-sane-to-reasonable

Replace use of 'sane' where appropriate
This commit is contained in:
jkirschner-hashicorp 2021-07-06 11:46:04 -04:00 committed by GitHub
commit 31bbab8ae7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 33 additions and 33 deletions

View File

@ -1603,7 +1603,7 @@ BUG FIXES:
* dns: Ensure that only 1 CNAME is returned when querying for services that have non-IP service addresses. [[PR-4328](https://github.com/hashicorp/consul/pull/4328)] * dns: Ensure that only 1 CNAME is returned when querying for services that have non-IP service addresses. [[PR-4328](https://github.com/hashicorp/consul/pull/4328)]
* api: Fixed issue where `Lock` and `Semaphore` would return earlier than their requested timeout when unable to acquire the lock. [[GH-4003](https://github.com/hashicorp/consul/issues/4003)], [[GH-3262](https://github.com/hashicorp/consul/issues/3262)], [[GH-2399](https://github.com/hashicorp/consul/issues/2399)] * api: Fixed issue where `Lock` and `Semaphore` would return earlier than their requested timeout when unable to acquire the lock. [[GH-4003](https://github.com/hashicorp/consul/issues/4003)], [[GH-3262](https://github.com/hashicorp/consul/issues/3262)], [[GH-2399](https://github.com/hashicorp/consul/issues/2399)]
* watch: Fix issue with HTTPs only agents not executing watches properly [[GH-4358](https://github.com/hashicorp/consul/issues/4358)] * watch: Fix issue with HTTPs only agents not executing watches properly [[GH-4358](https://github.com/hashicorp/consul/issues/4358)]
* agent: Managed proxies that bind to 0.0.0.0 now get a health check on a sane IP [[GH-4301](https://github.com/hashicorp/consul/issues/4301)] * agent: Managed proxies that bind to 0.0.0.0 now get a health check on a reasonable IP [[GH-4301](https://github.com/hashicorp/consul/issues/4301)]
* server: (Consul Enterprise) Fixed an issue causing Consul to panic when network areas were used * server: (Consul Enterprise) Fixed an issue causing Consul to panic when network areas were used
* license: (Consul Enterprise) Fixed an issue causing the snapshot agent to log erroneous licensing errors * license: (Consul Enterprise) Fixed an issue causing the snapshot agent to log erroneous licensing errors

View File

@ -53,7 +53,7 @@ func ParseCertURI(input *url.URL) (CertURI, error) {
// Test for service IDs // Test for service IDs
if v := spiffeIDServiceRegexp.FindStringSubmatch(path); v != nil { if v := spiffeIDServiceRegexp.FindStringSubmatch(path); v != nil {
// Determine the values. We assume they're sane to save cycles, // Determine the values. We assume they're reasonable to save cycles,
// but if the raw path is not empty that means that something is // but if the raw path is not empty that means that something is
// URL encoded so we go to the slow path. // URL encoded so we go to the slow path.
ap := v[1] ap := v[1]
@ -84,7 +84,7 @@ func ParseCertURI(input *url.URL) (CertURI, error) {
Service: service, Service: service,
}, nil }, nil
} else if v := spiffeIDAgentRegexp.FindStringSubmatch(path); v != nil { } else if v := spiffeIDAgentRegexp.FindStringSubmatch(path); v != nil {
// Determine the values. We assume they're sane to save cycles, // Determine the values. We assume they're reasonable to save cycles,
// but if the raw path is not empty that means that something is // but if the raw path is not empty that means that something is
// URL encoded so we go to the slow path. // URL encoded so we go to the slow path.
ap := v[1] ap := v[1]

View File

@ -4371,7 +4371,7 @@ func TestACLEndpoint_SecureIntroEndpoints_OnlyCreateLocalData(t *testing.T) {
}) })
// We delay until now to setup an auth method and binding rule in the // We delay until now to setup an auth method and binding rule in the
// primary so our earlier listing tests were sane. We need to be able to // primary so our earlier listing tests were reasonable. We need to be able to
// use auth methods in both datacenters in order to verify Logout is // use auth methods in both datacenters in order to verify Logout is
// properly scoped. // properly scoped.
t.Run("initialize primary so we can test logout", func(t *testing.T) { t.Run("initialize primary so we can test logout", func(t *testing.T) {

View File

@ -47,7 +47,7 @@ type aclTypeReplicator interface {
FetchLocal(srv *Server) (int, uint64, error) FetchLocal(srv *Server) (int, uint64, error)
// SortState sorts the internal working state output of FetchRemote and // SortState sorts the internal working state output of FetchRemote and
// FetchLocal so that a sane diff can be performed. // FetchLocal so that a reasonable diff can be performed.
SortState() (lenLocal, lenRemote int) SortState() (lenLocal, lenRemote int)
// LocalMeta allows for type-agnostic metadata from the sorted local state // LocalMeta allows for type-agnostic metadata from the sorted local state

View File

@ -36,7 +36,7 @@ type Validator interface {
NewIdentity() *Identity NewIdentity() *Identity
// ValidateLogin takes raw user-provided auth method metadata and ensures // ValidateLogin takes raw user-provided auth method metadata and ensures
// it is sane, provably correct, and currently valid. Relevant identifying // it is reasonable, provably correct, and currently valid. Relevant identifying
// data is extracted and returned for immediate use by the role binding // data is extracted and returned for immediate use by the role binding
// process. // process.
// //

View File

@ -120,7 +120,7 @@ func (v *Validator) Name() string { return v.name }
func (v *Validator) Stop() {} func (v *Validator) Stop() {}
// ValidateLogin takes raw user-provided auth method metadata and ensures it is // ValidateLogin takes raw user-provided auth method metadata and ensures it is
// sane, provably correct, and currently valid. Relevant identifying data is // reasonable, provably correct, and currently valid. Relevant identifying data is
// extracted and returned for immediate use by the role binding process. // extracted and returned for immediate use by the role binding process.
// //
// Depending upon the method, it may make sense to use these calls to continue // Depending upon the method, it may make sense to use these calls to continue

View File

@ -705,7 +705,7 @@ func (c *compiler) getSplitterNode(sid structs.ServiceID) (*structs.DiscoveryGra
} }
// If we record this exists before recursing down it will short-circuit // If we record this exists before recursing down it will short-circuit
// sanely if there is some sort of graph loop below. // reasonably if there is some sort of graph loop below.
c.recordNode(splitNode) c.recordNode(splitNode)
var hasLB bool var hasLB bool
@ -941,7 +941,7 @@ RESOLVE_AGAIN:
} }
// If we record this exists before recursing down it will short-circuit // If we record this exists before recursing down it will short-circuit
// sanely if there is some sort of graph loop below. // reasonably if there is some sort of graph loop below.
c.recordNode(node) c.recordNode(node)
if len(resolver.Failover) > 0 { if len(resolver.Failover) > 0 {

View File

@ -1002,7 +1002,7 @@ func (s *Server) Leave() error {
// If we are the current leader, and we have any other peers (cluster has multiple // If we are the current leader, and we have any other peers (cluster has multiple
// servers), we should do a RemoveServer/RemovePeer to safely reduce the quorum size. // servers), we should do a RemoveServer/RemovePeer to safely reduce the quorum size.
// If we are not the leader, then we should issue our leave intention and wait to be // If we are not the leader, then we should issue our leave intention and wait to be
// removed for some sane period of time. // removed for some reasonable period of time.
isLeader := s.IsLeader() isLeader := s.IsLeader()
if isLeader && numPeers > 1 { if isLeader && numPeers > 1 {
if err := s.autopilot.RemoveServer(raft.ServerID(s.config.NodeID)); err != nil { if err := s.autopilot.RemoveServer(raft.ServerID(s.config.NodeID)); err != nil {
@ -1265,7 +1265,7 @@ func (s *Server) RPC(method string, args interface{}, reply interface{}) error {
// internal server API. It's odd that the same request directed to a server is // internal server API. It's odd that the same request directed to a server is
// recorded differently. On the other hand this possibly masks the different // recorded differently. On the other hand this possibly masks the different
// between regular client requests that traverse the network and these which // between regular client requests that traverse the network and these which
// don't (unless forwarded). This still seems most sane. // don't (unless forwarded). This still seems most reasonable.
metrics.IncrCounter([]string{"client", "rpc"}, 1) metrics.IncrCounter([]string{"client", "rpc"}, 1)
if !s.rpcLimiter.Load().(*rate.Limiter).Allow() { if !s.rpcLimiter.Load().(*rate.Limiter).Allow() {
metrics.IncrCounter([]string{"client", "rpc", "exceeded"}, 1) metrics.IncrCounter([]string{"client", "rpc", "exceeded"}, 1)
@ -1288,7 +1288,7 @@ func (s *Server) SnapshotRPC(args *structs.SnapshotRequest, in io.Reader, out io
// internal server API. It's odd that the same request directed to a server is // internal server API. It's odd that the same request directed to a server is
// recorded differently. On the other hand this possibly masks the different // recorded differently. On the other hand this possibly masks the different
// between regular client requests that traverse the network and these which // between regular client requests that traverse the network and these which
// don't (unless forwarded). This still seems most sane. // don't (unless forwarded). This still seems most reasonable.
metrics.IncrCounter([]string{"client", "rpc"}, 1) metrics.IncrCounter([]string{"client", "rpc"}, 1)
if !s.rpcLimiter.Load().(*rate.Limiter).Allow() { if !s.rpcLimiter.Load().(*rate.Limiter).Allow() {
metrics.IncrCounter([]string{"client", "rpc", "exceeded"}, 1) metrics.IncrCounter([]string{"client", "rpc", "exceeded"}, 1)

View File

@ -407,14 +407,14 @@ func TestServiceManager_PersistService_API(t *testing.T) {
requireFileIsPresent(t, svcFile) requireFileIsPresent(t, svcFile)
requireFileIsPresent(t, configFile) requireFileIsPresent(t, configFile)
// Service definition file is sane. // Service definition file is reasonable.
expectJSONFile(t, svcFile, persistedService{ expectJSONFile(t, svcFile, persistedService{
Token: "mytoken", Token: "mytoken",
Service: svc, Service: svc,
Source: "remote", Source: "remote",
}, nil) }, nil)
// Service config file is sane. // Service config file is reasonable.
pcfg := persistedServiceConfig{ pcfg := persistedServiceConfig{
ServiceID: "web-sidecar-proxy", ServiceID: "web-sidecar-proxy",
Defaults: &structs.ServiceConfigResponse{ Defaults: &structs.ServiceConfigResponse{
@ -632,7 +632,7 @@ func TestServiceManager_PersistService_ConfigFiles(t *testing.T) {
requireFileIsAbsent(t, svcFile) requireFileIsAbsent(t, svcFile)
requireFileIsPresent(t, configFile) requireFileIsPresent(t, configFile)
// Service config file is sane. // Service config file is reasonable.
expectJSONFile(t, configFile, persistedServiceConfig{ expectJSONFile(t, configFile, persistedServiceConfig{
ServiceID: "web-sidecar-proxy", ServiceID: "web-sidecar-proxy",
Defaults: &structs.ServiceConfigResponse{ Defaults: &structs.ServiceConfigResponse{

View File

@ -80,7 +80,7 @@ func (a *Agent) sidecarServiceFromNodeService(ns *structs.NodeService, token str
token = ns.Connect.SidecarService.Token token = ns.Connect.SidecarService.Token
} }
// Setup some sane connect proxy defaults. // Setup some reasonable connect proxy defaults.
if sidecar.Kind == "" { if sidecar.Kind == "" {
sidecar.Kind = structs.ServiceKindConnectProxy sidecar.Kind = structs.ServiceKindConnectProxy
} }

View File

@ -400,7 +400,7 @@ type ServiceRouteDestination struct {
RetryOnConnectFailure bool `json:",omitempty" alias:"retry_on_connect_failure"` RetryOnConnectFailure bool `json:",omitempty" alias:"retry_on_connect_failure"`
// RetryOnStatusCodes is a flat list of http response status codes that are // RetryOnStatusCodes is a flat list of http response status codes that are
// eligible for retry. This again should be feasible in any sane proxy. // eligible for retry. This again should be feasible in any reasonable proxy.
RetryOnStatusCodes []uint32 `json:",omitempty" alias:"retry_on_status_codes"` RetryOnStatusCodes []uint32 `json:",omitempty" alias:"retry_on_status_codes"`
} }

View File

@ -57,7 +57,7 @@ func (s *ResourceGenerator) routesForConnectProxy(chains map[string]*structs.Com
Name: id, Name: id,
VirtualHosts: []*envoy_route_v3.VirtualHost{virtualHost}, VirtualHosts: []*envoy_route_v3.VirtualHost{virtualHost},
// ValidateClusters defaults to true when defined statically and false // ValidateClusters defaults to true when defined statically and false
// when done via RDS. Re-set the sane value of true to prevent // when done via RDS. Re-set the reasonable value of true to prevent
// null-routing traffic. // null-routing traffic.
ValidateClusters: makeBoolValue(true), ValidateClusters: makeBoolValue(true),
} }
@ -151,7 +151,7 @@ func makeNamedDefaultRouteWithLB(clusterName string, lb *structs.LoadBalancer, a
}, },
}, },
// ValidateClusters defaults to true when defined statically and false // ValidateClusters defaults to true when defined statically and false
// when done via RDS. Re-set the sane value of true to prevent // when done via RDS. Re-set the reasonable value of true to prevent
// null-routing traffic. // null-routing traffic.
ValidateClusters: makeBoolValue(true), ValidateClusters: makeBoolValue(true),
}, nil }, nil
@ -174,7 +174,7 @@ func (s *ResourceGenerator) routesForIngressGateway(
upstreamRoute := &envoy_route_v3.RouteConfiguration{ upstreamRoute := &envoy_route_v3.RouteConfiguration{
Name: listenerKey.RouteName(), Name: listenerKey.RouteName(),
// ValidateClusters defaults to true when defined statically and false // ValidateClusters defaults to true when defined statically and false
// when done via RDS. Re-set the sane value of true to prevent // when done via RDS. Re-set the reasonable value of true to prevent
// null-routing traffic. // null-routing traffic.
ValidateClusters: makeBoolValue(true), ValidateClusters: makeBoolValue(true),
} }

View File

@ -26,7 +26,7 @@ Description:
Single or package-wide tests are run for multiple iterations with a configurable Single or package-wide tests are run for multiple iterations with a configurable
amount of CPU resources. amount of CPU resources.
0.15 CPUs and 30 iterations are configured as sane defaults. 0.15 CPUs and 30 iterations are configured as reasonable defaults.
See Docker docs for more info on tuning 'cpus' param: See Docker docs for more info on tuning 'cpus' param:
https://docs.docker.com/config/containers/resource_constraints/#cpu https://docs.docker.com/config/containers/resource_constraints/#cpu

View File

@ -370,7 +370,7 @@ ERR_EXIT:
} }
} }
// validate checks that the configuration is sane // validate checks that the configuration is reasonable
func (conf *rExecConf) validate() error { func (conf *rExecConf) validate() error {
// Validate the filters // Validate the filters
if conf.node != "" { if conf.node != "" {

View File

@ -72,7 +72,7 @@ type PublicListenerConfig struct {
HandshakeTimeoutMs int `json:"handshake_timeout_ms" hcl:"handshake_timeout_ms" mapstructure:"handshake_timeout_ms"` HandshakeTimeoutMs int `json:"handshake_timeout_ms" hcl:"handshake_timeout_ms" mapstructure:"handshake_timeout_ms"`
} }
// applyDefaults sets zero-valued params to a sane default. // applyDefaults sets zero-valued params to a reasonable default.
func (plc *PublicListenerConfig) applyDefaults() { func (plc *PublicListenerConfig) applyDefaults() {
if plc.LocalConnectTimeoutMs == 0 { if plc.LocalConnectTimeoutMs == 0 {
plc.LocalConnectTimeoutMs = 1000 plc.LocalConnectTimeoutMs = 1000
@ -98,7 +98,7 @@ func (uc *UpstreamConfig) ConnectTimeout() time.Duration {
return 10000 * time.Millisecond return 10000 * time.Millisecond
} }
// applyDefaults sets zero-valued params to a sane default. // applyDefaults sets zero-valued params to a reasonable default.
func (uc *UpstreamConfig) applyDefaults() { func (uc *UpstreamConfig) applyDefaults() {
if uc.DestinationType == "" { if uc.DestinationType == "" {
uc.DestinationType = "service" uc.DestinationType = "service"

View File

@ -7,7 +7,7 @@ import { set } from '@ember/object';
* *
* Each 'blocking action' (blocking in terms of showing some sort of blocking loader) is * Each 'blocking action' (blocking in terms of showing some sort of blocking loader) is
* wrapped in the functionality to signal that the page should be blocked * wrapped in the functionality to signal that the page should be blocked
* (currently via the 'feedback' service) as well as some sane default hooks for where the page * (currently via the 'feedback' service) as well as some reasonable default hooks for where the page
* should go when the action has finished. * should go when the action has finished.
* *
* Hooks can and are being overwritten for custom redirects/error handling on a route by route basis. * Hooks can and are being overwritten for custom redirects/error handling on a route by route basis.

View File

@ -32,7 +32,7 @@ local agent by following the
The agent command takes a variety of The agent command takes a variety of
[`configuration options`](/docs/agent/options#command-line-options), but most [`configuration options`](/docs/agent/options#command-line-options), but most
have sane defaults. have reasonable defaults.
When running [`consul agent`](/commands/agent), you should see output When running [`consul agent`](/commands/agent), you should see output
similar to this: similar to this:

View File

@ -53,7 +53,7 @@ for the built-in proxy.
} }
``` ```
All fields are optional with a sane default. All fields are optional with a reasonable default.
- `bind_address` - The address the proxy will bind its - `bind_address` - The address the proxy will bind its
_public_ mTLS listener to. It defaults to the same address the agent binds to. _public_ mTLS listener to. It defaults to the same address the agent binds to.
@ -101,7 +101,7 @@ All fields are optional with a sane default.
## Proxy Upstream Config Key Reference ## Proxy Upstream Config Key Reference
All fields are optional with a sane default. All fields are optional with a reasonable default.
- `connect_timeout_ms` - The number of milliseconds - `connect_timeout_ms` - The number of milliseconds
the proxy will wait to establish a TLS connection to the discovered upstream instance the proxy will wait to establish a TLS connection to the discovered upstream instance

View File

@ -64,7 +64,7 @@ token is more restrictive than can be currently expressed manually in
an ACL policy. an ACL policy.
The default managed proxy is a basic proxy built-in to Consul and written The default managed proxy is a basic proxy built-in to Consul and written
in Go. Having a basic built-in proxy allows Consul to have a sane default in Go. Having a basic built-in proxy allows Consul to have a reasonable default
with performance that is good enough for most workloads. In some basic with performance that is good enough for most workloads. In some basic
benchmarks, the service-to-service communication over the built-in proxy benchmarks, the service-to-service communication over the built-in proxy
could sustain 5 Gbps with sub-millisecond latency. Therefore, could sustain 5 Gbps with sub-millisecond latency. Therefore,

View File

@ -3,7 +3,7 @@ layout: docs
page_title: Connect - Service Registration page_title: Connect - Service Registration
description: >- description: >-
A per-service proxy sidecar transparently handles inbound and outbound service A per-service proxy sidecar transparently handles inbound and outbound service
connections. You can register these sidecars with sane defaults by nesting connections. You can register these sidecars with reasonable defaults by nesting
their definitions in the service definition. their definitions in the service definition.
--- ---

View File

@ -7,7 +7,7 @@ description: Consul KV is a core feature of Consul and is installed with the Con
# Consul KV # Consul KV
Consul KV is a core feature of Consul and is installed with the Consul agent. Consul KV is a core feature of Consul and is installed with the Consul agent.
Once installed with the agent, it will have sane defaults. Consul KV allows Once installed with the agent, it will have reasonable defaults. Consul KV allows
users to store indexed objects, though its main uses are storing configuration users to store indexed objects, though its main uses are storing configuration
parameters and metadata. Please note that it is a simple KV store and is not parameters and metadata. Please note that it is a simple KV store and is not
intended to be a full featured datastore (such as DynamoDB) but has some intended to be a full featured datastore (such as DynamoDB) but has some

View File

@ -10,7 +10,7 @@ description: Configuration for the Consul Helm chart.
The chart is highly customizable using The chart is highly customizable using
[Helm configuration values](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). [Helm configuration values](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing).
Each value has a sane default tuned for an optimal getting started experience Each value has a reasonable default tuned for an optimal getting started experience
with Consul. Before going into production, please review the parameters below with Consul. Before going into production, please review the parameters below
and consider if they're appropriate for your deployment. and consider if they're appropriate for your deployment.

View File

@ -40,7 +40,7 @@ You are still responsible for learning how to monitor, backup,
upgrade, etc. the Consul cluster. upgrade, etc. the Consul cluster.
The Helm chart has no required configuration and will install a Consul The Helm chart has no required configuration and will install a Consul
cluster with sane defaults out of the box. Prior to going to production, cluster with reasonable defaults out of the box. Prior to going to production,
it is highly recommended that you it is highly recommended that you
[learn about the configuration options](/docs/k8s/helm#configuration-values). [learn about the configuration options](/docs/k8s/helm#configuration-values).