diff --git a/agent/config/flags.go b/agent/config/flags.go index 519c8b865..00deebe1b 100644 --- a/agent/config/flags.go +++ b/agent/config/flags.go @@ -6,7 +6,8 @@ import ( "time" ) -// AddFlags adds the command line flags for the agent. +// AddFlags adds the command line flags to the FlagSet, and sets the appropriate field in +// LoadOpts.FlagValues as the value receiver. func AddFlags(fs *flag.FlagSet, f *LoadOpts) { add := func(p interface{}, name, help string) { switch x := p.(type) { diff --git a/agent/config/runtime_oss_test.go b/agent/config/runtime_oss_test.go index 794c04e78..47d3c7364 100644 --- a/agent/config/runtime_oss_test.go +++ b/agent/config/runtime_oss_test.go @@ -10,8 +10,6 @@ var enterpriseReadReplicaWarnings = []string{enterpriseConfigKeyError{key: "read var enterpriseConfigKeyWarnings = []string{ enterpriseConfigKeyError{key: "read_replica (or the deprecated non_voting_server)"}.Error(), - enterpriseConfigKeyError{key: "segment"}.Error(), - enterpriseConfigKeyError{key: "segments"}.Error(), enterpriseConfigKeyError{key: "autopilot.redundancy_zone_tag"}.Error(), enterpriseConfigKeyError{key: "autopilot.upgrade_version_tag"}.Error(), enterpriseConfigKeyError{key: "autopilot.disable_upgrade_migration"}.Error(), diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index 1631a5f16..19d9c5ab3 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -5005,19 +5005,7 @@ func TestLoad_InvalidConfigFormat(t *testing.T) { // TestFullConfig tests the conversion from a fully populated JSON or // HCL config file to a RuntimeConfig structure. All fields must be set // to a unique non-zero value. -// -// To aid populating the fields the following bash functions can be used -// to generate random strings and ints: -// -// random-int() { echo $RANDOM } -// random-string() { base64 /dev/urandom | tr -d '/+' | fold -w ${1:-32} | head -n 1 } -// -// To generate a random string of length 8 run the following command in -// a terminal: -// -// random-string 8 -// -func TestFullConfig(t *testing.T) { +func TestLoad_FullConfig(t *testing.T) { dataDir := testutil.TempDir(t, "consul") cidr := func(s string) *net.IPNet { @@ -5026,1497 +5014,28 @@ func TestFullConfig(t *testing.T) { } defaultEntMeta := structs.DefaultEnterpriseMeta() - - flagSrc := []string{`-dev`} - src := map[string]string{ - "json": `{ - "acl_agent_master_token": "furuQD0b", - "acl_agent_token": "cOshLOQ2", - "acl_datacenter": "m3urck3z", - "acl_default_policy": "ArK3WIfE", - "acl_down_policy": "vZXMfMP0", - "acl_enable_key_list_policy": true, - "acl_master_token": "C1Q1oIwh", - "acl_replication_token": "LMmgy5dO", - "acl_token": "O1El0wan", - "acl_ttl": "18060s", - "acl" : { - "enabled" : true, - "down_policy" : "03eb2aee", - "default_policy" : "72c2e7a0", - "enable_key_list_policy": true, - "enable_token_persistence": true, - "policy_ttl": "1123s", - "role_ttl": "9876s", - "token_ttl": "3321s", - "enable_token_replication" : true, - "msp_disable_bootstrap": true, - "tokens" : { - "master" : "8a19ac27", - "agent_master" : "64fd0e08", - "replication" : "5795983a", - "agent" : "bed2377c", - "default" : "418fdff1", - "managed_service_provider": [ - { - "accessor_id": "first", - "secret_id": "fb0cee1f-2847-467c-99db-a897cff5fd4d" - }, - { - "accessor_id": "second", - "secret_id": "1046c8da-e166-4667-897a-aefb343db9db" - } - ] - } - }, - "addresses": { - "dns": "93.95.95.81", - "http": "83.39.91.39", - "https": "95.17.17.19", - "grpc": "32.31.61.91" - }, - "advertise_addr": "17.99.29.16", - "advertise_addr_wan": "78.63.37.19", - "advertise_reconnect_timeout": "0s", - "audit": { - "enabled": false - }, - "auto_config": { - "enabled": false, - "intro_token": "OpBPGRwt", - "intro_token_file": "gFvAXwI8", - "dns_sans": ["6zdaWg9J"], - "ip_sans": ["198.18.99.99"], - "server_addresses": ["198.18.100.1"], - "authorization": { - "enabled": true, - "static": { - "allow_reuse": true, - "claim_mappings": { - "node": "node" - }, - "list_claim_mappings": { - "foo": "bar" - }, - "bound_issuer": "consul", - "bound_audiences": ["consul-cluster-1"], - "claim_assertions": ["value.node == \"${node}\""], - "jwt_validation_pub_keys": ["-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERVchfCZng4mmdvQz1+sJHRN40snC\nYt8NjYOnbnScEXMkyoUmASr88gb7jaVAVt3RYASAbgBjB2Z+EUizWkx5Tg==\n-----END PUBLIC KEY-----"] - } - } - }, - "autopilot": { - "cleanup_dead_servers": true, - "disable_upgrade_migration": true, - "last_contact_threshold": "12705s", - "max_trailing_logs": 17849, - "min_quorum": 3, - "redundancy_zone_tag": "3IsufDJf", - "server_stabilization_time": "23057s", - "upgrade_version_tag": "W9pDwFAL" - }, - "bind_addr": "16.99.34.17", - "bootstrap": true, - "bootstrap_expect": 53, - "cache": { - "entry_fetch_max_burst": 42, - "entry_fetch_rate": 0.334 - }, - "use_streaming_backend": true, - "ca_file": "erA7T0PM", - "ca_path": "mQEN1Mfp", - "cert_file": "7s4QAzDk", - "check": { - "id": "fZaCAXww", - "name": "OOM2eo0f", - "notes": "zXzXI9Gt", - "service_id": "L8G0QNmR", - "token": "oo4BCTgJ", - "status": "qLykAl5u", - "args": ["f3BemRjy", "e5zgpef7"], - "http": "29B93haH", - "header": { - "hBq0zn1q": [ "2a9o9ZKP", "vKwA5lR6" ], - "f3r6xFtM": [ "RyuIdDWv", "QbxEcIUM" ] - }, - "method": "Dou0nGT5", - "body": "5PBQd2OT", - "output_max_size": ` + strconv.Itoa(checks.DefaultBufSize) + `, - "tcp": "JY6fTTcw", - "interval": "18714s", - "docker_container_id": "qF66POS9", - "shell": "sOnDy228", - "tls_skip_verify": true, - "timeout": "5954s", - "ttl": "30044s", - "deregister_critical_service_after": "13209s" - }, - "checks": [ - { - "id": "uAjE6m9Z", - "name": "QsZRGpYr", - "notes": "VJ7Sk4BY", - "service_id": "lSulPcyz", - "token": "toO59sh8", - "status": "9RlWsXMV", - "args": ["4BAJttck", "4D2NPtTQ"], - "http": "dohLcyQ2", - "header": { - "ZBfTin3L": [ "1sDbEqYG", "lJGASsWK" ], - "Ui0nU99X": [ "LMccm3Qe", "k5H5RggQ" ] - }, - "method": "aldrIQ4l", - "body": "wSjTy7dg", - "tcp": "RJQND605", - "interval": "22164s", - "output_max_size": ` + strconv.Itoa(checks.DefaultBufSize) + `, - "docker_container_id": "ipgdFtjd", - "shell": "qAeOYy0M", - "tls_skip_verify": true, - "timeout": "1813s", - "ttl": "21743s", - "deregister_critical_service_after": "14232s" - }, - { - "id": "Cqq95BhP", - "name": "3qXpkS0i", - "notes": "sb5qLTex", - "service_id": "CmUUcRna", - "token": "a3nQzHuy", - "status": "irj26nf3", - "args": ["9s526ogY", "gSlOHj1w"], - "http": "yzhgsQ7Y", - "header": { - "zcqwA8dO": [ "qb1zx0DL", "sXCxPFsD" ], - "qxvdnSE9": [ "6wBPUYdF", "YYh8wtSZ" ] - }, - "method": "gLrztrNw", - "body": "0jkKgGUC", - "tcp": "4jG5casb", - "interval": "28767s", - "output_max_size": ` + strconv.Itoa(checks.DefaultBufSize) + `, - "docker_container_id": "THW6u7rL", - "shell": "C1Zt3Zwh", - "tls_skip_verify": true, - "timeout": "18506s", - "ttl": "31006s", - "deregister_critical_service_after": "2366s" - } - ], - "check_update_interval": "16507s", - "client_addr": "93.83.18.19", - "config_entries": { - "bootstrap": [ - { - "kind": "proxy-defaults", - "name": "global", - "config": { - "foo": "bar", - "bar": 1.0 - } - } - ] - }, - "auto_encrypt": { - "tls": false, - "dns_san": ["a.com", "b.com"], - "ip_san": ["192.168.4.139", "192.168.4.140"], - "allow_tls": true - }, - "connect": { - "ca_provider": "consul", - "ca_config": { - "rotation_period": "90h", - "intermediate_cert_ttl": "8760h", - "leaf_cert_ttl": "1h", - "csr_max_per_second": 100, - "csr_max_concurrent": 2 - }, - "enable_mesh_gateway_wan_federation": false, - "enabled": true - }, - "gossip_lan" : { - "gossip_nodes": 6, - "gossip_interval" : "25252s", - "retransmit_mult" : 1234, - "suspicion_mult" : 1235, - "probe_interval" : "101ms", - "probe_timeout" : "102ms" - }, - "gossip_wan" : { - "gossip_nodes" : 2, - "gossip_interval" : "6966s", - "retransmit_mult" : 16384, - "suspicion_mult" : 16385, - "probe_interval" : "103ms", - "probe_timeout" : "104ms" - }, - "data_dir": "` + dataDir + `", - "datacenter": "rzo029wg", - "default_query_time": "16743s", - "disable_anonymous_signature": true, - "disable_coordinates": true, - "disable_host_node_id": true, - "disable_http_unprintable_char_filter": true, - "disable_keyring_file": true, - "disable_remote_exec": true, - "disable_update_check": true, - "discard_check_output": true, - "discovery_max_stale": "5s", - "domain": "7W1xXSqd", - "alt_domain": "1789hsd", - "dns_config": { - "allow_stale": true, - "a_record_limit": 29907, - "disable_compression": true, - "enable_truncate": true, - "max_stale": "29685s", - "node_ttl": "7084s", - "only_passing": true, - "recursor_timeout": "4427s", - "service_ttl": { - "*": "32030s" - }, - "udp_answer_limit": 29909, - "use_cache": true, - "cache_max_age": "5m", - "prefer_namespace": true - }, - "enable_acl_replication": true, - "enable_agent_tls_for_checks": true, - "enable_central_service_config": false, - "enable_debug": true, - "enable_script_checks": true, - "enable_local_script_checks": true, - "enable_syslog": true, - "encrypt": "A4wELWqH", - "encrypt_verify_incoming": true, - "encrypt_verify_outgoing": true, - "http_config": { - "block_endpoints": [ "RBvAFcGD", "fWOWFznh" ], - "allow_write_http_from": [ "127.0.0.1/8", "22.33.44.55/32", "0.0.0.0/0" ], - "response_headers": { - "M6TKa9NP": "xjuxjOzQ", - "JRCrHZed": "rl0mTx81" - }, - "use_cache": false, - "max_header_bytes": 10 - }, - "key_file": "IEkkwgIA", - "leave_on_terminate": true, - "limits": { - "http_max_conns_per_client": 100, - "https_handshake_timeout": "2391ms", - "rpc_handshake_timeout": "1932ms", - "rpc_rate": 12029.43, - "rpc_max_burst": 44848, - "rpc_max_conns_per_client": 2954, - "kv_max_value_size": 1234567800000000, - "txn_max_req_len": 5678000000000000 - }, - "log_level": "k1zo9Spt", - "log_json": true, - "max_query_time": "18237s", - "node_id": "AsUIlw99", - "node_meta": { - "5mgGQMBk": "mJLtVMSG", - "A7ynFMJB": "0Nx6RGab" - }, - "node_name": "otlLxGaI", - "non_voting_server": true, - "performance": { - "leave_drain_time": "8265s", - "raft_multiplier": 5, - "rpc_hold_timeout": "15707s" - }, - "pid_file": "43xN80Km", - "ports": { - "dns": 7001, - "http": 7999, - "https": 15127, - "server": 3757, - "grpc": 4881, - "sidecar_min_port": 8888, - "sidecar_max_port": 9999, - "expose_min_port": 1111, - "expose_max_port": 2222 - }, - "protocol": 30793, - "primary_datacenter": "ejtmd43d", - "primary_gateways": [ "aej8eeZo", "roh2KahS" ], - "primary_gateways_interval": "18866s", - "raft_protocol": 3, - "raft_snapshot_threshold": 16384, - "raft_snapshot_interval": "30s", - "raft_trailing_logs": 83749, - "read_replica": true, - "reconnect_timeout": "23739s", - "reconnect_timeout_wan": "26694s", - "recursors": [ "63.38.39.58", "92.49.18.18" ], - "rejoin_after_leave": true, - "retry_interval": "8067s", - "retry_interval_wan": "28866s", - "retry_join": [ "pbsSFY7U", "l0qLtWij" ], - "retry_join_wan": [ "PFsR02Ye", "rJdQIhER" ], - "retry_max": 913, - "retry_max_wan": 23160, - "rpc": {"enable_streaming": true}, - "segment": "BC2NhTDi", - "segments": [ - { - "name": "PExYMe2E", - "bind": "36.73.36.19", - "port": 38295, - "rpc_listener": true, - "advertise": "63.39.19.18" - }, - { - "name": "UzCvJgup", - "bind": "37.58.38.19", - "port": 39292, - "rpc_listener": true, - "advertise": "83.58.26.27" - } - ], - "serf_lan": "99.43.63.15", - "serf_wan": "67.88.33.19", - "server": true, - "server_name": "Oerr9n1G", - "service": { - "id": "dLOXpSCI", - "name": "o1ynPkp0", - "meta": { - "mymeta": "data" - }, - "tagged_addresses": { - "lan": { - "address": "2d79888a", - "port": 2143 - }, - "wan": { - "address": "d4db85e2", - "port": 6109 - } - }, - "tags": ["nkwshvM5", "NTDWn3ek"], - "address": "cOlSOhbp", - "token": "msy7iWER", - "port": 24237, - "weights": { - "passing": 100, - "warning": 1 - }, - "enable_tag_override": true, - "check": { - "id": "RMi85Dv8", - "name": "iehanzuq", - "status": "rCvn53TH", - "notes": "fti5lfF3", - "args": ["16WRUmwS", "QWk7j7ae"], - "http": "dl3Fgme3", - "header": { - "rjm4DEd3": ["2m3m2Fls"], - "l4HwQ112": ["fk56MNlo", "dhLK56aZ"] - }, - "method": "9afLm3Mj", - "body": "wVVL2V6f", - "tcp": "fjiLFqVd", - "interval": "23926s", - "output_max_size": ` + strconv.Itoa(checks.DefaultBufSize) + `, - "docker_container_id": "dO5TtRHk", - "shell": "e6q2ttES", - "tls_skip_verify": true, - "timeout": "38483s", - "ttl": "10943s", - "deregister_critical_service_after": "68787s" - }, - "checks": [ - { - "id": "Zv99e9Ka", - "name": "sgV4F7Pk", - "notes": "yP5nKbW0", - "status": "7oLMEyfu", - "args": ["5wEZtZpv", "0Ihyk8cS"], - "http": "KyDjGY9H", - "header": { - "gv5qefTz": [ "5Olo2pMG", "PvvKWQU5" ], - "SHOVq1Vv": [ "jntFhyym", "GYJh32pp" ] - }, - "method": "T66MFBfR", - "body": "OwGjTFQi", - "tcp": "bNnNfx2A", - "interval": "22224s", - "output_max_size": ` + strconv.Itoa(checks.DefaultBufSize) + `, - "docker_container_id": "ipgdFtjd", - "shell": "omVZq7Sz", - "tls_skip_verify": true, - "timeout": "18913s", - "ttl": "44743s", - "deregister_critical_service_after": "8482s" - }, - { - "id": "G79O6Mpr", - "name": "IEqrzrsd", - "notes": "SVqApqeM", - "status": "XXkVoZXt", - "args": ["wD05Bvao", "rLYB7kQC"], - "http": "kyICZsn8", - "header": { - "4ebP5vL4": [ "G20SrL5Q", "DwPKlMbo" ], - "p2UI34Qz": [ "UsG1D0Qh", "NHhRiB6s" ] - }, - "method": "ciYHWors", - "body": "lUVLGYU7", - "tcp": "FfvCwlqH", - "interval": "12356s", - "output_max_size": ` + strconv.Itoa(checks.DefaultBufSize) + `, - "docker_container_id": "HBndBU6R", - "shell": "hVI33JjA", - "tls_skip_verify": true, - "timeout": "38282s", - "ttl": "1181s", - "deregister_critical_service_after": "4992s" - } - ], - "connect": { - "native": true - } - }, - "services": [ - { - "id": "wI1dzxS4", - "name": "7IszXMQ1", - "tags": ["0Zwg8l6v", "zebELdN5"], - "address": "9RhqPSPB", - "token": "myjKJkWH", - "port": 72219, - "enable_tag_override": true, - "check": { - "id": "qmfeO5if", - "name": "atDGP7n5", - "status": "pDQKEhWL", - "notes": "Yt8EDLev", - "args": ["81EDZLPa", "bPY5X8xd"], - "http": "qzHYvmJO", - "header": { - "UkpmZ3a3": ["2dfzXuxZ"], - "cVFpko4u": ["gGqdEB6k", "9LsRo22u"] - }, - "method": "X5DrovFc", - "body": "WeikigLh", - "tcp": "ICbxkpSF", - "interval": "24392s", - "output_max_size": ` + strconv.Itoa(checks.DefaultBufSize) + `, - "docker_container_id": "ZKXr68Yb", - "shell": "CEfzx0Fo", - "tls_skip_verify": true, - "timeout": "38333s", - "ttl": "57201s", - "deregister_critical_service_after": "44214s" - }, - "connect": { - "sidecar_service": {} - } - }, - { - "id": "MRHVMZuD", - "name": "6L6BVfgH", - "tags": ["7Ale4y6o", "PMBW08hy"], - "address": "R6H6g8h0", - "token": "ZgY8gjMI", - "port": 38292, - "weights": { - "passing": 1979, - "warning": 6 - }, - "enable_tag_override": true, - "checks": [ - { - "id": "GTti9hCo", - "name": "9OOS93ne", - "notes": "CQy86DH0", - "status": "P0SWDvrk", - "args": ["EXvkYIuG", "BATOyt6h"], - "http": "u97ByEiW", - "header": { - "MUlReo8L": [ "AUZG7wHG", "gsN0Dc2N" ], - "1UJXjVrT": [ "OJgxzTfk", "xZZrFsq7" ] - }, - "method": "5wkAxCUE", - "body": "7CRjCJyz", - "tcp": "MN3oA9D2", - "interval": "32718s", - "output_max_size": ` + strconv.Itoa(checks.DefaultBufSize) + `, - "docker_container_id": "cU15LMet", - "shell": "nEz9qz2l", - "tls_skip_verify": true, - "timeout": "34738s", - "ttl": "22773s", - "deregister_critical_service_after": "84282s" - }, - { - "id": "UHsDeLxG", - "name": "PQSaPWlT", - "notes": "jKChDOdl", - "status": "5qFz6OZn", - "args": ["NMtYWlT9", "vj74JXsm"], - "http": "1LBDJhw4", - "header": { - "cXPmnv1M": [ "imDqfaBx", "NFxZ1bQe" ], - "vr7wY7CS": [ "EtCoNPPL", "9vAarJ5s" ] - }, - "method": "wzByP903", - "body": "4I8ucZgZ", - "tcp": "2exjZIGE", - "interval": "5656s", - "output_max_size": ` + strconv.Itoa(checks.DefaultBufSize) + `, - "docker_container_id": "5tDBWpfA", - "shell": "rlTpLM8s", - "tls_skip_verify": true, - "timeout": "4868s", - "ttl": "11222s", - "deregister_critical_service_after": "68482s" - } - ], - "connect": {} - }, - { - "id": "Kh81CPF6", - "kind": "connect-proxy", - "name": "Kh81CPF6-proxy", - "port": 31471, - "proxy": { - "config": { - "cedGGtZf": "pWrUNiWw" - }, - "destination_service_id": "6L6BVfgH-id", - "destination_service_name": "6L6BVfgH", - "local_service_address": "127.0.0.2", - "local_service_port": 23759, - "expose": { - "checks": true, - "paths": [ - { - "path": "/health", - "local_path_port": 8080, - "listener_port": 21500, - "protocol": "http" - } - ] - }, - "upstreams": [ - { - "destination_name": "KPtAj2cb", - "local_bind_port": 4051, - "config": { - "kzRnZOyd": "nUNKoL8H" - } - }, - { - "destination_name": "KSd8HsRl", - "destination_namespace": "9nakw0td", - "destination_type": "prepared_query", - "local_bind_address": "127.24.88.0", - "local_bind_port": 11884 - } - ] - } - }, - { - "id": "kvVqbwSE", - "kind": "mesh-gateway", - "name": "gw-primary-dc", - "port": 27147, - "proxy": { - "config": { - "1CuJHVfw" : "Kzqsa7yc" - } - } - } - ], - "session_ttl_min": "26627s", - "skip_leave_on_interrupt": true, - "start_join": [ "LR3hGDoG", "MwVpZ4Up" ], - "start_join_wan": [ "EbFSc3nA", "kwXTh623" ], - "syslog_facility": "hHv79Uia", - "tagged_addresses": { - "7MYgHrYH": "dALJAhLD", - "h6DdBy6K": "ebrr9zZ8" - }, - "telemetry": { - "circonus_api_app": "p4QOTe9j", - "circonus_api_token": "E3j35V23", - "circonus_api_url": "mEMjHpGg", - "circonus_broker_id": "BHlxUhed", - "circonus_broker_select_tag": "13xy1gHm", - "circonus_check_display_name": "DRSlQR6n", - "circonus_check_force_metric_activation": "Ua5FGVYf", - "circonus_check_id": "kGorutad", - "circonus_check_instance_id": "rwoOL6R4", - "circonus_check_search_tag": "ovT4hT4f", - "circonus_check_tags": "prvO4uBl", - "circonus_submission_interval": "DolzaflP", - "circonus_submission_url": "gTcbS93G", - "disable_hostname": true, - "dogstatsd_addr": "0wSndumK", - "dogstatsd_tags": [ "3N81zSUB","Xtj8AnXZ" ], - "filter_default": true, - "prefix_filter": [ "+oJotS8XJ","-cazlEhGn" ], - "metrics_prefix": "ftO6DySn", - "prometheus_retention_time": "15s", - "statsd_address": "drce87cy", - "statsite_address": "HpFwKB8R", - "disable_compat_1.9": true - }, - "tls_cipher_suites": "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", - "tls_min_version": "pAOWafkR", - "tls_prefer_server_cipher_suites": true, - "translate_wan_addrs": true, - "ui_config": { - "enabled": true, - "dir": "pVncV4Ey", - "content_path": "qp1WRhYH", - "metrics_provider": "sgnaoa_lower_case", - "metrics_provider_files": ["sgnaMFoa", "dicnwkTH"], - "metrics_provider_options_json": "{\"DIbVQadX\": 1}", - "metrics_proxy": { - "base_url": "http://foo.bar", - "add_headers": [ - { - "name": "p3nynwc9", - "value": "TYBgnN2F" - } - ], - "path_allowlist": ["/aSh3cu", "/eiK/2Th"] - }, - "dashboard_url_templates": { - "u2eziu2n_lower_case": "http://lkjasd.otr" - } - }, - "unix_sockets": { - "group": "8pFodrV8", - "mode": "E8sAwOv4", - "user": "E0nB1DwA" - }, - "verify_incoming": true, - "verify_incoming_https": true, - "verify_incoming_rpc": true, - "verify_outgoing": true, - "verify_server_hostname": true, - "watches": [ - { - "type": "key", - "datacenter": "GyE6jpeW", - "key": "j9lF1Tve", - "handler": "90N7S4LN" - }, { - "type": "keyprefix", - "datacenter": "fYrl3F5d", - "key": "sl3Dffu7", - "args": ["dltjDJ2a", "flEa7C2d"] - } - ] - }`, - "hcl": ` - acl_agent_master_token = "furuQD0b" - acl_agent_token = "cOshLOQ2" - acl_datacenter = "m3urck3z" - acl_default_policy = "ArK3WIfE" - acl_down_policy = "vZXMfMP0" - acl_enable_key_list_policy = true - acl_master_token = "C1Q1oIwh" - acl_replication_token = "LMmgy5dO" - acl_token = "O1El0wan" - acl_ttl = "18060s" - acl = { - enabled = true - down_policy = "03eb2aee" - default_policy = "72c2e7a0" - enable_key_list_policy = true - enable_token_persistence = true - policy_ttl = "1123s" - role_ttl = "9876s" - token_ttl = "3321s" - enable_token_replication = true - msp_disable_bootstrap = true - tokens = { - master = "8a19ac27", - agent_master = "64fd0e08", - replication = "5795983a", - agent = "bed2377c", - default = "418fdff1", - managed_service_provider = [ - { - accessor_id = "first", - secret_id = "fb0cee1f-2847-467c-99db-a897cff5fd4d" - }, - { - accessor_id = "second", - secret_id = "1046c8da-e166-4667-897a-aefb343db9db" - } - ] - } - } - addresses = { - dns = "93.95.95.81" - http = "83.39.91.39" - https = "95.17.17.19" - grpc = "32.31.61.91" - } - advertise_addr = "17.99.29.16" - advertise_addr_wan = "78.63.37.19" - advertise_reconnect_timeout = "0s" - audit = { - enabled = false - } - auto_config = { - enabled = false - intro_token = "OpBPGRwt" - intro_token_file = "gFvAXwI8" - dns_sans = ["6zdaWg9J"] - ip_sans = ["198.18.99.99"] - server_addresses = ["198.18.100.1"] - authorization = { - enabled = true - static { - allow_reuse = true - claim_mappings = { - node = "node" - } - list_claim_mappings = { - foo = "bar" - } - bound_issuer = "consul" - bound_audiences = ["consul-cluster-1"] - claim_assertions = ["value.node == \"${node}\""] - jwt_validation_pub_keys = ["-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERVchfCZng4mmdvQz1+sJHRN40snC\nYt8NjYOnbnScEXMkyoUmASr88gb7jaVAVt3RYASAbgBjB2Z+EUizWkx5Tg==\n-----END PUBLIC KEY-----"] - } - } - } - autopilot = { - cleanup_dead_servers = true - disable_upgrade_migration = true - last_contact_threshold = "12705s" - max_trailing_logs = 17849 - min_quorum = 3 - redundancy_zone_tag = "3IsufDJf" - server_stabilization_time = "23057s" - upgrade_version_tag = "W9pDwFAL" - } - bind_addr = "16.99.34.17" - bootstrap = true - bootstrap_expect = 53 - cache = { - entry_fetch_max_burst = 42 - entry_fetch_rate = 0.334 - }, - use_streaming_backend = true - ca_file = "erA7T0PM" - ca_path = "mQEN1Mfp" - cert_file = "7s4QAzDk" - check = { - id = "fZaCAXww" - name = "OOM2eo0f" - notes = "zXzXI9Gt" - service_id = "L8G0QNmR" - token = "oo4BCTgJ" - status = "qLykAl5u" - args = ["f3BemRjy", "e5zgpef7"] - http = "29B93haH" - header = { - hBq0zn1q = [ "2a9o9ZKP", "vKwA5lR6" ] - f3r6xFtM = [ "RyuIdDWv", "QbxEcIUM" ] - } - method = "Dou0nGT5" - body = "5PBQd2OT" - tcp = "JY6fTTcw" - interval = "18714s" - output_max_size = ` + strconv.Itoa(checks.DefaultBufSize) + ` - docker_container_id = "qF66POS9" - shell = "sOnDy228" - tls_skip_verify = true - timeout = "5954s" - ttl = "30044s" - deregister_critical_service_after = "13209s" - }, - checks = [ - { - id = "uAjE6m9Z" - name = "QsZRGpYr" - notes = "VJ7Sk4BY" - service_id = "lSulPcyz" - token = "toO59sh8" - status = "9RlWsXMV" - args = ["4BAJttck", "4D2NPtTQ"] - http = "dohLcyQ2" - header = { - "ZBfTin3L" = [ "1sDbEqYG", "lJGASsWK" ] - "Ui0nU99X" = [ "LMccm3Qe", "k5H5RggQ" ] - } - method = "aldrIQ4l" - body = "wSjTy7dg" - tcp = "RJQND605" - interval = "22164s" - output_max_size = ` + strconv.Itoa(checks.DefaultBufSize) + ` - docker_container_id = "ipgdFtjd" - shell = "qAeOYy0M" - tls_skip_verify = true - timeout = "1813s" - ttl = "21743s" - deregister_critical_service_after = "14232s" - }, - { - id = "Cqq95BhP" - name = "3qXpkS0i" - notes = "sb5qLTex" - service_id = "CmUUcRna" - token = "a3nQzHuy" - status = "irj26nf3" - args = ["9s526ogY", "gSlOHj1w"] - http = "yzhgsQ7Y" - header = { - "zcqwA8dO" = [ "qb1zx0DL", "sXCxPFsD" ] - "qxvdnSE9" = [ "6wBPUYdF", "YYh8wtSZ" ] - } - method = "gLrztrNw" - body = "0jkKgGUC" - tcp = "4jG5casb" - interval = "28767s" - output_max_size = ` + strconv.Itoa(checks.DefaultBufSize) + ` - docker_container_id = "THW6u7rL" - shell = "C1Zt3Zwh" - tls_skip_verify = true - timeout = "18506s" - ttl = "31006s" - deregister_critical_service_after = "2366s" - } - ] - check_update_interval = "16507s" - client_addr = "93.83.18.19" - config_entries { - # This is using the repeated block-to-array HCL magic - bootstrap { - kind = "proxy-defaults" - name = "global" - config { - foo = "bar" - bar = 1.0 - } - } - } - auto_encrypt = { - tls = false - dns_san = ["a.com", "b.com"] - ip_san = ["192.168.4.139", "192.168.4.140"] - allow_tls = true - } - connect { - ca_provider = "consul" - ca_config { - rotation_period = "90h" - intermediate_cert_ttl = "8760h" - leaf_cert_ttl = "1h" - # hack float since json parses numbers as float and we have to - # assert against the same thing - csr_max_per_second = 100.0 - csr_max_concurrent = 2.0 - } - enable_mesh_gateway_wan_federation = false - enabled = true - } - gossip_lan { - gossip_nodes = 6 - gossip_interval = "25252s" - retransmit_mult = 1234 - suspicion_mult = 1235 - probe_interval = "101ms" - probe_timeout = "102ms" - } - gossip_wan { - gossip_nodes = 2 - gossip_interval = "6966s" - retransmit_mult = 16384 - suspicion_mult = 16385 - probe_interval = "103ms" - probe_timeout = "104ms" - } - data_dir = "` + dataDir + `" - datacenter = "rzo029wg" - default_query_time = "16743s" - disable_anonymous_signature = true - disable_coordinates = true - disable_host_node_id = true - disable_http_unprintable_char_filter = true - disable_keyring_file = true - disable_remote_exec = true - disable_update_check = true - discard_check_output = true - discovery_max_stale = "5s" - domain = "7W1xXSqd" - alt_domain = "1789hsd" - dns_config { - allow_stale = true - a_record_limit = 29907 - disable_compression = true - enable_truncate = true - max_stale = "29685s" - node_ttl = "7084s" - only_passing = true - recursor_timeout = "4427s" - service_ttl = { - "*" = "32030s" - } - udp_answer_limit = 29909 - use_cache = true - cache_max_age = "5m" - prefer_namespace = true - } - enable_acl_replication = true - enable_agent_tls_for_checks = true - enable_central_service_config = false - enable_debug = true - enable_script_checks = true - enable_local_script_checks = true - enable_syslog = true - encrypt = "A4wELWqH" - encrypt_verify_incoming = true - encrypt_verify_outgoing = true - http_config { - block_endpoints = [ "RBvAFcGD", "fWOWFznh" ] - allow_write_http_from = [ "127.0.0.1/8", "22.33.44.55/32", "0.0.0.0/0" ] - response_headers = { - "M6TKa9NP" = "xjuxjOzQ" - "JRCrHZed" = "rl0mTx81" - } - use_cache = false - max_header_bytes = 10 - } - key_file = "IEkkwgIA" - leave_on_terminate = true - limits { - http_max_conns_per_client = 100 - https_handshake_timeout = "2391ms" - rpc_handshake_timeout = "1932ms" - rpc_rate = 12029.43 - rpc_max_burst = 44848 - rpc_max_conns_per_client = 2954 - kv_max_value_size = 1234567800000000 - txn_max_req_len = 5678000000000000 - } - log_level = "k1zo9Spt" - log_json = true - max_query_time = "18237s" - node_id = "AsUIlw99" - node_meta { - "5mgGQMBk" = "mJLtVMSG" - "A7ynFMJB" = "0Nx6RGab" - } - node_name = "otlLxGaI" - non_voting_server = true - performance { - leave_drain_time = "8265s" - raft_multiplier = 5 - rpc_hold_timeout = "15707s" - } - pid_file = "43xN80Km" - ports { - dns = 7001 - http = 7999 - https = 15127 - server = 3757 - grpc = 4881 - proxy_min_port = 2000 - proxy_max_port = 3000 - sidecar_min_port = 8888 - sidecar_max_port = 9999 - expose_min_port = 1111 - expose_max_port = 2222 - } - protocol = 30793 - primary_datacenter = "ejtmd43d" - primary_gateways = [ "aej8eeZo", "roh2KahS" ] - primary_gateways_interval = "18866s" - raft_protocol = 3 - raft_snapshot_threshold = 16384 - raft_snapshot_interval = "30s" - raft_trailing_logs = 83749 - read_replica = true - reconnect_timeout = "23739s" - reconnect_timeout_wan = "26694s" - recursors = [ "63.38.39.58", "92.49.18.18" ] - rejoin_after_leave = true - retry_interval = "8067s" - retry_interval_wan = "28866s" - retry_join = [ "pbsSFY7U", "l0qLtWij" ] - retry_join_wan = [ "PFsR02Ye", "rJdQIhER" ] - retry_max = 913 - retry_max_wan = 23160 - rpc { - enable_streaming = true - } - segment = "BC2NhTDi" - segments = [ - { - name = "PExYMe2E" - bind = "36.73.36.19" - port = 38295 - rpc_listener = true - advertise = "63.39.19.18" - }, - { - name = "UzCvJgup" - bind = "37.58.38.19" - port = 39292 - rpc_listener = true - advertise = "83.58.26.27" - } - ] - serf_lan = "99.43.63.15" - serf_wan = "67.88.33.19" - server = true - server_name = "Oerr9n1G" - service = { - id = "dLOXpSCI" - name = "o1ynPkp0" - meta = { - mymeta = "data" - } - tagged_addresses = { - lan = { - address = "2d79888a" - port = 2143 - } - wan = { - address = "d4db85e2" - port = 6109 - } - } - tags = ["nkwshvM5", "NTDWn3ek"] - address = "cOlSOhbp" - token = "msy7iWER" - port = 24237 - weights = { - passing = 100, - warning = 1 - } - enable_tag_override = true - check = { - id = "RMi85Dv8" - name = "iehanzuq" - status = "rCvn53TH" - notes = "fti5lfF3" - args = ["16WRUmwS", "QWk7j7ae"] - http = "dl3Fgme3" - header = { - rjm4DEd3 = [ "2m3m2Fls" ] - l4HwQ112 = [ "fk56MNlo", "dhLK56aZ" ] - } - method = "9afLm3Mj" - body = "wVVL2V6f" - tcp = "fjiLFqVd" - interval = "23926s" - docker_container_id = "dO5TtRHk" - shell = "e6q2ttES" - tls_skip_verify = true - timeout = "38483s" - ttl = "10943s" - deregister_critical_service_after = "68787s" - } - checks = [ - { - id = "Zv99e9Ka" - name = "sgV4F7Pk" - notes = "yP5nKbW0" - status = "7oLMEyfu" - args = ["5wEZtZpv", "0Ihyk8cS"] - http = "KyDjGY9H" - header = { - "gv5qefTz" = [ "5Olo2pMG", "PvvKWQU5" ] - "SHOVq1Vv" = [ "jntFhyym", "GYJh32pp" ] - } - method = "T66MFBfR" - body = "OwGjTFQi" - tcp = "bNnNfx2A" - interval = "22224s" - output_max_size = ` + strconv.Itoa(checks.DefaultBufSize) + ` - docker_container_id = "ipgdFtjd" - shell = "omVZq7Sz" - tls_skip_verify = true - timeout = "18913s" - ttl = "44743s" - deregister_critical_service_after = "8482s" - }, - { - id = "G79O6Mpr" - name = "IEqrzrsd" - notes = "SVqApqeM" - status = "XXkVoZXt" - args = ["wD05Bvao", "rLYB7kQC"] - http = "kyICZsn8" - header = { - "4ebP5vL4" = [ "G20SrL5Q", "DwPKlMbo" ] - "p2UI34Qz" = [ "UsG1D0Qh", "NHhRiB6s" ] - } - method = "ciYHWors" - body = "lUVLGYU7" - tcp = "FfvCwlqH" - interval = "12356s" - output_max_size = ` + strconv.Itoa(checks.DefaultBufSize) + ` - docker_container_id = "HBndBU6R" - shell = "hVI33JjA" - tls_skip_verify = true - timeout = "38282s" - ttl = "1181s" - deregister_critical_service_after = "4992s" - } - ] - connect { - native = true - } - } - services = [ - { - id = "wI1dzxS4" - name = "7IszXMQ1" - tags = ["0Zwg8l6v", "zebELdN5"] - address = "9RhqPSPB" - token = "myjKJkWH" - port = 72219 - enable_tag_override = true - check = { - id = "qmfeO5if" - name = "atDGP7n5" - status = "pDQKEhWL" - notes = "Yt8EDLev" - args = ["81EDZLPa", "bPY5X8xd"] - http = "qzHYvmJO" - header = { - UkpmZ3a3 = [ "2dfzXuxZ" ] - cVFpko4u = [ "gGqdEB6k", "9LsRo22u" ] - } - method = "X5DrovFc" - body = "WeikigLh" - tcp = "ICbxkpSF" - interval = "24392s" - output_max_size = ` + strconv.Itoa(checks.DefaultBufSize) + ` - docker_container_id = "ZKXr68Yb" - shell = "CEfzx0Fo" - tls_skip_verify = true - timeout = "38333s" - ttl = "57201s" - deregister_critical_service_after = "44214s" - } - connect { - sidecar_service {} - } - }, - { - id = "MRHVMZuD" - name = "6L6BVfgH" - tags = ["7Ale4y6o", "PMBW08hy"] - address = "R6H6g8h0" - token = "ZgY8gjMI" - port = 38292 - weights = { - passing = 1979, - warning = 6 - } - enable_tag_override = true - checks = [ - { - id = "GTti9hCo" - name = "9OOS93ne" - notes = "CQy86DH0" - status = "P0SWDvrk" - args = ["EXvkYIuG", "BATOyt6h"] - http = "u97ByEiW" - header = { - "MUlReo8L" = [ "AUZG7wHG", "gsN0Dc2N" ] - "1UJXjVrT" = [ "OJgxzTfk", "xZZrFsq7" ] - } - method = "5wkAxCUE" - body = "7CRjCJyz" - tcp = "MN3oA9D2" - interval = "32718s" - output_max_size = ` + strconv.Itoa(checks.DefaultBufSize) + ` - docker_container_id = "cU15LMet" - shell = "nEz9qz2l" - tls_skip_verify = true - timeout = "34738s" - ttl = "22773s" - deregister_critical_service_after = "84282s" - }, - { - id = "UHsDeLxG" - name = "PQSaPWlT" - notes = "jKChDOdl" - status = "5qFz6OZn" - args = ["NMtYWlT9", "vj74JXsm"] - http = "1LBDJhw4" - header = { - "cXPmnv1M" = [ "imDqfaBx", "NFxZ1bQe" ], - "vr7wY7CS" = [ "EtCoNPPL", "9vAarJ5s" ] - } - method = "wzByP903" - body = "4I8ucZgZ" - tcp = "2exjZIGE" - interval = "5656s" - output_max_size = ` + strconv.Itoa(checks.DefaultBufSize) + ` - docker_container_id = "5tDBWpfA" - shell = "rlTpLM8s" - tls_skip_verify = true - timeout = "4868s" - ttl = "11222s" - deregister_critical_service_after = "68482s" - } - ] - connect {} - }, - { - id = "Kh81CPF6" - name = "Kh81CPF6-proxy" - port = 31471 - kind = "connect-proxy" - proxy { - destination_service_name = "6L6BVfgH" - destination_service_id = "6L6BVfgH-id" - local_service_address = "127.0.0.2" - local_service_port = 23759 - config { - cedGGtZf = "pWrUNiWw" - } - upstreams = [ - { - destination_name = "KPtAj2cb" - local_bind_port = 4051 - config { - kzRnZOyd = "nUNKoL8H" - } - }, - { - destination_type = "prepared_query" - destination_namespace = "9nakw0td" - destination_name = "KSd8HsRl" - local_bind_port = 11884 - local_bind_address = "127.24.88.0" - }, - ] - expose { - checks = true - paths = [ - { - path = "/health" - local_path_port = 8080 - listener_port = 21500 - protocol = "http" - } - ] - } - } - }, - { - id = "kvVqbwSE" - kind = "mesh-gateway" - name = "gw-primary-dc" - port = 27147 - proxy { - config { - "1CuJHVfw" = "Kzqsa7yc" - } - } - } - ] - session_ttl_min = "26627s" - skip_leave_on_interrupt = true - start_join = [ "LR3hGDoG", "MwVpZ4Up" ] - start_join_wan = [ "EbFSc3nA", "kwXTh623" ] - syslog_facility = "hHv79Uia" - tagged_addresses = { - "7MYgHrYH" = "dALJAhLD" - "h6DdBy6K" = "ebrr9zZ8" - } - telemetry { - circonus_api_app = "p4QOTe9j" - circonus_api_token = "E3j35V23" - circonus_api_url = "mEMjHpGg" - circonus_broker_id = "BHlxUhed" - circonus_broker_select_tag = "13xy1gHm" - circonus_check_display_name = "DRSlQR6n" - circonus_check_force_metric_activation = "Ua5FGVYf" - circonus_check_id = "kGorutad" - circonus_check_instance_id = "rwoOL6R4" - circonus_check_search_tag = "ovT4hT4f" - circonus_check_tags = "prvO4uBl" - circonus_submission_interval = "DolzaflP" - circonus_submission_url = "gTcbS93G" - disable_hostname = true - dogstatsd_addr = "0wSndumK" - dogstatsd_tags = [ "3N81zSUB","Xtj8AnXZ" ] - filter_default = true - prefix_filter = [ "+oJotS8XJ","-cazlEhGn" ] - metrics_prefix = "ftO6DySn" - prometheus_retention_time = "15s" - statsd_address = "drce87cy" - statsite_address = "HpFwKB8R" - disable_compat_1.9 = true - } - tls_cipher_suites = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - tls_min_version = "pAOWafkR" - tls_prefer_server_cipher_suites = true - translate_wan_addrs = true - ui_config { - enabled = true - dir = "pVncV4Ey" - content_path = "qp1WRhYH" - metrics_provider = "sgnaoa_lower_case" - metrics_provider_files = ["sgnaMFoa", "dicnwkTH"] - metrics_provider_options_json = "{\"DIbVQadX\": 1}" - metrics_proxy { - base_url = "http://foo.bar" - add_headers = [ - { - name = "p3nynwc9" - value = "TYBgnN2F" - } - ] - path_allowlist = ["/aSh3cu", "/eiK/2Th"] - } - dashboard_url_templates { - u2eziu2n_lower_case = "http://lkjasd.otr" - } - } - unix_sockets = { - group = "8pFodrV8" - mode = "E8sAwOv4" - user = "E0nB1DwA" - } - verify_incoming = true - verify_incoming_https = true - verify_incoming_rpc = true - verify_outgoing = true - verify_server_hostname = true - watches = [{ - type = "key" - datacenter = "GyE6jpeW" - key = "j9lF1Tve" - handler = "90N7S4LN" - }, { - type = "keyprefix" - datacenter = "fYrl3F5d" - key = "sl3Dffu7" - args = ["dltjDJ2a", "flEa7C2d"] - }] - `} - - tail := map[string][]Source{ - "json": { - FileSource{ - Name: "tail.non-user.json", - Format: "json", - Data: ` - { - "acl_disabled_ttl": "957s", - "acl" : { - "disabled_ttl" : "957s" - }, - "ae_interval": "10003s", - "check_deregister_interval_min": "27870s", - "check_reap_interval": "10662s", - "discovery_max_stale": "5s", - "segment_limit": 24705, - "segment_name_limit": 27046, - "sync_coordinate_interval_min": "27983s", - "sync_coordinate_rate_target": 137.81 - }`, - }, - FileSource{ - Name: "tail.consul.json", - Format: "json", - Data: ` - { - "consul": { - "coordinate": { - "update_batch_size": 9244, - "update_max_batches": 15164, - "update_period": "25093s" - }, - "raft": { - "election_timeout": "31947s", - "heartbeat_timeout": "25699s", - "leader_lease_timeout": "15351s" - }, - "server": { - "health_interval": "17455s" - } - } - }`, - }, - }, - "hcl": { - FileSource{ - Name: "tail.non-user.hcl", - Format: "hcl", - Data: ` - acl_disabled_ttl = "957s" - acl = { - disabled_ttl = "957s" - } - ae_interval = "10003s" - check_deregister_interval_min = "27870s" - check_reap_interval = "10662s" - discovery_max_stale = "5s" - segment_limit = 24705 - segment_name_limit = 27046 - sync_coordinate_interval_min = "27983s" - sync_coordinate_rate_target = 137.81 - `, - }, - FileSource{ - Name: "tail.consul.hcl", - Format: "hcl", - Data: ` - consul = { - coordinate = { - update_batch_size = 9244 - update_max_batches = 15164 - update_period = "25093s" - } - raft = { - election_timeout = "31947s" - heartbeat_timeout = "25699s" - leader_lease_timeout = "15351s" - } - server = { - health_interval = "17455s" - } - } - `, - }, - }, - } - - expected := RuntimeConfig{ + expected := &RuntimeConfig{ // non-user configurable values - ACLDisabledTTL: 957 * time.Second, - AEInterval: 10003 * time.Second, - CheckDeregisterIntervalMin: 27870 * time.Second, - CheckReapInterval: 10662 * time.Second, - SegmentLimit: 24705, - SegmentNameLimit: 27046, - SyncCoordinateIntervalMin: 27983 * time.Second, - SyncCoordinateRateTarget: 137.81, + ACLDisabledTTL: 120 * time.Second, + AEInterval: time.Minute, + CheckDeregisterIntervalMin: time.Minute, + CheckReapInterval: 30 * time.Second, + SegmentLimit: 64, + SegmentNameLimit: 64, + SyncCoordinateIntervalMin: 15 * time.Second, + SyncCoordinateRateTarget: 64, Revision: "JNtPSav3", Version: "R909Hblt", VersionPrerelease: "ZT1JOQLn", // consul configuration - ConsulCoordinateUpdateBatchSize: 9244, - ConsulCoordinateUpdateMaxBatches: 15164, - ConsulCoordinateUpdatePeriod: 25093 * time.Second, - ConsulRaftElectionTimeout: 5 * 31947 * time.Second, - ConsulRaftHeartbeatTimeout: 5 * 25699 * time.Second, - ConsulRaftLeaderLeaseTimeout: 5 * 15351 * time.Second, + ConsulCoordinateUpdateBatchSize: 128, + ConsulCoordinateUpdateMaxBatches: 5, + ConsulCoordinateUpdatePeriod: 5 * time.Second, + ConsulRaftElectionTimeout: 5 * time.Second, + ConsulRaftHeartbeatTimeout: 5 * time.Second, + ConsulRaftLeaderLeaseTimeout: 2500 * time.Millisecond, GossipLANGossipInterval: 25252 * time.Second, GossipLANGossipNodes: 6, GossipLANProbeInterval: 101 * time.Millisecond, @@ -6529,7 +5048,7 @@ func TestFullConfig(t *testing.T) { GossipWANProbeTimeout: 104 * time.Millisecond, GossipWANSuspicionMult: 16385, GossipWANRetransmitMult: 16384, - ConsulServerHealthInterval: 17455 * time.Second, + ConsulServerHealthInterval: 2 * time.Second, // user configurable values @@ -6564,7 +5083,6 @@ func TestFullConfig(t *testing.T) { AutopilotServerStabilizationTime: 23057 * time.Second, AutopilotUpgradeVersionTag: "W9pDwFAL", BindAddr: ipAddr("16.99.34.17"), - Bootstrap: true, BootstrapExpect: 53, Cache: cache.Options{ EntryFetchMaxBurst: 42, @@ -6742,7 +5260,6 @@ func TestFullConfig(t *testing.T) { DataDir: dataDir, Datacenter: "rzo029wg", DefaultQueryTime: 16743 * time.Second, - DevMode: true, DisableAnonymousSignature: true, DisableCoordinates: true, DisableHostNodeID: true, @@ -6814,26 +5331,11 @@ func TestFullConfig(t *testing.T) { RetryJoinMaxAttemptsWAN: 23160, RetryJoinWAN: []string{"PFsR02Ye", "rJdQIhER"}, RPCConfig: consul.RPCConfig{EnableStreaming: true}, - SegmentName: "BC2NhTDi", - Segments: []structs.NetworkSegment{ - { - Name: "PExYMe2E", - Bind: tcpAddr("36.73.36.19:38295"), - Advertise: tcpAddr("63.39.19.18:38295"), - RPCListener: true, - }, - { - Name: "UzCvJgup", - Bind: tcpAddr("37.58.38.19:39292"), - Advertise: tcpAddr("83.58.26.27:39292"), - RPCListener: true, - }, - }, - SerfPortLAN: 8301, - SerfPortWAN: 8302, - ServerMode: true, - ServerName: "Oerr9n1G", - ServerPort: 3757, + SerfPortLAN: 8301, + SerfPortWAN: 8302, + ServerMode: true, + ServerName: "Oerr9n1G", + ServerPort: 3757, Services: []*structs.ServiceDefinition{ { ID: "wI1dzxS4", @@ -7162,7 +5664,6 @@ func TestFullConfig(t *testing.T) { TranslateWANAddrs: true, TxnMaxReqLen: 5678000000000000, UIConfig: UIConfig{ - Enabled: true, Dir: "pVncV4Ey", ContentPath: "/qp1WRhYH/", // slashes are added in parsing MetricsProvider: "sgnaoa_lower_case", @@ -7203,72 +5704,32 @@ func TestFullConfig(t *testing.T) { }, }, } + entFullRuntimeConfig(expected) - entFullRuntimeConfig(&expected) - - warns := []string{ + expectedWarns := []string{ `The 'acl_datacenter' field is deprecated. Use the 'primary_datacenter' field instead.`, `bootstrap_expect > 0: expecting 53 servers`, } + expectedWarns = append(expectedWarns, enterpriseConfigKeyWarnings...) - warns = append(warns, enterpriseConfigKeyWarnings...) - - // ensure that all fields are set to unique non-zero values - // todo(fs): This currently fails since ServiceDefinition.Check is not used - // todo(fs): not sure on how to work around this. Possible options are: - // todo(fs): * move first check into the Check field - // todo(fs): * ignore the Check field - // todo(fs): both feel like a hack + // FIXME: ensure that all fields are set to unique non-zero values. + // There are many fields that are not set to non-zero values, so this nonZero + // check does not actually work. if err := nonZero("RuntimeConfig", nil, expected); err != nil { t.Log(err) } - for format, data := range src { + for _, format := range []string{"json", "hcl"} { t.Run(format, func(t *testing.T) { - // parse the flags since this is the only way we can set the - // DevMode flag - var flags LoadOpts - fs := flag.NewFlagSet("", flag.ContinueOnError) - AddFlags(fs, &flags) - if err := fs.Parse(flagSrc); err != nil { - t.Fatalf("ParseFlags: %s", err) + opts := LoadOpts{ + ConfigFiles: []string{"testdata/full-config." + format}, + HCL: []string{fmt.Sprintf(`data_dir = "%s"`, dataDir)}, } - require.Len(t, fs.Args(), 0) - - b, err := newBuilder(flags) - if err != nil { - t.Fatalf("NewBuilder: %s", err) - } - b.Sources = append(b.Sources, FileSource{Name: "full." + format, Data: data, Format: format}) - b.Tail = append(b.Tail, tail[format]...) - b.Tail = append(b.Tail, versionSource("JNtPSav3", "R909Hblt", "ZT1JOQLn")) - - // construct the runtime config - rt, err := b.Build() - if err != nil { - t.Fatalf("Build: %s", err) - } - - require.Equal(t, expected, rt) - - // at this point we have confirmed that the parsing worked - // for all fields but the validation will fail since certain - // combinations are not allowed. Since it is not possible to have - // all fields with non-zero values and to have a valid configuration - // we are patching a handful of safe fields to make validation pass. - rt.Bootstrap = false - rt.DevMode = false - rt.UIConfig.Enabled = false - rt.SegmentName = "" - rt.Segments = nil - - // validate the runtime config - if err := b.Validate(rt); err != nil { - t.Fatalf("Validate: %s", err) - } - - // check the warnings - require.ElementsMatch(t, warns, b.Warnings, "Warnings: %#v", b.Warnings) + opts.Overrides = append(opts.Overrides, versionSource("JNtPSav3", "R909Hblt", "ZT1JOQLn")) + r, err := Load(opts) + require.NoError(t, err) + assertDeepEqual(t, expected, r.RuntimeConfig) + require.ElementsMatch(t, expectedWarns, r.Warnings, "Warnings: %#v", r.Warnings) }) } } @@ -7384,8 +5845,6 @@ func nonZero(name string, uniq map[interface{}]string, v interface{}) error { } func TestNonZero(t *testing.T) { - var empty string - tests := []struct { desc string v interface{} @@ -7406,7 +5865,7 @@ func TestNonZero(t *testing.T) { {"zero uint64", uint64(0), errors.New(`"x" is zero value`)}, {"zero float32", float32(0), errors.New(`"x" is zero value`)}, {"zero float64", float64(0), errors.New(`"x" is zero value`)}, - {"ptr to zero value", &empty, errors.New(`"*x" is zero value`)}, + {"ptr to zero value", pString(""), errors.New(`"*x" is zero value`)}, {"empty slice", []string{}, errors.New(`"x" is empty slice`)}, {"slice with zero value", []string{""}, errors.New(`"x[0]" is zero value`)}, {"empty map", map[string]string{}, errors.New(`"x" is empty map`)}, @@ -7419,9 +5878,7 @@ func TestNonZero(t *testing.T) { for _, tt := range tests { t.Run(tt.desc, func(t *testing.T) { - if got, want := nonZero("x", nil, tt.v), tt.err; !reflect.DeepEqual(got, want) { - t.Fatalf("got error %v want %v", got, want) - } + require.Equal(t, tt.err, nonZero("x", nil, tt.v)) }) } } diff --git a/agent/config/testdata/full-config.hcl b/agent/config/testdata/full-config.hcl new file mode 100644 index 000000000..f09683270 --- /dev/null +++ b/agent/config/testdata/full-config.hcl @@ -0,0 +1,668 @@ +acl_agent_master_token = "furuQD0b" +acl_agent_token = "cOshLOQ2" +acl_datacenter = "m3urck3z" +acl_default_policy = "ArK3WIfE" +acl_down_policy = "vZXMfMP0" +acl_enable_key_list_policy = true +acl_master_token = "C1Q1oIwh" +acl_replication_token = "LMmgy5dO" +acl_token = "O1El0wan" +acl_ttl = "18060s" +acl = { + enabled = true + down_policy = "03eb2aee" + default_policy = "72c2e7a0" + enable_key_list_policy = true + enable_token_persistence = true + policy_ttl = "1123s" + role_ttl = "9876s" + token_ttl = "3321s" + enable_token_replication = true + msp_disable_bootstrap = true + tokens = { + master = "8a19ac27", + agent_master = "64fd0e08", + replication = "5795983a", + agent = "bed2377c", + default = "418fdff1", + managed_service_provider = [ + { + accessor_id = "first", + secret_id = "fb0cee1f-2847-467c-99db-a897cff5fd4d" + }, + { + accessor_id = "second", + secret_id = "1046c8da-e166-4667-897a-aefb343db9db" + } + ] + } +} +addresses = { + dns = "93.95.95.81" + http = "83.39.91.39" + https = "95.17.17.19" + grpc = "32.31.61.91" +} +advertise_addr = "17.99.29.16" +advertise_addr_wan = "78.63.37.19" +advertise_reconnect_timeout = "0s" +audit = { + enabled = false +} +auto_config = { + enabled = false + intro_token = "OpBPGRwt" + intro_token_file = "gFvAXwI8" + dns_sans = ["6zdaWg9J"] + ip_sans = ["198.18.99.99"] + server_addresses = ["198.18.100.1"] + authorization = { + enabled = true + static { + allow_reuse = true + claim_mappings = { + node = "node" + } + list_claim_mappings = { + foo = "bar" + } + bound_issuer = "consul" + bound_audiences = ["consul-cluster-1"] + claim_assertions = ["value.node == \"${node}\""] + jwt_validation_pub_keys = ["-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERVchfCZng4mmdvQz1+sJHRN40snC\nYt8NjYOnbnScEXMkyoUmASr88gb7jaVAVt3RYASAbgBjB2Z+EUizWkx5Tg==\n-----END PUBLIC KEY-----"] + } + } +} +autopilot = { + cleanup_dead_servers = true + disable_upgrade_migration = true + last_contact_threshold = "12705s" + max_trailing_logs = 17849 + min_quorum = 3 + redundancy_zone_tag = "3IsufDJf" + server_stabilization_time = "23057s" + upgrade_version_tag = "W9pDwFAL" +} +bind_addr = "16.99.34.17" +bootstrap_expect = 53 +cache = { + entry_fetch_max_burst = 42 + entry_fetch_rate = 0.334 +}, +use_streaming_backend = true +ca_file = "erA7T0PM" +ca_path = "mQEN1Mfp" +cert_file = "7s4QAzDk" +check = { + id = "fZaCAXww" + name = "OOM2eo0f" + notes = "zXzXI9Gt" + service_id = "L8G0QNmR" + token = "oo4BCTgJ" + status = "qLykAl5u" + args = ["f3BemRjy", "e5zgpef7"] + http = "29B93haH" + header = { + hBq0zn1q = [ "2a9o9ZKP", "vKwA5lR6" ] + f3r6xFtM = [ "RyuIdDWv", "QbxEcIUM" ] + } + method = "Dou0nGT5" + body = "5PBQd2OT" + tcp = "JY6fTTcw" + interval = "18714s" + output_max_size = 4096 + docker_container_id = "qF66POS9" + shell = "sOnDy228" + tls_skip_verify = true + timeout = "5954s" + ttl = "30044s" + deregister_critical_service_after = "13209s" +}, +checks = [ + { + id = "uAjE6m9Z" + name = "QsZRGpYr" + notes = "VJ7Sk4BY" + service_id = "lSulPcyz" + token = "toO59sh8" + status = "9RlWsXMV" + args = ["4BAJttck", "4D2NPtTQ"] + http = "dohLcyQ2" + header = { + "ZBfTin3L" = [ "1sDbEqYG", "lJGASsWK" ] + "Ui0nU99X" = [ "LMccm3Qe", "k5H5RggQ" ] + } + method = "aldrIQ4l" + body = "wSjTy7dg" + tcp = "RJQND605" + interval = "22164s" + output_max_size = 4096 + docker_container_id = "ipgdFtjd" + shell = "qAeOYy0M" + tls_skip_verify = true + timeout = "1813s" + ttl = "21743s" + deregister_critical_service_after = "14232s" + }, + { + id = "Cqq95BhP" + name = "3qXpkS0i" + notes = "sb5qLTex" + service_id = "CmUUcRna" + token = "a3nQzHuy" + status = "irj26nf3" + args = ["9s526ogY", "gSlOHj1w"] + http = "yzhgsQ7Y" + header = { + "zcqwA8dO" = [ "qb1zx0DL", "sXCxPFsD" ] + "qxvdnSE9" = [ "6wBPUYdF", "YYh8wtSZ" ] + } + method = "gLrztrNw" + body = "0jkKgGUC" + tcp = "4jG5casb" + interval = "28767s" + output_max_size = 4096 + docker_container_id = "THW6u7rL" + shell = "C1Zt3Zwh" + tls_skip_verify = true + timeout = "18506s" + ttl = "31006s" + deregister_critical_service_after = "2366s" + } +] +check_update_interval = "16507s" +client_addr = "93.83.18.19" +config_entries { + # This is using the repeated block-to-array HCL magic + bootstrap { + kind = "proxy-defaults" + name = "global" + config { + foo = "bar" + bar = 1.0 + } + } +} +auto_encrypt = { + tls = false + dns_san = ["a.com", "b.com"] + ip_san = ["192.168.4.139", "192.168.4.140"] + allow_tls = true +} +connect { + ca_provider = "consul" + ca_config { + rotation_period = "90h" + intermediate_cert_ttl = "8760h" + leaf_cert_ttl = "1h" + # hack float since json parses numbers as float and we have to + # assert against the same thing + csr_max_per_second = 100.0 + csr_max_concurrent = 2.0 + } + enable_mesh_gateway_wan_federation = false + enabled = true +} +gossip_lan { + gossip_nodes = 6 + gossip_interval = "25252s" + retransmit_mult = 1234 + suspicion_mult = 1235 + probe_interval = "101ms" + probe_timeout = "102ms" +} +gossip_wan { + gossip_nodes = 2 + gossip_interval = "6966s" + retransmit_mult = 16384 + suspicion_mult = 16385 + probe_interval = "103ms" + probe_timeout = "104ms" +} +datacenter = "rzo029wg" +default_query_time = "16743s" +disable_anonymous_signature = true +disable_coordinates = true +disable_host_node_id = true +disable_http_unprintable_char_filter = true +disable_keyring_file = true +disable_remote_exec = true +disable_update_check = true +discard_check_output = true +discovery_max_stale = "5s" +domain = "7W1xXSqd" +alt_domain = "1789hsd" +dns_config { + allow_stale = true + a_record_limit = 29907 + disable_compression = true + enable_truncate = true + max_stale = "29685s" + node_ttl = "7084s" + only_passing = true + recursor_timeout = "4427s" + service_ttl = { + "*" = "32030s" + } + udp_answer_limit = 29909 + use_cache = true + cache_max_age = "5m" + prefer_namespace = true +} +enable_acl_replication = true +enable_agent_tls_for_checks = true +enable_central_service_config = false +enable_debug = true +enable_script_checks = true +enable_local_script_checks = true +enable_syslog = true +encrypt = "A4wELWqH" +encrypt_verify_incoming = true +encrypt_verify_outgoing = true +http_config { + block_endpoints = [ "RBvAFcGD", "fWOWFznh" ] + allow_write_http_from = [ "127.0.0.1/8", "22.33.44.55/32", "0.0.0.0/0" ] + response_headers = { + "M6TKa9NP" = "xjuxjOzQ" + "JRCrHZed" = "rl0mTx81" + } + use_cache = false + max_header_bytes = 10 +} +key_file = "IEkkwgIA" +leave_on_terminate = true +limits { + http_max_conns_per_client = 100 + https_handshake_timeout = "2391ms" + rpc_handshake_timeout = "1932ms" + rpc_rate = 12029.43 + rpc_max_burst = 44848 + rpc_max_conns_per_client = 2954 + kv_max_value_size = 1234567800000000 + txn_max_req_len = 5678000000000000 +} +log_level = "k1zo9Spt" +log_json = true +max_query_time = "18237s" +node_id = "AsUIlw99" +node_meta { + "5mgGQMBk" = "mJLtVMSG" + "A7ynFMJB" = "0Nx6RGab" +} +node_name = "otlLxGaI" +non_voting_server = true +performance { + leave_drain_time = "8265s" + raft_multiplier = 5 + rpc_hold_timeout = "15707s" +} +pid_file = "43xN80Km" +ports { + dns = 7001 + http = 7999 + https = 15127 + server = 3757 + grpc = 4881 + proxy_min_port = 2000 + proxy_max_port = 3000 + sidecar_min_port = 8888 + sidecar_max_port = 9999 + expose_min_port = 1111 + expose_max_port = 2222 +} +protocol = 30793 +primary_datacenter = "ejtmd43d" +primary_gateways = [ "aej8eeZo", "roh2KahS" ] +primary_gateways_interval = "18866s" +raft_protocol = 3 +raft_snapshot_threshold = 16384 +raft_snapshot_interval = "30s" +raft_trailing_logs = 83749 +read_replica = true +reconnect_timeout = "23739s" +reconnect_timeout_wan = "26694s" +recursors = [ "63.38.39.58", "92.49.18.18" ] +rejoin_after_leave = true +retry_interval = "8067s" +retry_interval_wan = "28866s" +retry_join = [ "pbsSFY7U", "l0qLtWij" ] +retry_join_wan = [ "PFsR02Ye", "rJdQIhER" ] +retry_max = 913 +retry_max_wan = 23160 +rpc { + enable_streaming = true +} +serf_lan = "99.43.63.15" +serf_wan = "67.88.33.19" +server = true +server_name = "Oerr9n1G" +service = { + id = "dLOXpSCI" + name = "o1ynPkp0" + meta = { + mymeta = "data" + } + tagged_addresses = { + lan = { + address = "2d79888a" + port = 2143 + } + wan = { + address = "d4db85e2" + port = 6109 + } + } + tags = ["nkwshvM5", "NTDWn3ek"] + address = "cOlSOhbp" + token = "msy7iWER" + port = 24237 + weights = { + passing = 100, + warning = 1 + } + enable_tag_override = true + check = { + id = "RMi85Dv8" + name = "iehanzuq" + status = "rCvn53TH" + notes = "fti5lfF3" + args = ["16WRUmwS", "QWk7j7ae"] + http = "dl3Fgme3" + header = { + rjm4DEd3 = [ "2m3m2Fls" ] + l4HwQ112 = [ "fk56MNlo", "dhLK56aZ" ] + } + method = "9afLm3Mj" + body = "wVVL2V6f" + tcp = "fjiLFqVd" + interval = "23926s" + docker_container_id = "dO5TtRHk" + shell = "e6q2ttES" + tls_skip_verify = true + timeout = "38483s" + ttl = "10943s" + deregister_critical_service_after = "68787s" + } + checks = [ + { + id = "Zv99e9Ka" + name = "sgV4F7Pk" + notes = "yP5nKbW0" + status = "7oLMEyfu" + args = ["5wEZtZpv", "0Ihyk8cS"] + http = "KyDjGY9H" + header = { + "gv5qefTz" = [ "5Olo2pMG", "PvvKWQU5" ] + "SHOVq1Vv" = [ "jntFhyym", "GYJh32pp" ] + } + method = "T66MFBfR" + body = "OwGjTFQi" + tcp = "bNnNfx2A" + interval = "22224s" + output_max_size = 4096 + docker_container_id = "ipgdFtjd" + shell = "omVZq7Sz" + tls_skip_verify = true + timeout = "18913s" + ttl = "44743s" + deregister_critical_service_after = "8482s" + }, + { + id = "G79O6Mpr" + name = "IEqrzrsd" + notes = "SVqApqeM" + status = "XXkVoZXt" + args = ["wD05Bvao", "rLYB7kQC"] + http = "kyICZsn8" + header = { + "4ebP5vL4" = [ "G20SrL5Q", "DwPKlMbo" ] + "p2UI34Qz" = [ "UsG1D0Qh", "NHhRiB6s" ] + } + method = "ciYHWors" + body = "lUVLGYU7" + tcp = "FfvCwlqH" + interval = "12356s" + output_max_size = 4096 + docker_container_id = "HBndBU6R" + shell = "hVI33JjA" + tls_skip_verify = true + timeout = "38282s" + ttl = "1181s" + deregister_critical_service_after = "4992s" + } + ] + connect { + native = true + } +} +services = [ + { + id = "wI1dzxS4" + name = "7IszXMQ1" + tags = ["0Zwg8l6v", "zebELdN5"] + address = "9RhqPSPB" + token = "myjKJkWH" + port = 72219 + enable_tag_override = true + check = { + id = "qmfeO5if" + name = "atDGP7n5" + status = "pDQKEhWL" + notes = "Yt8EDLev" + args = ["81EDZLPa", "bPY5X8xd"] + http = "qzHYvmJO" + header = { + UkpmZ3a3 = [ "2dfzXuxZ" ] + cVFpko4u = [ "gGqdEB6k", "9LsRo22u" ] + } + method = "X5DrovFc" + body = "WeikigLh" + tcp = "ICbxkpSF" + interval = "24392s" + output_max_size = 4096 + docker_container_id = "ZKXr68Yb" + shell = "CEfzx0Fo" + tls_skip_verify = true + timeout = "38333s" + ttl = "57201s" + deregister_critical_service_after = "44214s" + } + connect { + sidecar_service {} + } + }, + { + id = "MRHVMZuD" + name = "6L6BVfgH" + tags = ["7Ale4y6o", "PMBW08hy"] + address = "R6H6g8h0" + token = "ZgY8gjMI" + port = 38292 + weights = { + passing = 1979, + warning = 6 + } + enable_tag_override = true + checks = [ + { + id = "GTti9hCo" + name = "9OOS93ne" + notes = "CQy86DH0" + status = "P0SWDvrk" + args = ["EXvkYIuG", "BATOyt6h"] + http = "u97ByEiW" + header = { + "MUlReo8L" = [ "AUZG7wHG", "gsN0Dc2N" ] + "1UJXjVrT" = [ "OJgxzTfk", "xZZrFsq7" ] + } + method = "5wkAxCUE" + body = "7CRjCJyz" + tcp = "MN3oA9D2" + interval = "32718s" + output_max_size = 4096 + docker_container_id = "cU15LMet" + shell = "nEz9qz2l" + tls_skip_verify = true + timeout = "34738s" + ttl = "22773s" + deregister_critical_service_after = "84282s" + }, + { + id = "UHsDeLxG" + name = "PQSaPWlT" + notes = "jKChDOdl" + status = "5qFz6OZn" + args = ["NMtYWlT9", "vj74JXsm"] + http = "1LBDJhw4" + header = { + "cXPmnv1M" = [ "imDqfaBx", "NFxZ1bQe" ], + "vr7wY7CS" = [ "EtCoNPPL", "9vAarJ5s" ] + } + method = "wzByP903" + body = "4I8ucZgZ" + tcp = "2exjZIGE" + interval = "5656s" + output_max_size = 4096 + docker_container_id = "5tDBWpfA" + shell = "rlTpLM8s" + tls_skip_verify = true + timeout = "4868s" + ttl = "11222s" + deregister_critical_service_after = "68482s" + } + ] + connect {} + }, + { + id = "Kh81CPF6" + name = "Kh81CPF6-proxy" + port = 31471 + kind = "connect-proxy" + proxy { + destination_service_name = "6L6BVfgH" + destination_service_id = "6L6BVfgH-id" + local_service_address = "127.0.0.2" + local_service_port = 23759 + config { + cedGGtZf = "pWrUNiWw" + } + upstreams = [ + { + destination_name = "KPtAj2cb" + local_bind_port = 4051 + config { + kzRnZOyd = "nUNKoL8H" + } + }, + { + destination_type = "prepared_query" + destination_namespace = "9nakw0td" + destination_name = "KSd8HsRl" + local_bind_port = 11884 + local_bind_address = "127.24.88.0" + }, + ] + expose { + checks = true + paths = [ + { + path = "/health" + local_path_port = 8080 + listener_port = 21500 + protocol = "http" + } + ] + } + } + }, + { + id = "kvVqbwSE" + kind = "mesh-gateway" + name = "gw-primary-dc" + port = 27147 + proxy { + config { + "1CuJHVfw" = "Kzqsa7yc" + } + } + } +] +session_ttl_min = "26627s" +skip_leave_on_interrupt = true +start_join = [ "LR3hGDoG", "MwVpZ4Up" ] +start_join_wan = [ "EbFSc3nA", "kwXTh623" ] +syslog_facility = "hHv79Uia" +tagged_addresses = { + "7MYgHrYH" = "dALJAhLD" + "h6DdBy6K" = "ebrr9zZ8" +} +telemetry { + circonus_api_app = "p4QOTe9j" + circonus_api_token = "E3j35V23" + circonus_api_url = "mEMjHpGg" + circonus_broker_id = "BHlxUhed" + circonus_broker_select_tag = "13xy1gHm" + circonus_check_display_name = "DRSlQR6n" + circonus_check_force_metric_activation = "Ua5FGVYf" + circonus_check_id = "kGorutad" + circonus_check_instance_id = "rwoOL6R4" + circonus_check_search_tag = "ovT4hT4f" + circonus_check_tags = "prvO4uBl" + circonus_submission_interval = "DolzaflP" + circonus_submission_url = "gTcbS93G" + disable_hostname = true + dogstatsd_addr = "0wSndumK" + dogstatsd_tags = [ "3N81zSUB","Xtj8AnXZ" ] + filter_default = true + prefix_filter = [ "+oJotS8XJ","-cazlEhGn" ] + metrics_prefix = "ftO6DySn" + prometheus_retention_time = "15s" + statsd_address = "drce87cy" + statsite_address = "HpFwKB8R" + disable_compat_1.9 = true +} +tls_cipher_suites = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +tls_min_version = "pAOWafkR" +tls_prefer_server_cipher_suites = true +translate_wan_addrs = true +ui_config { + dir = "pVncV4Ey" + content_path = "qp1WRhYH" + metrics_provider = "sgnaoa_lower_case" + metrics_provider_files = ["sgnaMFoa", "dicnwkTH"] + metrics_provider_options_json = "{\"DIbVQadX\": 1}" + metrics_proxy { + base_url = "http://foo.bar" + add_headers = [ + { + name = "p3nynwc9" + value = "TYBgnN2F" + } + ] + path_allowlist = ["/aSh3cu", "/eiK/2Th"] + } + dashboard_url_templates { + u2eziu2n_lower_case = "http://lkjasd.otr" + } +} +unix_sockets = { + group = "8pFodrV8" + mode = "E8sAwOv4" + user = "E0nB1DwA" +} +verify_incoming = true +verify_incoming_https = true +verify_incoming_rpc = true +verify_outgoing = true +verify_server_hostname = true +watches = [{ + type = "key" + datacenter = "GyE6jpeW" + key = "j9lF1Tve" + handler = "90N7S4LN" +}, { + type = "keyprefix" + datacenter = "fYrl3F5d" + key = "sl3Dffu7" + args = ["dltjDJ2a", "flEa7C2d"] +}] \ No newline at end of file diff --git a/agent/config/testdata/full-config.json b/agent/config/testdata/full-config.json new file mode 100644 index 000000000..d5e7e41a7 --- /dev/null +++ b/agent/config/testdata/full-config.json @@ -0,0 +1,668 @@ +{ + "acl_agent_master_token": "furuQD0b", + "acl_agent_token": "cOshLOQ2", + "acl_datacenter": "m3urck3z", + "acl_default_policy": "ArK3WIfE", + "acl_down_policy": "vZXMfMP0", + "acl_enable_key_list_policy": true, + "acl_master_token": "C1Q1oIwh", + "acl_replication_token": "LMmgy5dO", + "acl_token": "O1El0wan", + "acl_ttl": "18060s", + "acl" : { + "enabled" : true, + "down_policy" : "03eb2aee", + "default_policy" : "72c2e7a0", + "enable_key_list_policy": true, + "enable_token_persistence": true, + "policy_ttl": "1123s", + "role_ttl": "9876s", + "token_ttl": "3321s", + "enable_token_replication" : true, + "msp_disable_bootstrap": true, + "tokens" : { + "master" : "8a19ac27", + "agent_master" : "64fd0e08", + "replication" : "5795983a", + "agent" : "bed2377c", + "default" : "418fdff1", + "managed_service_provider": [ + { + "accessor_id": "first", + "secret_id": "fb0cee1f-2847-467c-99db-a897cff5fd4d" + }, + { + "accessor_id": "second", + "secret_id": "1046c8da-e166-4667-897a-aefb343db9db" + } + ] + } + }, + "addresses": { + "dns": "93.95.95.81", + "http": "83.39.91.39", + "https": "95.17.17.19", + "grpc": "32.31.61.91" + }, + "advertise_addr": "17.99.29.16", + "advertise_addr_wan": "78.63.37.19", + "advertise_reconnect_timeout": "0s", + "audit": { + "enabled": false + }, + "auto_config": { + "enabled": false, + "intro_token": "OpBPGRwt", + "intro_token_file": "gFvAXwI8", + "dns_sans": ["6zdaWg9J"], + "ip_sans": ["198.18.99.99"], + "server_addresses": ["198.18.100.1"], + "authorization": { + "enabled": true, + "static": { + "allow_reuse": true, + "claim_mappings": { + "node": "node" + }, + "list_claim_mappings": { + "foo": "bar" + }, + "bound_issuer": "consul", + "bound_audiences": ["consul-cluster-1"], + "claim_assertions": ["value.node == \"${node}\""], + "jwt_validation_pub_keys": ["-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERVchfCZng4mmdvQz1+sJHRN40snC\nYt8NjYOnbnScEXMkyoUmASr88gb7jaVAVt3RYASAbgBjB2Z+EUizWkx5Tg==\n-----END PUBLIC KEY-----"] + } + } + }, + "autopilot": { + "cleanup_dead_servers": true, + "disable_upgrade_migration": true, + "last_contact_threshold": "12705s", + "max_trailing_logs": 17849, + "min_quorum": 3, + "redundancy_zone_tag": "3IsufDJf", + "server_stabilization_time": "23057s", + "upgrade_version_tag": "W9pDwFAL" + }, + "bind_addr": "16.99.34.17", + "bootstrap_expect": 53, + "cache": { + "entry_fetch_max_burst": 42, + "entry_fetch_rate": 0.334 + }, + "use_streaming_backend": true, + "ca_file": "erA7T0PM", + "ca_path": "mQEN1Mfp", + "cert_file": "7s4QAzDk", + "check": { + "id": "fZaCAXww", + "name": "OOM2eo0f", + "notes": "zXzXI9Gt", + "service_id": "L8G0QNmR", + "token": "oo4BCTgJ", + "status": "qLykAl5u", + "args": ["f3BemRjy", "e5zgpef7"], + "http": "29B93haH", + "header": { + "hBq0zn1q": [ "2a9o9ZKP", "vKwA5lR6" ], + "f3r6xFtM": [ "RyuIdDWv", "QbxEcIUM" ] + }, + "method": "Dou0nGT5", + "body": "5PBQd2OT", + "output_max_size": 4096, + "tcp": "JY6fTTcw", + "interval": "18714s", + "docker_container_id": "qF66POS9", + "shell": "sOnDy228", + "tls_skip_verify": true, + "timeout": "5954s", + "ttl": "30044s", + "deregister_critical_service_after": "13209s" + }, + "checks": [ + { + "id": "uAjE6m9Z", + "name": "QsZRGpYr", + "notes": "VJ7Sk4BY", + "service_id": "lSulPcyz", + "token": "toO59sh8", + "status": "9RlWsXMV", + "args": ["4BAJttck", "4D2NPtTQ"], + "http": "dohLcyQ2", + "header": { + "ZBfTin3L": [ "1sDbEqYG", "lJGASsWK" ], + "Ui0nU99X": [ "LMccm3Qe", "k5H5RggQ" ] + }, + "method": "aldrIQ4l", + "body": "wSjTy7dg", + "tcp": "RJQND605", + "interval": "22164s", + "output_max_size": 4096, + "docker_container_id": "ipgdFtjd", + "shell": "qAeOYy0M", + "tls_skip_verify": true, + "timeout": "1813s", + "ttl": "21743s", + "deregister_critical_service_after": "14232s" + }, + { + "id": "Cqq95BhP", + "name": "3qXpkS0i", + "notes": "sb5qLTex", + "service_id": "CmUUcRna", + "token": "a3nQzHuy", + "status": "irj26nf3", + "args": ["9s526ogY", "gSlOHj1w"], + "http": "yzhgsQ7Y", + "header": { + "zcqwA8dO": [ "qb1zx0DL", "sXCxPFsD" ], + "qxvdnSE9": [ "6wBPUYdF", "YYh8wtSZ" ] + }, + "method": "gLrztrNw", + "body": "0jkKgGUC", + "tcp": "4jG5casb", + "interval": "28767s", + "output_max_size": 4096, + "docker_container_id": "THW6u7rL", + "shell": "C1Zt3Zwh", + "tls_skip_verify": true, + "timeout": "18506s", + "ttl": "31006s", + "deregister_critical_service_after": "2366s" + } + ], + "check_update_interval": "16507s", + "client_addr": "93.83.18.19", + "config_entries": { + "bootstrap": [ + { + "kind": "proxy-defaults", + "name": "global", + "config": { + "foo": "bar", + "bar": 1.0 + } + } + ] + }, + "auto_encrypt": { + "tls": false, + "dns_san": ["a.com", "b.com"], + "ip_san": ["192.168.4.139", "192.168.4.140"], + "allow_tls": true + }, + "connect": { + "ca_provider": "consul", + "ca_config": { + "rotation_period": "90h", + "intermediate_cert_ttl": "8760h", + "leaf_cert_ttl": "1h", + "csr_max_per_second": 100, + "csr_max_concurrent": 2 + }, + "enable_mesh_gateway_wan_federation": false, + "enabled": true + }, + "gossip_lan" : { + "gossip_nodes": 6, + "gossip_interval" : "25252s", + "retransmit_mult" : 1234, + "suspicion_mult" : 1235, + "probe_interval" : "101ms", + "probe_timeout" : "102ms" + }, + "gossip_wan" : { + "gossip_nodes" : 2, + "gossip_interval" : "6966s", + "retransmit_mult" : 16384, + "suspicion_mult" : 16385, + "probe_interval" : "103ms", + "probe_timeout" : "104ms" + }, + "datacenter": "rzo029wg", + "default_query_time": "16743s", + "disable_anonymous_signature": true, + "disable_coordinates": true, + "disable_host_node_id": true, + "disable_http_unprintable_char_filter": true, + "disable_keyring_file": true, + "disable_remote_exec": true, + "disable_update_check": true, + "discard_check_output": true, + "discovery_max_stale": "5s", + "domain": "7W1xXSqd", + "alt_domain": "1789hsd", + "dns_config": { + "allow_stale": true, + "a_record_limit": 29907, + "disable_compression": true, + "enable_truncate": true, + "max_stale": "29685s", + "node_ttl": "7084s", + "only_passing": true, + "recursor_timeout": "4427s", + "service_ttl": { + "*": "32030s" + }, + "udp_answer_limit": 29909, + "use_cache": true, + "cache_max_age": "5m", + "prefer_namespace": true + }, + "enable_acl_replication": true, + "enable_agent_tls_for_checks": true, + "enable_central_service_config": false, + "enable_debug": true, + "enable_script_checks": true, + "enable_local_script_checks": true, + "enable_syslog": true, + "encrypt": "A4wELWqH", + "encrypt_verify_incoming": true, + "encrypt_verify_outgoing": true, + "http_config": { + "block_endpoints": [ "RBvAFcGD", "fWOWFznh" ], + "allow_write_http_from": [ "127.0.0.1/8", "22.33.44.55/32", "0.0.0.0/0" ], + "response_headers": { + "M6TKa9NP": "xjuxjOzQ", + "JRCrHZed": "rl0mTx81" + }, + "use_cache": false, + "max_header_bytes": 10 + }, + "key_file": "IEkkwgIA", + "leave_on_terminate": true, + "limits": { + "http_max_conns_per_client": 100, + "https_handshake_timeout": "2391ms", + "rpc_handshake_timeout": "1932ms", + "rpc_rate": 12029.43, + "rpc_max_burst": 44848, + "rpc_max_conns_per_client": 2954, + "kv_max_value_size": 1234567800000000, + "txn_max_req_len": 5678000000000000 + }, + "log_level": "k1zo9Spt", + "log_json": true, + "max_query_time": "18237s", + "node_id": "AsUIlw99", + "node_meta": { + "5mgGQMBk": "mJLtVMSG", + "A7ynFMJB": "0Nx6RGab" + }, + "node_name": "otlLxGaI", + "non_voting_server": true, + "performance": { + "leave_drain_time": "8265s", + "raft_multiplier": 5, + "rpc_hold_timeout": "15707s" + }, + "pid_file": "43xN80Km", + "ports": { + "dns": 7001, + "http": 7999, + "https": 15127, + "server": 3757, + "grpc": 4881, + "sidecar_min_port": 8888, + "sidecar_max_port": 9999, + "expose_min_port": 1111, + "expose_max_port": 2222 + }, + "protocol": 30793, + "primary_datacenter": "ejtmd43d", + "primary_gateways": [ "aej8eeZo", "roh2KahS" ], + "primary_gateways_interval": "18866s", + "raft_protocol": 3, + "raft_snapshot_threshold": 16384, + "raft_snapshot_interval": "30s", + "raft_trailing_logs": 83749, + "read_replica": true, + "reconnect_timeout": "23739s", + "reconnect_timeout_wan": "26694s", + "recursors": [ "63.38.39.58", "92.49.18.18" ], + "rejoin_after_leave": true, + "retry_interval": "8067s", + "retry_interval_wan": "28866s", + "retry_join": [ "pbsSFY7U", "l0qLtWij" ], + "retry_join_wan": [ "PFsR02Ye", "rJdQIhER" ], + "retry_max": 913, + "retry_max_wan": 23160, + "rpc": {"enable_streaming": true}, + "serf_lan": "99.43.63.15", + "serf_wan": "67.88.33.19", + "server": true, + "server_name": "Oerr9n1G", + "service": { + "id": "dLOXpSCI", + "name": "o1ynPkp0", + "meta": { + "mymeta": "data" + }, + "tagged_addresses": { + "lan": { + "address": "2d79888a", + "port": 2143 + }, + "wan": { + "address": "d4db85e2", + "port": 6109 + } + }, + "tags": ["nkwshvM5", "NTDWn3ek"], + "address": "cOlSOhbp", + "token": "msy7iWER", + "port": 24237, + "weights": { + "passing": 100, + "warning": 1 + }, + "enable_tag_override": true, + "check": { + "id": "RMi85Dv8", + "name": "iehanzuq", + "status": "rCvn53TH", + "notes": "fti5lfF3", + "args": ["16WRUmwS", "QWk7j7ae"], + "http": "dl3Fgme3", + "header": { + "rjm4DEd3": ["2m3m2Fls"], + "l4HwQ112": ["fk56MNlo", "dhLK56aZ"] + }, + "method": "9afLm3Mj", + "body": "wVVL2V6f", + "tcp": "fjiLFqVd", + "interval": "23926s", + "output_max_size": 4096, + "docker_container_id": "dO5TtRHk", + "shell": "e6q2ttES", + "tls_skip_verify": true, + "timeout": "38483s", + "ttl": "10943s", + "deregister_critical_service_after": "68787s" + }, + "checks": [ + { + "id": "Zv99e9Ka", + "name": "sgV4F7Pk", + "notes": "yP5nKbW0", + "status": "7oLMEyfu", + "args": ["5wEZtZpv", "0Ihyk8cS"], + "http": "KyDjGY9H", + "header": { + "gv5qefTz": [ "5Olo2pMG", "PvvKWQU5" ], + "SHOVq1Vv": [ "jntFhyym", "GYJh32pp" ] + }, + "method": "T66MFBfR", + "body": "OwGjTFQi", + "tcp": "bNnNfx2A", + "interval": "22224s", + "output_max_size": 4096, + "docker_container_id": "ipgdFtjd", + "shell": "omVZq7Sz", + "tls_skip_verify": true, + "timeout": "18913s", + "ttl": "44743s", + "deregister_critical_service_after": "8482s" + }, + { + "id": "G79O6Mpr", + "name": "IEqrzrsd", + "notes": "SVqApqeM", + "status": "XXkVoZXt", + "args": ["wD05Bvao", "rLYB7kQC"], + "http": "kyICZsn8", + "header": { + "4ebP5vL4": [ "G20SrL5Q", "DwPKlMbo" ], + "p2UI34Qz": [ "UsG1D0Qh", "NHhRiB6s" ] + }, + "method": "ciYHWors", + "body": "lUVLGYU7", + "tcp": "FfvCwlqH", + "interval": "12356s", + "output_max_size": 4096, + "docker_container_id": "HBndBU6R", + "shell": "hVI33JjA", + "tls_skip_verify": true, + "timeout": "38282s", + "ttl": "1181s", + "deregister_critical_service_after": "4992s" + } + ], + "connect": { + "native": true + } + }, + "services": [ + { + "id": "wI1dzxS4", + "name": "7IszXMQ1", + "tags": ["0Zwg8l6v", "zebELdN5"], + "address": "9RhqPSPB", + "token": "myjKJkWH", + "port": 72219, + "enable_tag_override": true, + "check": { + "id": "qmfeO5if", + "name": "atDGP7n5", + "status": "pDQKEhWL", + "notes": "Yt8EDLev", + "args": ["81EDZLPa", "bPY5X8xd"], + "http": "qzHYvmJO", + "header": { + "UkpmZ3a3": ["2dfzXuxZ"], + "cVFpko4u": ["gGqdEB6k", "9LsRo22u"] + }, + "method": "X5DrovFc", + "body": "WeikigLh", + "tcp": "ICbxkpSF", + "interval": "24392s", + "output_max_size": 4096, + "docker_container_id": "ZKXr68Yb", + "shell": "CEfzx0Fo", + "tls_skip_verify": true, + "timeout": "38333s", + "ttl": "57201s", + "deregister_critical_service_after": "44214s" + }, + "connect": { + "sidecar_service": {} + } + }, + { + "id": "MRHVMZuD", + "name": "6L6BVfgH", + "tags": ["7Ale4y6o", "PMBW08hy"], + "address": "R6H6g8h0", + "token": "ZgY8gjMI", + "port": 38292, + "weights": { + "passing": 1979, + "warning": 6 + }, + "enable_tag_override": true, + "checks": [ + { + "id": "GTti9hCo", + "name": "9OOS93ne", + "notes": "CQy86DH0", + "status": "P0SWDvrk", + "args": ["EXvkYIuG", "BATOyt6h"], + "http": "u97ByEiW", + "header": { + "MUlReo8L": [ "AUZG7wHG", "gsN0Dc2N" ], + "1UJXjVrT": [ "OJgxzTfk", "xZZrFsq7" ] + }, + "method": "5wkAxCUE", + "body": "7CRjCJyz", + "tcp": "MN3oA9D2", + "interval": "32718s", + "output_max_size": 4096, + "docker_container_id": "cU15LMet", + "shell": "nEz9qz2l", + "tls_skip_verify": true, + "timeout": "34738s", + "ttl": "22773s", + "deregister_critical_service_after": "84282s" + }, + { + "id": "UHsDeLxG", + "name": "PQSaPWlT", + "notes": "jKChDOdl", + "status": "5qFz6OZn", + "args": ["NMtYWlT9", "vj74JXsm"], + "http": "1LBDJhw4", + "header": { + "cXPmnv1M": [ "imDqfaBx", "NFxZ1bQe" ], + "vr7wY7CS": [ "EtCoNPPL", "9vAarJ5s" ] + }, + "method": "wzByP903", + "body": "4I8ucZgZ", + "tcp": "2exjZIGE", + "interval": "5656s", + "output_max_size": 4096, + "docker_container_id": "5tDBWpfA", + "shell": "rlTpLM8s", + "tls_skip_verify": true, + "timeout": "4868s", + "ttl": "11222s", + "deregister_critical_service_after": "68482s" + } + ], + "connect": {} + }, + { + "id": "Kh81CPF6", + "kind": "connect-proxy", + "name": "Kh81CPF6-proxy", + "port": 31471, + "proxy": { + "config": { + "cedGGtZf": "pWrUNiWw" + }, + "destination_service_id": "6L6BVfgH-id", + "destination_service_name": "6L6BVfgH", + "local_service_address": "127.0.0.2", + "local_service_port": 23759, + "expose": { + "checks": true, + "paths": [ + { + "path": "/health", + "local_path_port": 8080, + "listener_port": 21500, + "protocol": "http" + } + ] + }, + "upstreams": [ + { + "destination_name": "KPtAj2cb", + "local_bind_port": 4051, + "config": { + "kzRnZOyd": "nUNKoL8H" + } + }, + { + "destination_name": "KSd8HsRl", + "destination_namespace": "9nakw0td", + "destination_type": "prepared_query", + "local_bind_address": "127.24.88.0", + "local_bind_port": 11884 + } + ] + } + }, + { + "id": "kvVqbwSE", + "kind": "mesh-gateway", + "name": "gw-primary-dc", + "port": 27147, + "proxy": { + "config": { + "1CuJHVfw" : "Kzqsa7yc" + } + } + } + ], + "session_ttl_min": "26627s", + "skip_leave_on_interrupt": true, + "start_join": [ "LR3hGDoG", "MwVpZ4Up" ], + "start_join_wan": [ "EbFSc3nA", "kwXTh623" ], + "syslog_facility": "hHv79Uia", + "tagged_addresses": { + "7MYgHrYH": "dALJAhLD", + "h6DdBy6K": "ebrr9zZ8" + }, + "telemetry": { + "circonus_api_app": "p4QOTe9j", + "circonus_api_token": "E3j35V23", + "circonus_api_url": "mEMjHpGg", + "circonus_broker_id": "BHlxUhed", + "circonus_broker_select_tag": "13xy1gHm", + "circonus_check_display_name": "DRSlQR6n", + "circonus_check_force_metric_activation": "Ua5FGVYf", + "circonus_check_id": "kGorutad", + "circonus_check_instance_id": "rwoOL6R4", + "circonus_check_search_tag": "ovT4hT4f", + "circonus_check_tags": "prvO4uBl", + "circonus_submission_interval": "DolzaflP", + "circonus_submission_url": "gTcbS93G", + "disable_hostname": true, + "dogstatsd_addr": "0wSndumK", + "dogstatsd_tags": [ "3N81zSUB","Xtj8AnXZ" ], + "filter_default": true, + "prefix_filter": [ "+oJotS8XJ","-cazlEhGn" ], + "metrics_prefix": "ftO6DySn", + "prometheus_retention_time": "15s", + "statsd_address": "drce87cy", + "statsite_address": "HpFwKB8R", + "disable_compat_1.9": true + }, + "tls_cipher_suites": "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + "tls_min_version": "pAOWafkR", + "tls_prefer_server_cipher_suites": true, + "translate_wan_addrs": true, + "ui_config": { + "dir": "pVncV4Ey", + "content_path": "qp1WRhYH", + "metrics_provider": "sgnaoa_lower_case", + "metrics_provider_files": ["sgnaMFoa", "dicnwkTH"], + "metrics_provider_options_json": "{\"DIbVQadX\": 1}", + "metrics_proxy": { + "base_url": "http://foo.bar", + "add_headers": [ + { + "name": "p3nynwc9", + "value": "TYBgnN2F" + } + ], + "path_allowlist": ["/aSh3cu", "/eiK/2Th"] + }, + "dashboard_url_templates": { + "u2eziu2n_lower_case": "http://lkjasd.otr" + } + }, + "unix_sockets": { + "group": "8pFodrV8", + "mode": "E8sAwOv4", + "user": "E0nB1DwA" + }, + "verify_incoming": true, + "verify_incoming_https": true, + "verify_incoming_rpc": true, + "verify_outgoing": true, + "verify_server_hostname": true, + "watches": [ + { + "type": "key", + "datacenter": "GyE6jpeW", + "key": "j9lF1Tve", + "handler": "90N7S4LN" + }, { + "type": "keyprefix", + "datacenter": "fYrl3F5d", + "key": "sl3Dffu7", + "args": ["dltjDJ2a", "flEa7C2d"] + } + ] +} \ No newline at end of file diff --git a/command/agent/agent.go b/command/agent/agent.go index ebce7c92c..b7574f039 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -38,8 +38,10 @@ func New(ui cli.Ui, revision, version, versionPre, versionHuman string, shutdown versionPrerelease: versionPre, versionHuman: versionHuman, shutdownCh: shutdownCh, + flags: flag.NewFlagSet("", flag.ContinueOnError), } - c.init() + config.AddFlags(c.flags, &c.configLoadOpts) + c.help = flags.Usage(help, c.flags) return c } @@ -61,12 +63,6 @@ type cmd struct { logger hclog.InterceptLogger } -func (c *cmd) init() { - c.flags = flag.NewFlagSet("", flag.ContinueOnError) - config.AddFlags(c.flags, &c.configLoadOpts) - c.help = flags.Usage(help, c.flags) -} - func (c *cmd) Run(args []string) int { code := c.run(args) if c.logger != nil { diff --git a/contributing/checklist-adding-config-fields.md b/contributing/checklist-adding-config-fields.md index fc0679b2c..b64002471 100644 --- a/contributing/checklist-adding-config-fields.md +++ b/contributing/checklist-adding-config-fields.md @@ -29,10 +29,10 @@ There are four specific cases covered with increasing complexity: `agent/config/runtime.go`. - [ ] Add an appropriate parser/setter in `agent/config/builder.go` to translate. - - [ ] Add the new field with a random value to both the JSON and HCL blobs in - `TestFullConfig` in `agent/config/runtime_test.go`, it should fail now, then - add the same random value to the expected struct in that test so it passes - again. + - [ ] Add the new field with a random value to both the JSON and HCL files in + `agent/config/testdata/full-config.*`, which should cause the test to fail. + Then update the expected value in `TestLoad_FullConfig` in + `agent/config/runtime_test.go` to make the test pass again. - [ ] Run `go test -run TestRuntimeConfig_Sanitize ./agent/config -update` to update the expected value for `TestRuntimeConfig_Sanitize`. Look at `git diff` to make sure the value changed as you expect.