From 83a2e726dce252c8eccf95863e938b7a4d3330d6 Mon Sep 17 00:00:00 2001 From: Semir Patel Date: Wed, 23 Aug 2023 11:55:18 -0500 Subject: [PATCH] [BACKPORT] 1.15.x manual backport of OSS->CE branch (#18552) OSS -> CE (community edition) changes (#18517) --- .github/scripts/get_runner_classes.sh | 2 +- .github/workflows/build-artifacts.yml | 2 +- .github/workflows/build.yml | 1 + ...merge-trigger.yml => ce-merge-trigger.yml} | 7 +++-- .github/workflows/frontend.yml | 2 +- .github/workflows/go-tests.yml | 8 +++--- .github/workflows/nightly-test-1.11.x.yaml | 28 +++++++++---------- .github/workflows/nightly-test-1.12.x.yaml | 28 +++++++++---------- .github/workflows/nightly-test-1.13.x.yaml | 28 +++++++++---------- .github/workflows/nightly-test-1.14.x.yaml | 28 +++++++++---------- .github/workflows/nightly-test-main.yaml | 28 +++++++++---------- .golangci.yml | 6 ++-- .release/security-scan.hcl | 1 + acl/{acl_oss.go => acl_ce.go} | 2 +- acl/{authorizer_oss.go => authorizer_ce.go} | 0 ...rprisemeta_oss.go => enterprisemeta_ce.go} | 0 acl/{errors_oss.go => errors_ce.go} | 0 ...horizer_oss.go => policy_authorizer_ce.go} | 0 acl/{policy_oss.go => policy_ce.go} | 0 ...licy_merger_oss.go => policy_merger_ce.go} | 0 agent/{acl_oss.go => acl_ce.go} | 0 agent/agent.go | 2 +- agent/{agent_oss.go => agent_ce.go} | 0 agent/{agent_oss_test.go => agent_ce_test.go} | 0 ...t_endpoint_oss.go => agent_endpoint_ce.go} | 0 ..._oss_test.go => agent_endpoint_ce_test.go} | 0 .../{auto_config_oss.go => auto_config_ce.go} | 2 +- ...fig_oss_test.go => auto_config_ce_test.go} | 0 .../{config_oss.go => config_ce.go} | 2 +- .../{mock_oss_test.go => mock_ce_test.go} | 2 +- ...t_ca_leaf_oss.go => connect_ca_leaf_ce.go} | 0 ...endpoint_oss.go => catalog_endpoint_ce.go} | 0 .../config/{builder_oss.go => builder_ce.go} | 2 +- ...builder_oss_test.go => builder_ce_test.go} | 0 agent/config/{config_oss.go => config_ce.go} | 0 .../config/{default_oss.go => default_ce.go} | 0 .../config/{runtime_oss.go => runtime_ce.go} | 0 ...runtime_oss_test.go => runtime_ce_test.go} | 4 +-- .../config/{segment_oss.go => segment_ce.go} | 0 ...segment_oss_test.go => segment_ce_test.go} | 4 +-- agent/connect/sni.go | 6 ++-- .../{uri_agent_oss.go => uri_agent_ce.go} | 2 +- ...agent_oss_test.go => uri_agent_ce_test.go} | 0 ..._gateway_oss.go => uri_mesh_gateway_ce.go} | 2 +- ...ss_test.go => uri_mesh_gateway_ce_test.go} | 0 agent/connect/uri_service.go | 4 +-- .../{uri_service_oss.go => uri_service_ce.go} | 6 ++-- ...ice_oss_test.go => uri_service_ce_test.go} | 0 ...authmethod_oss.go => acl_authmethod_ce.go} | 0 agent/consul/{acl_oss.go => acl_ce.go} | 4 +-- .../{acl_oss_test.go => acl_ce_test.go} | 0 ...acl_endpoint_oss.go => acl_endpoint_ce.go} | 0 .../{acl_server_oss.go => acl_server_ce.go} | 0 .../auth/{binder_oss.go => binder_ce.go} | 0 ...token_writer_oss.go => token_writer_ce.go} | 0 .../{authmethods_oss.go => authmethods_ce.go} | 0 .../kubeauth/{k8s_oss.go => k8s_ce.go} | 0 .../ssoauth/{sso_oss.go => sso_ce.go} | 0 .../{testing_oss.go => testing_ce.go} | 0 .../{autopilot_oss.go => autopilot_ce.go} | 0 agent/consul/catalog_endpoint.go | 2 +- agent/consul/{config_oss.go => config_ce.go} | 0 .../{compile_oss.go => compile_ce.go} | 0 ..._client_oss.go => enterprise_client_ce.go} | 0 ..._config_oss.go => enterprise_config_ce.go} | 0 ..._server_oss.go => enterprise_server_ce.go} | 4 +-- ...s_test.go => enterprise_server_ce_test.go} | 0 .../fsm/{commands_oss.go => commands_ce.go} | 0 ...mmands_oss_test.go => commands_ce_test.go} | 0 agent/consul/fsm/fsm.go | 2 +- .../fsm/{snapshot_oss.go => snapshot_ce.go} | 4 +-- ...apshot_oss_test.go => snapshot_ce_test.go} | 4 +-- agent/consul/fsm/snapshot_test.go | 4 +-- .../{leader_oss_test.go => leader_ce_test.go} | 0 ...entions_oss.go => leader_intentions_ce.go} | 4 +-- ...s_test.go => leader_intentions_ce_test.go} | 0 agent/consul/{merge_oss.go => merge_ce.go} | 0 .../{merge_oss_test.go => merge_ce_test.go} | 2 +- .../consul/{options_oss.go => options_ce.go} | 0 ...g_backend_oss.go => peering_backend_ce.go} | 0 ...oss_test.go => peering_backend_ce_test.go} | 0 .../{walk_oss_test.go => walk_ce_test.go} | 0 .../{reporting_oss.go => reporting_ce.go} | 0 .../consul/{segment_oss.go => segment_ce.go} | 8 +++--- agent/consul/{server_oss.go => server_ce.go} | 2 +- .../{server_oss_test.go => server_ce_test.go} | 0 agent/consul/state/{acl_oss.go => acl_ce.go} | 0 .../state/{acl_oss_test.go => acl_ce_test.go} | 0 .../state/{catalog_oss.go => catalog_ce.go} | 2 +- ...catalog_oss_test.go => catalog_ce_test.go} | 0 ...log_events_oss.go => catalog_events_ce.go} | 0 ..._oss_test.go => catalog_events_ce_test.go} | 2 +- ...config_entry_oss.go => config_entry_ce.go} | 2 +- ...ry_oss_test.go => config_entry_ce_test.go} | 0 agent/consul/state/config_entry_intention.go | 2 +- ...on_oss.go => config_entry_intention_ce.go} | 0 .../{coordinate_oss.go => coordinate_ce.go} | 0 ...nate_oss_test.go => coordinate_ce_test.go} | 0 .../state/{delay_oss.go => delay_ce.go} | 0 .../{graveyard_oss.go => graveyard_ce.go} | 0 .../{intention_oss.go => intention_ce.go} | 0 agent/consul/state/{kvs_oss.go => kvs_ce.go} | 0 .../state/{kvs_oss_test.go => kvs_ce_test.go} | 0 .../{operations_oss.go => operations_ce.go} | 0 agent/consul/state/peering.go | 2 +- .../state/{peering_oss.go => peering_ce.go} | 0 ...peering_oss_test.go => peering_ce_test.go} | 0 .../state/{query_oss.go => query_ce.go} | 0 .../state/{schema_oss.go => schema_ce.go} | 0 .../{schema_oss_test.go => schema_ce_test.go} | 0 .../state/{session_oss.go => session_ce.go} | 0 ...ore_oss_test.go => state_store_ce_test.go} | 0 .../state/{usage_oss.go => usage_ce.go} | 0 ...usagemetrics_oss.go => usagemetrics_ce.go} | 0 ...cs_oss_test.go => usagemetrics_ce_test.go} | 8 +++--- agent/{dns_oss.go => dns_ce.go} | 0 agent/{dns_oss_test.go => dns_ce_test.go} | 2 +- ...egate_oss.go => enterprise_delegate_ce.go} | 2 +- agent/{http_oss.go => http_ce.go} | 4 +-- agent/{http_oss_test.go => http_ce_test.go} | 6 ++-- ...test.go => intentions_endpoint_ce_test.go} | 2 +- ...ndpoint_oss.go => operator_endpoint_ce.go} | 2 +- ...s_test.go => operator_endpoint_ce_test.go} | 0 agent/peering_endpoint.go | 2 +- ...ss_test.go => peering_endpoint_ce_test.go} | 8 +++--- .../{intentions_oss.go => intentions_ce.go} | 0 ...data_sources_oss.go => data_sources_ce.go} | 0 ...mesh_gateway_oss.go => mesh_gateway_ce.go} | 0 agent/proxycfg/naming.go | 2 +- .../proxycfg/{naming_oss.go => naming_ce.go} | 0 agent/proxycfg/snapshot.go | 2 +- .../{state_oss_test.go => state_ce_test.go} | 0 agent/proxycfg/state_test.go | 2 +- .../{testing_oss.go => testing_ce.go} | 0 agent/proxycfg/testing_ingress_gateway.go | 4 +-- agent/rpc/peering/service.go | 6 ++-- ...service_oss_test.go => service_ce_test.go} | 0 ...stutil_oss_test.go => testutil_ce_test.go} | 0 agent/rpcclient/health/view_test.go | 2 +- agent/setup.go | 2 +- agent/{setup_oss.go => setup_ce.go} | 0 agent/structs/{acl_oss.go => acl_ce.go} | 0 .../{autopilot_oss.go => autopilot_ce.go} | 0 .../structs/{catalog_oss.go => catalog_ce.go} | 0 ...config_entry_oss.go => config_entry_ce.go} | 0 ...ry_oss_test.go => config_entry_ce_test.go} | 5 ++-- ...s.go => config_entry_discoverychain_ce.go} | 0 ...=> config_entry_discoverychain_ce_test.go} | 14 +++++----- ...est.go => config_entry_exports_ce_test.go} | 4 +-- agent/structs/config_entry_gateways_test.go | 6 ++-- ...s_oss.go => config_entry_intentions_ce.go} | 0 ...ry_mesh_oss.go => config_entry_mesh_ce.go} | 0 agent/structs/config_entry_test.go | 2 +- .../structs/{connect_oss.go => connect_ce.go} | 0 ...nfig_oss.go => connect_proxy_config_ce.go} | 0 ...ery_chain_oss.go => discovery_chain_ce.go} | 0 .../{intention_oss.go => intention_ce.go} | 6 ++-- .../structs/{structs_oss.go => structs_ce.go} | 6 ++-- ...structs_oss_test.go => structs_ce_test.go} | 0 agent/token/{store_oss.go => store_ce.go} | 2 +- ...int_oss_test.go => ui_endpoint_ce_test.go} | 0 agent/ui_endpoint_test.go | 2 +- ...est.go => delta_envoy_extender_ce_test.go} | 0 ..._oss_test.go => runtime_config_ce_test.go} | 0 agent/xds/listeners_ingress.go | 2 +- ...urces_oss_test.go => resources_ce_test.go} | 0 agent/xds/{server_oss.go => server_ce.go} | 0 api/{oss_test.go => ce_test.go} | 4 +-- api/config_entry_gateways_test.go | 8 +++--- build-support/functions/00-vars.sh | 1 + build-support/functions/10-util.sh | 3 +- build-support/functions/20-build.sh | 1 + ..._create_oss.go => authmethod_create_ce.go} | 0 ..._update_oss.go => authmethod_update_ce.go} | 0 ...atter_oss_test.go => formatter_ce_test.go} | 2 +- .../{oss => ce}/basic.json.golden | 0 .../{oss => ce}/basic.pretty-meta.golden | 0 .../{oss => ce}/basic.pretty.golden | 0 .../{oss => ce}/complex.json.golden | 0 .../{oss => ce}/complex.pretty-meta.golden | 0 .../{oss => ce}/complex.pretty.golden | 0 .../catalog/{helpers_oss.go => helpers_ce.go} | 0 .../connect/envoy/bootstrap_config_test.go | 8 +++--- .../{envoy_oss_test.go => envoy_ce_test.go} | 0 command/login/{login_oss.go => login_ce.go} | 0 .../state/operator_autopilot_state_test.go | 2 +- .../state/testdata/{oss => ce}/json.golden | 0 .../state/testdata/{oss => ce}/pretty.golden | 0 .../state/testdata/{oss => ce}/state.json | 0 ...instances_oss.go => usage_instances_ce.go} | 0 ...oss_test.go => usage_instances_ce_test.go} | 0 command/{registry_oss.go => registry_ce.go} | 0 docs/config/checklist-adding-config-fields.md | 2 +- docs/persistence/README.md | 4 +-- .../postprocess/main.go | 15 +++++----- lib/useragent.go | 2 +- .../{auto_config_oss.go => auto_config_ce.go} | 0 .../pbcommon/{common_oss.go => common_ce.go} | 0 .../{peering_oss.go => peering_ce.go} | 0 .../{convert_oss.go => convert_ce.go} | 0 ...convert_oss_test.go => convert_ce_test.go} | 0 sentinel/{sentinel_oss.go => sentinel_ce.go} | 0 .../consul-container/libs/utils/version.go | 2 +- .../utils/{version_oss.go => version_ce.go} | 2 +- .../{namespace_oss.go => namespace_ce.go} | 0 .../consul-container/test/upgrade/README.md | 4 +-- ui/README.md | 2 +- .../peer/form/token/fieldsets/index.hbs | 2 +- ui/packages/consul-ui/GNUmakefile | 1 + .../consul-ui/app/services/client/http.js | 2 +- .../app/utils/create-fingerprinter.js | 2 +- ui/packages/consul-ui/config/environment.js | 1 + .../consul-ui/docs/significant-patterns.mdx | 2 +- 213 files changed, 223 insertions(+), 213 deletions(-) rename .github/workflows/{oss-merge-trigger.yml => ce-merge-trigger.yml} (82%) rename acl/{acl_oss.go => acl_ce.go} (95%) rename acl/{authorizer_oss.go => authorizer_ce.go} (100%) rename acl/{enterprisemeta_oss.go => enterprisemeta_ce.go} (100%) rename acl/{errors_oss.go => errors_ce.go} (100%) rename acl/{policy_authorizer_oss.go => policy_authorizer_ce.go} (100%) rename acl/{policy_oss.go => policy_ce.go} (100%) rename acl/{policy_merger_oss.go => policy_merger_ce.go} (100%) rename agent/{acl_oss.go => acl_ce.go} (100%) rename agent/{agent_oss.go => agent_ce.go} (100%) rename agent/{agent_oss_test.go => agent_ce_test.go} (100%) rename agent/{agent_endpoint_oss.go => agent_endpoint_ce.go} (100%) rename agent/{agent_endpoint_oss_test.go => agent_endpoint_ce_test.go} (100%) rename agent/auto-config/{auto_config_oss.go => auto_config_ce.go} (85%) rename agent/auto-config/{auto_config_oss_test.go => auto_config_ce_test.go} (100%) rename agent/auto-config/{config_oss.go => config_ce.go} (88%) rename agent/auto-config/{mock_oss_test.go => mock_ce_test.go} (85%) rename agent/cache-types/{connect_ca_leaf_oss.go => connect_ca_leaf_ce.go} (100%) rename agent/{catalog_endpoint_oss.go => catalog_endpoint_ce.go} (100%) rename agent/config/{builder_oss.go => builder_ce.go} (97%) rename agent/config/{builder_oss_test.go => builder_ce_test.go} (100%) rename agent/config/{config_oss.go => config_ce.go} (100%) rename agent/config/{default_oss.go => default_ce.go} (100%) rename agent/config/{runtime_oss.go => runtime_ce.go} (100%) rename agent/config/{runtime_oss_test.go => runtime_ce_test.go} (97%) rename agent/config/{segment_oss.go => segment_ce.go} (100%) rename agent/config/{segment_oss_test.go => segment_ce_test.go} (95%) rename agent/connect/{uri_agent_oss.go => uri_agent_ce.go} (86%) rename agent/connect/{uri_agent_oss_test.go => uri_agent_ce_test.go} (100%) rename agent/connect/{uri_mesh_gateway_oss.go => uri_mesh_gateway_ce.go} (85%) rename agent/connect/{uri_mesh_gateway_oss_test.go => uri_mesh_gateway_ce_test.go} (100%) rename agent/connect/{uri_service_oss.go => uri_service_ce.go} (72%) rename agent/connect/{uri_service_oss_test.go => uri_service_ce_test.go} (100%) rename agent/consul/{acl_authmethod_oss.go => acl_authmethod_ce.go} (100%) rename agent/consul/{acl_oss.go => acl_ce.go} (95%) rename agent/consul/{acl_oss_test.go => acl_ce_test.go} (100%) rename agent/consul/{acl_endpoint_oss.go => acl_endpoint_ce.go} (100%) rename agent/consul/{acl_server_oss.go => acl_server_ce.go} (100%) rename agent/consul/auth/{binder_oss.go => binder_ce.go} (100%) rename agent/consul/auth/{token_writer_oss.go => token_writer_ce.go} (100%) rename agent/consul/authmethod/{authmethods_oss.go => authmethods_ce.go} (100%) rename agent/consul/authmethod/kubeauth/{k8s_oss.go => k8s_ce.go} (100%) rename agent/consul/authmethod/ssoauth/{sso_oss.go => sso_ce.go} (100%) rename agent/consul/authmethod/testauth/{testing_oss.go => testing_ce.go} (100%) rename agent/consul/{autopilot_oss.go => autopilot_ce.go} (100%) rename agent/consul/{config_oss.go => config_ce.go} (100%) rename agent/consul/discoverychain/{compile_oss.go => compile_ce.go} (100%) rename agent/consul/{enterprise_client_oss.go => enterprise_client_ce.go} (100%) rename agent/consul/{enterprise_config_oss.go => enterprise_config_ce.go} (100%) rename agent/consul/{enterprise_server_oss.go => enterprise_server_ce.go} (98%) rename agent/consul/{enterprise_server_oss_test.go => enterprise_server_ce_test.go} (100%) rename agent/consul/fsm/{commands_oss.go => commands_ce.go} (100%) rename agent/consul/fsm/{commands_oss_test.go => commands_ce_test.go} (100%) rename agent/consul/fsm/{snapshot_oss.go => snapshot_ce.go} (99%) rename agent/consul/fsm/{snapshot_oss_test.go => snapshot_ce_test.go} (88%) rename agent/consul/{leader_oss_test.go => leader_ce_test.go} (100%) rename agent/consul/{leader_intentions_oss.go => leader_intentions_ce.go} (96%) rename agent/consul/{leader_intentions_oss_test.go => leader_intentions_ce_test.go} (100%) rename agent/consul/{merge_oss.go => merge_ce.go} (100%) rename agent/consul/{merge_oss_test.go => merge_ce_test.go} (97%) rename agent/consul/{options_oss.go => options_ce.go} (100%) rename agent/consul/{peering_backend_oss.go => peering_backend_ce.go} (100%) rename agent/consul/{peering_backend_oss_test.go => peering_backend_ce_test.go} (100%) rename agent/consul/prepared_query/{walk_oss_test.go => walk_ce_test.go} (100%) rename agent/consul/reporting/{reporting_oss.go => reporting_ce.go} (100%) rename agent/consul/{segment_oss.go => segment_ce.go} (88%) rename agent/consul/{server_oss.go => server_ce.go} (98%) rename agent/consul/{server_oss_test.go => server_ce_test.go} (100%) rename agent/consul/state/{acl_oss.go => acl_ce.go} (100%) rename agent/consul/state/{acl_oss_test.go => acl_ce_test.go} (100%) rename agent/consul/state/{catalog_oss.go => catalog_ce.go} (99%) rename agent/consul/state/{catalog_oss_test.go => catalog_ce_test.go} (100%) rename agent/consul/state/{catalog_events_oss.go => catalog_events_ce.go} (100%) rename agent/consul/state/{catalog_events_oss_test.go => catalog_events_ce_test.go} (92%) rename agent/consul/state/{config_entry_oss.go => config_entry_ce.go} (95%) rename agent/consul/state/{config_entry_oss_test.go => config_entry_ce_test.go} (100%) rename agent/consul/state/{config_entry_intention_oss.go => config_entry_intention_ce.go} (100%) rename agent/consul/state/{coordinate_oss.go => coordinate_ce.go} (100%) rename agent/consul/state/{coordinate_oss_test.go => coordinate_ce_test.go} (100%) rename agent/consul/state/{delay_oss.go => delay_ce.go} (100%) rename agent/consul/state/{graveyard_oss.go => graveyard_ce.go} (100%) rename agent/consul/state/{intention_oss.go => intention_ce.go} (100%) rename agent/consul/state/{kvs_oss.go => kvs_ce.go} (100%) rename agent/consul/state/{kvs_oss_test.go => kvs_ce_test.go} (100%) rename agent/consul/state/{operations_oss.go => operations_ce.go} (100%) rename agent/consul/state/{peering_oss.go => peering_ce.go} (100%) rename agent/consul/state/{peering_oss_test.go => peering_ce_test.go} (100%) rename agent/consul/state/{query_oss.go => query_ce.go} (100%) rename agent/consul/state/{schema_oss.go => schema_ce.go} (100%) rename agent/consul/state/{schema_oss_test.go => schema_ce_test.go} (100%) rename agent/consul/state/{session_oss.go => session_ce.go} (100%) rename agent/consul/state/{state_store_oss_test.go => state_store_ce_test.go} (100%) rename agent/consul/state/{usage_oss.go => usage_ce.go} (100%) rename agent/consul/usagemetrics/{usagemetrics_oss.go => usagemetrics_ce.go} (100%) rename agent/consul/usagemetrics/{usagemetrics_oss_test.go => usagemetrics_ce_test.go} (99%) rename agent/{dns_oss.go => dns_ce.go} (100%) rename agent/{dns_oss_test.go => dns_ce_test.go} (98%) rename agent/{enterprise_delegate_oss.go => enterprise_delegate_ce.go} (67%) rename agent/{http_oss.go => http_ce.go} (99%) rename agent/{http_oss_test.go => http_ce_test.go} (97%) rename agent/{intentions_endpoint_oss_test.go => intentions_endpoint_ce_test.go} (95%) rename agent/{operator_endpoint_oss.go => operator_endpoint_ce.go} (97%) rename agent/{operator_endpoint_oss_test.go => operator_endpoint_ce_test.go} (100%) rename agent/{peering_endpoint_oss_test.go => peering_endpoint_ce_test.go} (85%) rename agent/proxycfg-glue/{intentions_oss.go => intentions_ce.go} (100%) rename agent/proxycfg/{data_sources_oss.go => data_sources_ce.go} (100%) rename agent/proxycfg/{mesh_gateway_oss.go => mesh_gateway_ce.go} (100%) rename agent/proxycfg/{naming_oss.go => naming_ce.go} (100%) rename agent/proxycfg/{state_oss_test.go => state_ce_test.go} (100%) rename agent/proxycfg/{testing_oss.go => testing_ce.go} (100%) rename agent/rpc/peering/{service_oss_test.go => service_ce_test.go} (100%) rename agent/rpc/peering/{testutil_oss_test.go => testutil_ce_test.go} (100%) rename agent/{setup_oss.go => setup_ce.go} (100%) rename agent/structs/{acl_oss.go => acl_ce.go} (100%) rename agent/structs/{autopilot_oss.go => autopilot_ce.go} (100%) rename agent/structs/{catalog_oss.go => catalog_ce.go} (100%) rename agent/structs/{config_entry_oss.go => config_entry_ce.go} (100%) rename agent/structs/{config_entry_oss_test.go => config_entry_ce_test.go} (97%) rename agent/structs/{config_entry_discoverychain_oss.go => config_entry_discoverychain_ce.go} (100%) rename agent/structs/{config_entry_discoverychain_oss_test.go => config_entry_discoverychain_ce_test.go} (90%) rename agent/structs/{config_entry_export_oss_test.go => config_entry_exports_ce_test.go} (92%) rename agent/structs/{config_entry_intentions_oss.go => config_entry_intentions_ce.go} (100%) rename agent/structs/{config_entry_mesh_oss.go => config_entry_mesh_ce.go} (100%) rename agent/structs/{connect_oss.go => connect_ce.go} (100%) rename agent/structs/{connect_proxy_config_oss.go => connect_proxy_config_ce.go} (100%) rename agent/structs/{discovery_chain_oss.go => discovery_chain_ce.go} (100%) rename agent/structs/{intention_oss.go => intention_ce.go} (90%) rename agent/structs/{structs_oss.go => structs_ce.go} (99%) rename agent/structs/{structs_oss_test.go => structs_ce_test.go} (100%) rename agent/token/{store_oss.go => store_ce.go} (91%) rename agent/{ui_endpoint_oss_test.go => ui_endpoint_ce_test.go} (100%) rename agent/xds/{delta_envoy_extender_oss_test.go => delta_envoy_extender_ce_test.go} (100%) rename agent/xds/extensionruntime/{runtime_config_oss_test.go => runtime_config_ce_test.go} (100%) rename agent/xds/{resources_oss_test.go => resources_ce_test.go} (100%) rename agent/xds/{server_oss.go => server_ce.go} (100%) rename api/{oss_test.go => ce_test.go} (79%) rename command/acl/authmethod/create/{authmethod_create_oss.go => authmethod_create_ce.go} (100%) rename command/acl/authmethod/update/{authmethod_update_oss.go => authmethod_update_ce.go} (100%) rename command/acl/token/{formatter_oss_test.go => formatter_ce_test.go} (70%) rename command/acl/token/testdata/FormatTokenExpanded/{oss => ce}/basic.json.golden (100%) rename command/acl/token/testdata/FormatTokenExpanded/{oss => ce}/basic.pretty-meta.golden (100%) rename command/acl/token/testdata/FormatTokenExpanded/{oss => ce}/basic.pretty.golden (100%) rename command/acl/token/testdata/FormatTokenExpanded/{oss => ce}/complex.json.golden (100%) rename command/acl/token/testdata/FormatTokenExpanded/{oss => ce}/complex.pretty-meta.golden (100%) rename command/acl/token/testdata/FormatTokenExpanded/{oss => ce}/complex.pretty.golden (100%) rename command/catalog/{helpers_oss.go => helpers_ce.go} (100%) rename command/connect/envoy/{envoy_oss_test.go => envoy_ce_test.go} (100%) rename command/login/{login_oss.go => login_ce.go} (100%) rename command/operator/autopilot/state/testdata/{oss => ce}/json.golden (100%) rename command/operator/autopilot/state/testdata/{oss => ce}/pretty.golden (100%) rename command/operator/autopilot/state/testdata/{oss => ce}/state.json (100%) rename command/operator/usage/instances/{usage_instances_oss.go => usage_instances_ce.go} (100%) rename command/operator/usage/instances/{usage_instances_oss_test.go => usage_instances_ce_test.go} (100%) rename command/{registry_oss.go => registry_ce.go} (100%) rename proto/pbautoconf/{auto_config_oss.go => auto_config_ce.go} (100%) rename proto/pbcommon/{common_oss.go => common_ce.go} (100%) rename proto/pbpeering/{peering_oss.go => peering_ce.go} (100%) rename proto/pbservice/{convert_oss.go => convert_ce.go} (100%) rename proto/pbservice/{convert_oss_test.go => convert_ce_test.go} (100%) rename sentinel/{sentinel_oss.go => sentinel_ce.go} (100%) rename test/integration/consul-container/libs/utils/{version_oss.go => version_ce.go} (69%) rename test/integration/consul-container/test/gateways/{namespace_oss.go => namespace_ce.go} (100%) diff --git a/.github/scripts/get_runner_classes.sh b/.github/scripts/get_runner_classes.sh index b722ba7687..f8b532447a 100755 --- a/.github/scripts/get_runner_classes.sh +++ b/.github/scripts/get_runner_classes.sh @@ -10,7 +10,7 @@ case "$GITHUB_REPOSITORY" in echo "compute-small=['self-hosted', 'linux', 'small']" >> "$GITHUB_OUTPUT" echo "compute-medium=['self-hosted', 'linux', 'medium']" >> "$GITHUB_OUTPUT" echo "compute-large=['self-hosted', 'linux', 'large']" >> "$GITHUB_OUTPUT" - # m5d.8xlarge is equivalent to our xl custom runner in OSS + # m5d.8xlarge is equivalent to our xl custom runner in CE echo "compute-xl=['self-hosted', 'ondemand', 'linux', 'type=m5d.8xlarge']" >> "$GITHUB_OUTPUT" ;; *) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 2e87d767f5..f57ea3527d 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -80,7 +80,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # pin@v2.4.1 - # NOTE: conditional specific logic as we store secrets in Vault in ENT and use GHA secrets in OSS. + # NOTE: conditional specific logic as we store secrets in Vault in ENT and use GHA secrets in CE. - name: Login to Docker Hub uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # pin@v2.1.0 with: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8faf5b14e4..e818b2ae9f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ on: env: PKG_NAME: consul + # TODO(spatel): CE refactor METADATA: oss GOPRIVATE: github.com/hashicorp # Required for enterprise deps diff --git a/.github/workflows/oss-merge-trigger.yml b/.github/workflows/ce-merge-trigger.yml similarity index 82% rename from .github/workflows/oss-merge-trigger.yml rename to .github/workflows/ce-merge-trigger.yml index 4d08442d90..3a62146631 100644 --- a/.github/workflows/oss-merge-trigger.yml +++ b/.github/workflows/ce-merge-trigger.yml @@ -1,4 +1,4 @@ -name: Trigger OSS to Enterprise Merge +name: Trigger Community Edition to Enterprise Merge on: pull_request_target: types: @@ -8,8 +8,8 @@ on: - 'release/*.*.x' jobs: - trigger-oss-merge: - # run this only on merge events in OSS repo + trigger-ce-merge: + # run this only on merge events in CE repo if: ${{ github.event.pull_request.merged && github.repository == 'hashicorp/consul' }} runs-on: ubuntu-latest steps: @@ -19,6 +19,7 @@ jobs: GIT_SHA: ${{ github.sha }} GH_PAT: ${{ secrets.ELEVATED_GITHUB_TOKEN }} GIT_ACTOR: ${{ github.actor }} + # TODO(spatel): CE refactor run: | curl -H "Authorization: token $GH_PAT" \ -H 'Accept: application/json' \ diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 5eab231c65..d8b2603604 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -79,7 +79,7 @@ jobs: matrix: partition: [1, 2, 3, 4] env: - EMBER_TEST_REPORT: test-results/report-oss.xml # outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml # outputs test report for CI test summary EMBER_TEST_PARALLEL: true # enables test parallelization with ember-exam CONSUL_NSPACES_ENABLED: ${{ endsWith(github.repository, '-enterprise') && 1 || 0 }} # NOTE: this should be 1 in ENT. JOBS: 2 # limit parallelism for broccoli-babel-transpiler diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 58ef29ba09..ed0f5dd1d7 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -198,7 +198,7 @@ jobs: # elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} # dev-build-arm64: - # # only run on enterprise because GHA does not have arm64 runners in OSS + # # only run on enterprise because GHA does not have arm64 runners in CE # if: ${{ endsWith(github.repository, '-enterprise') }} # needs: # - setup @@ -212,7 +212,7 @@ jobs: # elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} # go-test-arm64: - # # only run on enterprise because GHA does not have arm64 runners in OSS + # # only run on enterprise because GHA does not have arm64 runners in CE # if: ${{ endsWith(github.repository, '-enterprise') }} # needs: # - setup @@ -230,7 +230,7 @@ jobs: # consul-license: ${{secrets.CONSUL_LICENSE}} # datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}" - go-test-oss: + go-test-ce: needs: - setup - dev-build @@ -474,7 +474,7 @@ jobs: - lint-32bit # - go-test-arm64 - go-test-enterprise - - go-test-oss + - go-test-ce - go-test-race - go-test-envoyextensions - go-test-troubleshoot diff --git a/.github/workflows/nightly-test-1.11.x.yaml b/.github/workflows/nightly-test-1.11.x.yaml index 2065738328..e913dd0aaf 100644 --- a/.github/workflows/nightly-test-1.11.x.yaml +++ b/.github/workflows/nightly-test-1.11.x.yaml @@ -39,7 +39,7 @@ jobs: working-directory: ./ui/packages/consul-ui run: make test-node - frontend-build-oss: + frontend-build-ce: runs-on: ubuntu-latest env: JOBS: 2 @@ -61,27 +61,27 @@ jobs: working-directory: ./ui run: make deps - - name: Ember Build OSS - id: build-oss + - name: Ember Build CE + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci - - name: Upload OSS Frontend + - name: Upload CE Frontend uses: actions/upload-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist if-no-files-found: error - frontend-test-oss: + frontend-test-ce: runs-on: ubuntu-latest - needs: [frontend-build-oss] + needs: [frontend-build-ce] strategy: matrix: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 0 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -100,13 +100,13 @@ jobs: working-directory: ./ui run: make deps - - name: Download OSS Frontend + - name: Download CE Frontend uses: actions/download-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist - - name: Ember Test OSS + - name: Ember Test CE id: cache working-directory: ./ui/packages/consul-ui run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit @@ -134,7 +134,7 @@ jobs: run: make deps - name: Ember Build ENT - id: build-oss + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci @@ -153,7 +153,7 @@ jobs: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 1 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -215,7 +215,7 @@ jobs: slack-failure-notification: runs-on: ubuntu-latest - needs: [frontend-test-oss, frontend-test-ent] + needs: [frontend-test-ce, frontend-test-ent] if: ${{ failure() }} steps: - name: Slack Notification diff --git a/.github/workflows/nightly-test-1.12.x.yaml b/.github/workflows/nightly-test-1.12.x.yaml index 78d35746d6..4d4fbde750 100644 --- a/.github/workflows/nightly-test-1.12.x.yaml +++ b/.github/workflows/nightly-test-1.12.x.yaml @@ -39,7 +39,7 @@ jobs: working-directory: ./ui/packages/consul-ui run: make test-node - frontend-build-oss: + frontend-build-ce: runs-on: ubuntu-latest env: JOBS: 2 @@ -61,27 +61,27 @@ jobs: working-directory: ./ui run: make deps - - name: Ember Build OSS - id: build-oss + - name: Ember Build CE + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci - - name: Upload OSS Frontend + - name: Upload CE Frontend uses: actions/upload-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist if-no-files-found: error - frontend-test-oss: + frontend-test-ce: runs-on: ubuntu-latest - needs: [frontend-build-oss] + needs: [frontend-build-ce] strategy: matrix: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 0 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -100,13 +100,13 @@ jobs: working-directory: ./ui run: make deps - - name: Download OSS Frontend + - name: Download CE Frontend uses: actions/download-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist - - name: Ember Test OSS + - name: Ember Test CE id: cache working-directory: ./ui/packages/consul-ui run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit @@ -134,7 +134,7 @@ jobs: run: make deps - name: Ember Build ENT - id: build-oss + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci @@ -153,7 +153,7 @@ jobs: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 1 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -215,7 +215,7 @@ jobs: slack-failure-notification: runs-on: ubuntu-latest - needs: [frontend-test-oss, frontend-test-ent] + needs: [frontend-test-ce, frontend-test-ent] if: ${{ failure() }} steps: - name: Slack Notification diff --git a/.github/workflows/nightly-test-1.13.x.yaml b/.github/workflows/nightly-test-1.13.x.yaml index 0cd2870c78..c1e9d035be 100644 --- a/.github/workflows/nightly-test-1.13.x.yaml +++ b/.github/workflows/nightly-test-1.13.x.yaml @@ -39,7 +39,7 @@ jobs: working-directory: ./ui/packages/consul-ui run: make test-node - frontend-build-oss: + frontend-build-ce: runs-on: ubuntu-latest env: JOBS: 2 @@ -61,27 +61,27 @@ jobs: working-directory: ./ui run: make deps - - name: Ember Build OSS - id: build-oss + - name: Ember Build CE + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci - - name: Upload OSS Frontend + - name: Upload CE Frontend uses: actions/upload-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist if-no-files-found: error - frontend-test-oss: + frontend-test-ce: runs-on: ubuntu-latest - needs: [frontend-build-oss] + needs: [frontend-build-ce] strategy: matrix: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 0 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -100,13 +100,13 @@ jobs: working-directory: ./ui run: make deps - - name: Download OSS Frontend + - name: Download CE Frontend uses: actions/download-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist - - name: Ember Test OSS + - name: Ember Test CE id: cache working-directory: ./ui/packages/consul-ui run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit @@ -134,7 +134,7 @@ jobs: run: make deps - name: Ember Build ENT - id: build-oss + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci @@ -153,7 +153,7 @@ jobs: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 1 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -215,7 +215,7 @@ jobs: slack-failure-notification: runs-on: ubuntu-latest - needs: [frontend-test-oss, frontend-test-ent] + needs: [frontend-test-ce, frontend-test-ent] if: ${{ failure() }} steps: - name: Slack Notification diff --git a/.github/workflows/nightly-test-1.14.x.yaml b/.github/workflows/nightly-test-1.14.x.yaml index 902ce25a7f..ee9fbd117c 100644 --- a/.github/workflows/nightly-test-1.14.x.yaml +++ b/.github/workflows/nightly-test-1.14.x.yaml @@ -39,7 +39,7 @@ jobs: working-directory: ./ui/packages/consul-ui run: make test-node - frontend-build-oss: + frontend-build-ce: runs-on: ubuntu-latest env: JOBS: 2 @@ -61,27 +61,27 @@ jobs: working-directory: ./ui run: make deps - - name: Ember Build OSS - id: build-oss + - name: Ember Build CE + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci - - name: Upload OSS Frontend + - name: Upload CE Frontend uses: actions/upload-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist if-no-files-found: error - frontend-test-oss: + frontend-test-ce: runs-on: ubuntu-latest - needs: [frontend-build-oss] + needs: [frontend-build-ce] strategy: matrix: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 0 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -100,13 +100,13 @@ jobs: working-directory: ./ui run: make deps - - name: Download OSS Frontend + - name: Download CE Frontend uses: actions/download-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist - - name: Ember Test OSS + - name: Ember Test CE id: cache working-directory: ./ui/packages/consul-ui run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit @@ -134,7 +134,7 @@ jobs: run: make deps - name: Ember Build ENT - id: build-oss + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci @@ -153,7 +153,7 @@ jobs: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 1 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -215,7 +215,7 @@ jobs: slack-failure-notification: runs-on: ubuntu-latest - needs: [frontend-test-oss, frontend-test-ent] + needs: [frontend-test-ce, frontend-test-ent] if: ${{ failure() }} steps: - name: Slack Notification diff --git a/.github/workflows/nightly-test-main.yaml b/.github/workflows/nightly-test-main.yaml index a645f8359c..33b2a8b622 100644 --- a/.github/workflows/nightly-test-main.yaml +++ b/.github/workflows/nightly-test-main.yaml @@ -39,7 +39,7 @@ jobs: working-directory: ./ui/packages/consul-ui run: make test-node - frontend-build-oss: + frontend-build-ce: runs-on: ubuntu-latest env: JOBS: 2 @@ -61,27 +61,27 @@ jobs: working-directory: ./ui run: make deps - - name: Ember Build OSS - id: build-oss + - name: Ember Build CE + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci - - name: Upload OSS Frontend + - name: Upload CE Frontend uses: actions/upload-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist if-no-files-found: error - frontend-test-oss: + frontend-test-ce: runs-on: ubuntu-latest - needs: [frontend-build-oss] + needs: [frontend-build-ce] strategy: matrix: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 0 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -100,13 +100,13 @@ jobs: working-directory: ./ui run: make deps - - name: Download OSS Frontend + - name: Download CE Frontend uses: actions/download-artifact@v3 with: - name: frontend-oss-${{ env.BRANCH_NAME }} + name: frontend-ce-${{ env.BRANCH_NAME }} path: ./ui/packages/consul-ui/dist - - name: Ember Test OSS + - name: Ember Test CE id: cache working-directory: ./ui/packages/consul-ui run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit @@ -134,7 +134,7 @@ jobs: run: make deps - name: Ember Build ENT - id: build-oss + id: build-ce working-directory: ./ui/packages/consul-ui run: make build-ci @@ -153,7 +153,7 @@ jobs: partition: [ 1, 2, 3, 4 ] env: CONSUL_NSPACES_ENABLED: 1 - EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary + EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam steps: - uses: actions/checkout@v2 @@ -215,7 +215,7 @@ jobs: slack-failure-notification: runs-on: ubuntu-latest - needs: [frontend-test-oss, frontend-test-ent] + needs: [frontend-test-ce, frontend-test-ent] if: ${{ failure() }} steps: - name: Slack Notification diff --git a/.golangci.yml b/.golangci.yml index 245f04d7a9..69e8f43a1c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -51,11 +51,11 @@ issues: - linters: [unparam] text: "`(t|resp|req|entMeta)` is unused" - # Temp ignore everything in _oss(_test).go and _ent(_test).go. Many of these + # Temp ignore everything in _ce(_test).go and _ent(_test).go. Many of these # could use underscore to ignore the unused arguments, but the "always returns" - # issue will likely remain in oss, and will need to be excluded. + # issue will likely remain in CE, and will need to be excluded. - linters: [unparam] - path: "(_oss.go|_oss_test.go|_ent.go|_ent_test.go)" + path: "(_ce.go|_ce_test.go|_ent.go|_ent_test.go)" linters-settings: govet: diff --git a/.release/security-scan.hcl b/.release/security-scan.hcl index 490ddd2746..97124dd4eb 100644 --- a/.release/security-scan.hcl +++ b/.release/security-scan.hcl @@ -8,6 +8,7 @@ binary { secrets = false go_modules = false osv = true + # TODO(spatel): CE refactor oss_index = true nvd = true } diff --git a/acl/acl_oss.go b/acl/acl_ce.go similarity index 95% rename from acl/acl_oss.go rename to acl/acl_ce.go index 48f671ac7a..2648550356 100644 --- a/acl/acl_oss.go +++ b/acl/acl_ce.go @@ -14,7 +14,7 @@ const ( const DefaultNamespaceName = "default" type EnterpriseConfig struct { - // no fields in OSS + // no fields in CE } func (_ *EnterpriseConfig) Close() { diff --git a/acl/authorizer_oss.go b/acl/authorizer_ce.go similarity index 100% rename from acl/authorizer_oss.go rename to acl/authorizer_ce.go diff --git a/acl/enterprisemeta_oss.go b/acl/enterprisemeta_ce.go similarity index 100% rename from acl/enterprisemeta_oss.go rename to acl/enterprisemeta_ce.go diff --git a/acl/errors_oss.go b/acl/errors_ce.go similarity index 100% rename from acl/errors_oss.go rename to acl/errors_ce.go diff --git a/acl/policy_authorizer_oss.go b/acl/policy_authorizer_ce.go similarity index 100% rename from acl/policy_authorizer_oss.go rename to acl/policy_authorizer_ce.go diff --git a/acl/policy_oss.go b/acl/policy_ce.go similarity index 100% rename from acl/policy_oss.go rename to acl/policy_ce.go diff --git a/acl/policy_merger_oss.go b/acl/policy_merger_ce.go similarity index 100% rename from acl/policy_merger_oss.go rename to acl/policy_merger_ce.go diff --git a/agent/acl_oss.go b/agent/acl_ce.go similarity index 100% rename from agent/acl_oss.go rename to agent/acl_ce.go diff --git a/agent/agent.go b/agent/agent.go index fe7e4fc683..72ec534b6c 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -3695,7 +3695,7 @@ func (a *Agent) loadServices(conf *config.RuntimeConfig, snap map[structs.CheckI } if acl.EqualPartitions("", p.Service.PartitionOrEmpty()) { - // NOTE: in case loading a service with empty partition (e.g., OSS -> ENT), + // NOTE: in case loading a service with empty partition (e.g., CE -> ENT), // we always default the service partition to the agent's partition. p.Service.OverridePartition(a.AgentEnterpriseMeta().PartitionOrDefault()) } else if !acl.EqualPartitions(a.AgentEnterpriseMeta().PartitionOrDefault(), p.Service.PartitionOrDefault()) { diff --git a/agent/agent_oss.go b/agent/agent_ce.go similarity index 100% rename from agent/agent_oss.go rename to agent/agent_ce.go diff --git a/agent/agent_oss_test.go b/agent/agent_ce_test.go similarity index 100% rename from agent/agent_oss_test.go rename to agent/agent_ce_test.go diff --git a/agent/agent_endpoint_oss.go b/agent/agent_endpoint_ce.go similarity index 100% rename from agent/agent_endpoint_oss.go rename to agent/agent_endpoint_ce.go diff --git a/agent/agent_endpoint_oss_test.go b/agent/agent_endpoint_ce_test.go similarity index 100% rename from agent/agent_endpoint_oss_test.go rename to agent/agent_endpoint_ce_test.go diff --git a/agent/auto-config/auto_config_oss.go b/agent/auto-config/auto_config_ce.go similarity index 85% rename from agent/auto-config/auto_config_oss.go rename to agent/auto-config/auto_config_ce.go index 95b38aa056..29f626568f 100644 --- a/agent/auto-config/auto_config_oss.go +++ b/agent/auto-config/auto_config_ce.go @@ -3,7 +3,7 @@ package autoconf -// AutoConfigEnterprise has no fields in OSS +// AutoConfigEnterprise has no fields in CE type AutoConfigEnterprise struct{} // newAutoConfigEnterprise initializes the enterprise AutoConfig struct diff --git a/agent/auto-config/auto_config_oss_test.go b/agent/auto-config/auto_config_ce_test.go similarity index 100% rename from agent/auto-config/auto_config_oss_test.go rename to agent/auto-config/auto_config_ce_test.go diff --git a/agent/auto-config/config_oss.go b/agent/auto-config/config_ce.go similarity index 88% rename from agent/auto-config/config_oss.go rename to agent/auto-config/config_ce.go index a8048954a1..dbd7d90eb3 100644 --- a/agent/auto-config/config_oss.go +++ b/agent/auto-config/config_ce.go @@ -6,7 +6,7 @@ package autoconf // EnterpriseConfig stub - only populated in Consul Enterprise type EnterpriseConfig struct{} -// finalize is a noop for OSS +// finalize is a noop for CE func (_ *EnterpriseConfig) validateAndFinalize() error { return nil } diff --git a/agent/auto-config/mock_oss_test.go b/agent/auto-config/mock_ce_test.go similarity index 85% rename from agent/auto-config/mock_oss_test.go rename to agent/auto-config/mock_ce_test.go index 0518753bbb..1a7acaa483 100644 --- a/agent/auto-config/mock_oss_test.go +++ b/agent/auto-config/mock_ce_test.go @@ -7,7 +7,7 @@ import ( "testing" ) -// mockedEnterpriseConfig is pretty much just a stub in OSS +// mockedEnterpriseConfig is pretty much just a stub in CE. // It does contain an enterprise config for compatibility // purposes but that in and of itself is just a stub. type mockedEnterpriseConfig struct { diff --git a/agent/cache-types/connect_ca_leaf_oss.go b/agent/cache-types/connect_ca_leaf_ce.go similarity index 100% rename from agent/cache-types/connect_ca_leaf_oss.go rename to agent/cache-types/connect_ca_leaf_ce.go diff --git a/agent/catalog_endpoint_oss.go b/agent/catalog_endpoint_ce.go similarity index 100% rename from agent/catalog_endpoint_oss.go rename to agent/catalog_endpoint_ce.go diff --git a/agent/config/builder_oss.go b/agent/config/builder_ce.go similarity index 97% rename from agent/config/builder_oss.go rename to agent/config/builder_ce.go index f0fcc30ae4..cfe05b5fd9 100644 --- a/agent/config/builder_oss.go +++ b/agent/config/builder_ce.go @@ -10,7 +10,7 @@ import ( // validateEnterpriseConfig is a function to validate the enterprise specific // configuration items after Parsing but before merging into the overall // configuration. The original intent is to use it to ensure that we warn -// for enterprise configurations used in OSS. +// for enterprise configurations used in CE. func validateEnterpriseConfigKeys(config *Config) []error { var result []error add := func(k string) { diff --git a/agent/config/builder_oss_test.go b/agent/config/builder_ce_test.go similarity index 100% rename from agent/config/builder_oss_test.go rename to agent/config/builder_ce_test.go diff --git a/agent/config/config_oss.go b/agent/config/config_ce.go similarity index 100% rename from agent/config/config_oss.go rename to agent/config/config_ce.go diff --git a/agent/config/default_oss.go b/agent/config/default_ce.go similarity index 100% rename from agent/config/default_oss.go rename to agent/config/default_ce.go diff --git a/agent/config/runtime_oss.go b/agent/config/runtime_ce.go similarity index 100% rename from agent/config/runtime_oss.go rename to agent/config/runtime_ce.go diff --git a/agent/config/runtime_oss_test.go b/agent/config/runtime_ce_test.go similarity index 97% rename from agent/config/runtime_oss_test.go rename to agent/config/runtime_ce_test.go index 8d2e71e1c6..c95e2d3add 100644 --- a/agent/config/runtime_oss_test.go +++ b/agent/config/runtime_ce_test.go @@ -32,9 +32,9 @@ var enterpriseConfigKeyWarnings = []string{ enterpriseConfigKeyError{key: "reporting.license.enabled"}.Error(), } -// OSS-only equivalent of TestConfigFlagsAndEdgecases +// CE-only equivalent of TestConfigFlagsAndEdgecases // used for flags validated in ent-only code -func TestLoad_IntegrationWithFlags_OSS(t *testing.T) { +func TestLoad_IntegrationWithFlags_CE(t *testing.T) { dataDir := testutil.TempDir(t, "consul") defer os.RemoveAll(dataDir) diff --git a/agent/config/segment_oss.go b/agent/config/segment_ce.go similarity index 100% rename from agent/config/segment_oss.go rename to agent/config/segment_ce.go diff --git a/agent/config/segment_oss_test.go b/agent/config/segment_ce_test.go similarity index 95% rename from agent/config/segment_oss_test.go rename to agent/config/segment_ce_test.go index 52b4a0964c..e31a9602b4 100644 --- a/agent/config/segment_oss_test.go +++ b/agent/config/segment_ce_test.go @@ -15,7 +15,7 @@ func TestSegments(t *testing.T) { tests := []testCase{ { - desc: "segment name not in OSS", + desc: "segment name not in CE", args: []string{ `-data-dir=` + dataDir, }, @@ -39,7 +39,7 @@ func TestSegments(t *testing.T) { }, }, { - desc: "segments not in OSS", + desc: "segments not in CE", args: []string{ `-data-dir=` + dataDir, }, diff --git a/agent/connect/sni.go b/agent/connect/sni.go index e60740e4b1..221d7c61c1 100644 --- a/agent/connect/sni.go +++ b/agent/connect/sni.go @@ -28,7 +28,7 @@ func UpstreamSNI(u *structs.Upstream, subset string, dc string, trustDomain stri func GatewaySNI(dc string, partition, trustDomain string) string { if partition == "" { - // TODO(partitions) Make default available in OSS as a constant for uses like this one + // TODO(partitions) Make default available in CE as a constant for uses like this one partition = "default" } @@ -45,7 +45,7 @@ func ServiceSNI(service string, subset string, namespace string, partition strin namespace = structs.IntentionDefaultNamespace } if partition == "" { - // TODO(partitions) Make default available in OSS as a constant for uses like this one + // TODO(partitions) Make default available in CE as a constant for uses like this one partition = "default" } @@ -106,7 +106,7 @@ func PeeredServiceSNI(service, namespace, partition, peerName, trustDomain strin namespace = structs.IntentionDefaultNamespace } if partition == "" { - // TODO(partitions) Make default available in OSS as a constant for uses like this one + // TODO(partitions) Make default available in CE as a constant for uses like this one partition = "default" } diff --git a/agent/connect/uri_agent_oss.go b/agent/connect/uri_agent_ce.go similarity index 86% rename from agent/connect/uri_agent_oss.go rename to agent/connect/uri_agent_ce.go index e24f9b5609..fdfb075a8d 100644 --- a/agent/connect/uri_agent_oss.go +++ b/agent/connect/uri_agent_ce.go @@ -10,7 +10,7 @@ import ( ) // GetEnterpriseMeta will synthesize an EnterpriseMeta struct from the SpiffeIDAgent. -// in OSS this just returns an empty (but never nil) struct pointer +// in CE this just returns an empty (but never nil) struct pointer func (id SpiffeIDAgent) GetEnterpriseMeta() *acl.EnterpriseMeta { return &acl.EnterpriseMeta{} } diff --git a/agent/connect/uri_agent_oss_test.go b/agent/connect/uri_agent_ce_test.go similarity index 100% rename from agent/connect/uri_agent_oss_test.go rename to agent/connect/uri_agent_ce_test.go diff --git a/agent/connect/uri_mesh_gateway_oss.go b/agent/connect/uri_mesh_gateway_ce.go similarity index 85% rename from agent/connect/uri_mesh_gateway_oss.go rename to agent/connect/uri_mesh_gateway_ce.go index 8865b97f94..a92d0fc7ff 100644 --- a/agent/connect/uri_mesh_gateway_oss.go +++ b/agent/connect/uri_mesh_gateway_ce.go @@ -10,7 +10,7 @@ import ( ) // GetEnterpriseMeta will synthesize an EnterpriseMeta struct from the SpiffeIDAgent. -// in OSS this just returns an empty (but never nil) struct pointer +// in CE this just returns an empty (but never nil) struct pointer func (id SpiffeIDMeshGateway) GetEnterpriseMeta() *acl.EnterpriseMeta { return &acl.EnterpriseMeta{} } diff --git a/agent/connect/uri_mesh_gateway_oss_test.go b/agent/connect/uri_mesh_gateway_ce_test.go similarity index 100% rename from agent/connect/uri_mesh_gateway_oss_test.go rename to agent/connect/uri_mesh_gateway_ce_test.go diff --git a/agent/connect/uri_service.go b/agent/connect/uri_service.go index 685498b1af..e3ed1b2889 100644 --- a/agent/connect/uri_service.go +++ b/agent/connect/uri_service.go @@ -40,10 +40,10 @@ func (id SpiffeIDService) uriPath() string { id.Service, ) - // Although OSS has no support for partitions, it still needs to be able to + // Although CE has no support for partitions, it still needs to be able to // handle exportedPartition from peered Consul Enterprise clusters in order // to generate the correct SpiffeID. - // We intentionally avoid using pbpartition.DefaultName here to be OSS friendly. + // We intentionally avoid using pbpartition.DefaultName here to be CE friendly. if ap := id.PartitionOrDefault(); ap != "" && ap != "default" { return "/ap/" + ap + path } diff --git a/agent/connect/uri_service_oss.go b/agent/connect/uri_service_ce.go similarity index 72% rename from agent/connect/uri_service_oss.go rename to agent/connect/uri_service_ce.go index 63a51bf700..7eedecade6 100644 --- a/agent/connect/uri_service_oss.go +++ b/agent/connect/uri_service_ce.go @@ -10,13 +10,13 @@ import ( ) // GetEnterpriseMeta will synthesize an EnterpriseMeta struct from the SpiffeIDService. -// in OSS this just returns an empty (but never nil) struct pointer +// in CE this just returns an empty (but never nil) struct pointer func (id SpiffeIDService) GetEnterpriseMeta() *acl.EnterpriseMeta { return &acl.EnterpriseMeta{} } -// PartitionOrDefault breaks from OSS's pattern of returning empty strings. -// Although OSS has no support for partitions, it still needs to be able to +// PartitionOrDefault breaks from CE's pattern of returning empty strings. +// Although CE has no support for partitions, it still needs to be able to // handle exportedPartition from peered Consul Enterprise clusters in order // to generate the correct SpiffeID. func (id SpiffeIDService) PartitionOrDefault() string { diff --git a/agent/connect/uri_service_oss_test.go b/agent/connect/uri_service_ce_test.go similarity index 100% rename from agent/connect/uri_service_oss_test.go rename to agent/connect/uri_service_ce_test.go diff --git a/agent/consul/acl_authmethod_oss.go b/agent/consul/acl_authmethod_ce.go similarity index 100% rename from agent/consul/acl_authmethod_oss.go rename to agent/consul/acl_authmethod_ce.go diff --git a/agent/consul/acl_oss.go b/agent/consul/acl_ce.go similarity index 95% rename from agent/consul/acl_oss.go rename to agent/consul/acl_ce.go index 1fe4fbbf81..85555c57fc 100644 --- a/agent/consul/acl_oss.go +++ b/agent/consul/acl_ce.go @@ -33,13 +33,13 @@ func (r *ACLResolver) resolveEnterpriseDefaultsForIdentity(identity structs.ACLI // resolveEnterpriseIdentityAndRoles will resolve an enterprise identity to an additional set of roles func (_ *ACLResolver) resolveEnterpriseIdentityAndRoles(_ structs.ACLIdentity) (structs.ACLIdentity, structs.ACLRoles, error) { - // this function does nothing in OSS + // this function does nothing in CE return nil, nil, nil } // resolveEnterpriseIdentityAndPolicies will resolve an enterprise identity to an additional set of policies func (_ *ACLResolver) resolveEnterpriseIdentityAndPolicies(_ structs.ACLIdentity) (structs.ACLIdentity, structs.ACLPolicies, error) { - // this function does nothing in OSS + // this function does nothing in CE return nil, nil, nil } diff --git a/agent/consul/acl_oss_test.go b/agent/consul/acl_ce_test.go similarity index 100% rename from agent/consul/acl_oss_test.go rename to agent/consul/acl_ce_test.go diff --git a/agent/consul/acl_endpoint_oss.go b/agent/consul/acl_endpoint_ce.go similarity index 100% rename from agent/consul/acl_endpoint_oss.go rename to agent/consul/acl_endpoint_ce.go diff --git a/agent/consul/acl_server_oss.go b/agent/consul/acl_server_ce.go similarity index 100% rename from agent/consul/acl_server_oss.go rename to agent/consul/acl_server_ce.go diff --git a/agent/consul/auth/binder_oss.go b/agent/consul/auth/binder_ce.go similarity index 100% rename from agent/consul/auth/binder_oss.go rename to agent/consul/auth/binder_ce.go diff --git a/agent/consul/auth/token_writer_oss.go b/agent/consul/auth/token_writer_ce.go similarity index 100% rename from agent/consul/auth/token_writer_oss.go rename to agent/consul/auth/token_writer_ce.go diff --git a/agent/consul/authmethod/authmethods_oss.go b/agent/consul/authmethod/authmethods_ce.go similarity index 100% rename from agent/consul/authmethod/authmethods_oss.go rename to agent/consul/authmethod/authmethods_ce.go diff --git a/agent/consul/authmethod/kubeauth/k8s_oss.go b/agent/consul/authmethod/kubeauth/k8s_ce.go similarity index 100% rename from agent/consul/authmethod/kubeauth/k8s_oss.go rename to agent/consul/authmethod/kubeauth/k8s_ce.go diff --git a/agent/consul/authmethod/ssoauth/sso_oss.go b/agent/consul/authmethod/ssoauth/sso_ce.go similarity index 100% rename from agent/consul/authmethod/ssoauth/sso_oss.go rename to agent/consul/authmethod/ssoauth/sso_ce.go diff --git a/agent/consul/authmethod/testauth/testing_oss.go b/agent/consul/authmethod/testauth/testing_ce.go similarity index 100% rename from agent/consul/authmethod/testauth/testing_oss.go rename to agent/consul/authmethod/testauth/testing_ce.go diff --git a/agent/consul/autopilot_oss.go b/agent/consul/autopilot_ce.go similarity index 100% rename from agent/consul/autopilot_oss.go rename to agent/consul/autopilot_ce.go diff --git a/agent/consul/catalog_endpoint.go b/agent/consul/catalog_endpoint.go index bacafa688a..98399dffb6 100644 --- a/agent/consul/catalog_endpoint.go +++ b/agent/consul/catalog_endpoint.go @@ -447,7 +447,7 @@ func vetDeregisterWithACL( } // This order must match the code in applyDeregister() in - // fsm/commands_oss.go since it also evaluates things in this order, + // fsm/commands_ce.go since it also evaluates things in this order, // and will ignore fields based on this precedence. This lets us also // ignore them from an ACL perspective. if subj.ServiceID != "" { diff --git a/agent/consul/config_oss.go b/agent/consul/config_ce.go similarity index 100% rename from agent/consul/config_oss.go rename to agent/consul/config_ce.go diff --git a/agent/consul/discoverychain/compile_oss.go b/agent/consul/discoverychain/compile_ce.go similarity index 100% rename from agent/consul/discoverychain/compile_oss.go rename to agent/consul/discoverychain/compile_ce.go diff --git a/agent/consul/enterprise_client_oss.go b/agent/consul/enterprise_client_ce.go similarity index 100% rename from agent/consul/enterprise_client_oss.go rename to agent/consul/enterprise_client_ce.go diff --git a/agent/consul/enterprise_config_oss.go b/agent/consul/enterprise_config_ce.go similarity index 100% rename from agent/consul/enterprise_config_oss.go rename to agent/consul/enterprise_config_ce.go diff --git a/agent/consul/enterprise_server_oss.go b/agent/consul/enterprise_server_ce.go similarity index 98% rename from agent/consul/enterprise_server_oss.go rename to agent/consul/enterprise_server_ce.go index d6e07ddd8c..b0a8129ad5 100644 --- a/agent/consul/enterprise_server_oss.go +++ b/agent/consul/enterprise_server_ce.go @@ -74,7 +74,7 @@ func (s *Server) validateEnterpriseIntentionPartition(partition string) error { return nil } - // No special handling for wildcard partitions as they are pointless in OSS. + // No special handling for wildcard partitions as they are pointless in CE. return errors.New("Partitions is a Consul Enterprise feature") } @@ -86,7 +86,7 @@ func (s *Server) validateEnterpriseIntentionNamespace(ns string, _ bool) error { return nil } - // No special handling for wildcard namespaces as they are pointless in OSS. + // No special handling for wildcard namespaces as they are pointless in CE. return errors.New("Namespaces is a Consul Enterprise feature") } diff --git a/agent/consul/enterprise_server_oss_test.go b/agent/consul/enterprise_server_ce_test.go similarity index 100% rename from agent/consul/enterprise_server_oss_test.go rename to agent/consul/enterprise_server_ce_test.go diff --git a/agent/consul/fsm/commands_oss.go b/agent/consul/fsm/commands_ce.go similarity index 100% rename from agent/consul/fsm/commands_oss.go rename to agent/consul/fsm/commands_ce.go diff --git a/agent/consul/fsm/commands_oss_test.go b/agent/consul/fsm/commands_ce_test.go similarity index 100% rename from agent/consul/fsm/commands_oss_test.go rename to agent/consul/fsm/commands_ce_test.go diff --git a/agent/consul/fsm/fsm.go b/agent/consul/fsm/fsm.go index c6f40e65af..afa922143a 100644 --- a/agent/consul/fsm/fsm.go +++ b/agent/consul/fsm/fsm.go @@ -205,7 +205,7 @@ func (c *FSM) Restore(old io.ReadCloser) error { } default: if msg >= 64 { - return fmt.Errorf("msg type <%d> is a Consul Enterprise log entry. Consul OSS cannot restore it", msg) + return fmt.Errorf("msg type <%d> is a Consul Enterprise log entry. Consul CE cannot restore it", msg) } else { return fmt.Errorf("Unrecognized msg type %d", msg) } diff --git a/agent/consul/fsm/snapshot_oss.go b/agent/consul/fsm/snapshot_ce.go similarity index 99% rename from agent/consul/fsm/snapshot_oss.go rename to agent/consul/fsm/snapshot_ce.go index 3d0cd83439..8d3d4fe78a 100644 --- a/agent/consul/fsm/snapshot_oss.go +++ b/agent/consul/fsm/snapshot_ce.go @@ -14,7 +14,7 @@ import ( ) func init() { - registerPersister(persistOSS) + registerPersister(persistCE) registerRestorer(structs.RegisterRequestType, restoreRegistration) registerRestorer(structs.KVSRequestType, restoreKV) @@ -43,7 +43,7 @@ func init() { registerRestorer(structs.PeeringSecretsWriteType, restorePeeringSecrets) } -func persistOSS(s *snapshot, sink raft.SnapshotSink, encoder *codec.Encoder) error { +func persistCE(s *snapshot, sink raft.SnapshotSink, encoder *codec.Encoder) error { if err := s.persistVirtualIPs(sink, encoder); err != nil { return err } diff --git a/agent/consul/fsm/snapshot_oss_test.go b/agent/consul/fsm/snapshot_ce_test.go similarity index 88% rename from agent/consul/fsm/snapshot_oss_test.go rename to agent/consul/fsm/snapshot_ce_test.go index 301db3c2ae..13c5b1dcc4 100644 --- a/agent/consul/fsm/snapshot_oss_test.go +++ b/agent/consul/fsm/snapshot_ce_test.go @@ -19,7 +19,7 @@ func TestRestoreFromEnterprise(t *testing.T) { logger := testutil.Logger(t) fsm, err := New(nil, logger) require.NoError(t, err) - // To verify if a proper message is displayed when Consul OSS tries to + // To verify if a proper message is displayed when Consul CE tries to // unsuccessfully restore entries from a Consul Ent snapshot. buf := bytes.NewBuffer(nil) sink := &MockSink{buf, false} @@ -43,6 +43,6 @@ func TestRestoreFromEnterprise(t *testing.T) { sink.Write([]byte{byte(structs.MessageType(entMockEntry.ID))}) encoder.Encode(entMockEntry) - require.EqualError(t, fsm.Restore(sink), "msg type <65> is a Consul Enterprise log entry. Consul OSS cannot restore it") + require.EqualError(t, fsm.Restore(sink), "msg type <65> is a Consul Enterprise log entry. Consul CE cannot restore it") sink.Cancel() } diff --git a/agent/consul/fsm/snapshot_test.go b/agent/consul/fsm/snapshot_test.go index df9a5163dc..0cb3156834 100644 --- a/agent/consul/fsm/snapshot_test.go +++ b/agent/consul/fsm/snapshot_test.go @@ -21,7 +21,7 @@ import ( "github.com/hashicorp/consul/sdk/testutil" ) -func TestFSM_SnapshotRestore_OSS(t *testing.T) { +func TestFSM_SnapshotRestore_CE(t *testing.T) { t.Parallel() logger := testutil.Logger(t) @@ -860,7 +860,7 @@ func TestFSM_SnapshotRestore_OSS(t *testing.T) { } } -func TestFSM_BadRestore_OSS(t *testing.T) { +func TestFSM_BadRestore_CE(t *testing.T) { t.Parallel() // Create an FSM with some state. logger := testutil.Logger(t) diff --git a/agent/consul/leader_oss_test.go b/agent/consul/leader_ce_test.go similarity index 100% rename from agent/consul/leader_oss_test.go rename to agent/consul/leader_ce_test.go diff --git a/agent/consul/leader_intentions_oss.go b/agent/consul/leader_intentions_ce.go similarity index 96% rename from agent/consul/leader_intentions_oss.go rename to agent/consul/leader_intentions_ce.go index db9c742bd1..6913b6a90a 100644 --- a/agent/consul/leader_intentions_oss.go +++ b/agent/consul/leader_intentions_ce.go @@ -10,7 +10,7 @@ import ( ) func migrateIntentionsToConfigEntries(ixns structs.Intentions) []*structs.ServiceIntentionsConfigEntry { - // Remove any intention in OSS that happened to have used a non-default + // Remove any intention in CE that happened to have used a non-default // namespace. // // The one exception is that if we find wildcards namespaces we "upgrade" @@ -53,7 +53,7 @@ func migrateIntentionsToConfigEntries(ixns structs.Intentions) []*structs.Servic } retained[name] = struct{}{} output = append(output, ixn) - continue // a-ok for OSS + continue // a-ok for CE } // If anything is wildcarded, attempt to reify it as "default". diff --git a/agent/consul/leader_intentions_oss_test.go b/agent/consul/leader_intentions_ce_test.go similarity index 100% rename from agent/consul/leader_intentions_oss_test.go rename to agent/consul/leader_intentions_ce_test.go diff --git a/agent/consul/merge_oss.go b/agent/consul/merge_ce.go similarity index 100% rename from agent/consul/merge_oss.go rename to agent/consul/merge_ce.go diff --git a/agent/consul/merge_oss_test.go b/agent/consul/merge_ce_test.go similarity index 97% rename from agent/consul/merge_oss_test.go rename to agent/consul/merge_ce_test.go index 99333c7dd8..f046300de6 100644 --- a/agent/consul/merge_oss_test.go +++ b/agent/consul/merge_ce_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/consul/types" ) -func TestMerge_OSS_LAN(t *testing.T) { +func TestMerge_CE_LAN(t *testing.T) { type testcase struct { segment string server bool diff --git a/agent/consul/options_oss.go b/agent/consul/options_ce.go similarity index 100% rename from agent/consul/options_oss.go rename to agent/consul/options_ce.go diff --git a/agent/consul/peering_backend_oss.go b/agent/consul/peering_backend_ce.go similarity index 100% rename from agent/consul/peering_backend_oss.go rename to agent/consul/peering_backend_ce.go diff --git a/agent/consul/peering_backend_oss_test.go b/agent/consul/peering_backend_ce_test.go similarity index 100% rename from agent/consul/peering_backend_oss_test.go rename to agent/consul/peering_backend_ce_test.go diff --git a/agent/consul/prepared_query/walk_oss_test.go b/agent/consul/prepared_query/walk_ce_test.go similarity index 100% rename from agent/consul/prepared_query/walk_oss_test.go rename to agent/consul/prepared_query/walk_ce_test.go diff --git a/agent/consul/reporting/reporting_oss.go b/agent/consul/reporting/reporting_ce.go similarity index 100% rename from agent/consul/reporting/reporting_oss.go rename to agent/consul/reporting/reporting_ce.go diff --git a/agent/consul/segment_oss.go b/agent/consul/segment_ce.go similarity index 88% rename from agent/consul/segment_oss.go rename to agent/consul/segment_ce.go index 034e79c54e..44b8a14b2e 100644 --- a/agent/consul/segment_oss.go +++ b/agent/consul/segment_ce.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/consul/agent/structs" ) -var SegmentOSSSummaries = []prometheus.SummaryDefinition{ +var SegmentCESummaries = []prometheus.SummaryDefinition{ { Name: []string{"leader", "reconcile"}, Help: "Measures the time spent updating the raft store from the serf member information.", @@ -23,7 +23,7 @@ func (s *Server) LANSegmentAddr(name string) string { return "" } -// setupSegmentRPC returns an error if any segments are defined since the OSS +// setupSegmentRPC returns an error if any segments are defined since the CE // version of Consul doesn't support them. func (s *Server) setupSegmentRPC() (map[string]net.Listener, error) { if len(s.config.Segments) > 0 { @@ -33,7 +33,7 @@ func (s *Server) setupSegmentRPC() (map[string]net.Listener, error) { return nil, nil } -// setupSegments returns an error if any segments are defined since the OSS +// setupSegments returns an error if any segments are defined since the CE // version of Consul doesn't support them. func (s *Server) setupSegments(config *Config, rpcListeners map[string]net.Listener) error { if len(config.Segments) > 0 { @@ -43,6 +43,6 @@ func (s *Server) setupSegments(config *Config, rpcListeners map[string]net.Liste return nil } -// floodSegments is a NOP in the OSS version of Consul. +// floodSegments is a NOP in the CE version of Consul. func (s *Server) floodSegments(config *Config) { } diff --git a/agent/consul/server_oss.go b/agent/consul/server_ce.go similarity index 98% rename from agent/consul/server_oss.go rename to agent/consul/server_ce.go index 5e285c9635..63de1bfe85 100644 --- a/agent/consul/server_oss.go +++ b/agent/consul/server_ce.go @@ -79,7 +79,7 @@ func (s *Server) removeFailedNode( } // lanPoolAllMembers only returns our own segment or partition's members, because -// OSS servers can't be in multiple segments or partitions. +// CE servers can't be in multiple segments or partitions. func (s *Server) lanPoolAllMembers() ([]serf.Member, error) { return s.LANMembersInAgentPartition(), nil } diff --git a/agent/consul/server_oss_test.go b/agent/consul/server_ce_test.go similarity index 100% rename from agent/consul/server_oss_test.go rename to agent/consul/server_ce_test.go diff --git a/agent/consul/state/acl_oss.go b/agent/consul/state/acl_ce.go similarity index 100% rename from agent/consul/state/acl_oss.go rename to agent/consul/state/acl_ce.go diff --git a/agent/consul/state/acl_oss_test.go b/agent/consul/state/acl_ce_test.go similarity index 100% rename from agent/consul/state/acl_oss_test.go rename to agent/consul/state/acl_ce_test.go diff --git a/agent/consul/state/catalog_oss.go b/agent/consul/state/catalog_ce.go similarity index 99% rename from agent/consul/state/catalog_oss.go rename to agent/consul/state/catalog_ce.go index fccbf6984e..ee599402d6 100644 --- a/agent/consul/state/catalog_oss.go +++ b/agent/consul/state/catalog_ce.go @@ -112,7 +112,7 @@ func catalogUpdateNodeExtinctionIndex(tx WriteTxn, idx uint64, _ *acl.Enterprise } func catalogInsertNode(tx WriteTxn, node *structs.Node) error { - // ensure that the Partition is always clear within the state store in OSS + // ensure that the Partition is always clear within the state store in CE node.Partition = "" // Insert the node and update the index. diff --git a/agent/consul/state/catalog_oss_test.go b/agent/consul/state/catalog_ce_test.go similarity index 100% rename from agent/consul/state/catalog_oss_test.go rename to agent/consul/state/catalog_ce_test.go diff --git a/agent/consul/state/catalog_events_oss.go b/agent/consul/state/catalog_events_ce.go similarity index 100% rename from agent/consul/state/catalog_events_oss.go rename to agent/consul/state/catalog_events_ce.go diff --git a/agent/consul/state/catalog_events_oss_test.go b/agent/consul/state/catalog_events_ce_test.go similarity index 92% rename from agent/consul/state/catalog_events_oss_test.go rename to agent/consul/state/catalog_events_ce_test.go index ace7cfe712..8c29c69298 100644 --- a/agent/consul/state/catalog_events_oss_test.go +++ b/agent/consul/state/catalog_events_ce_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/consul/agent/structs" ) -func TestEventPayloadCheckServiceNode_Subject_OSS(t *testing.T) { +func TestEventPayloadCheckServiceNode_Subject_CE(t *testing.T) { for desc, tc := range map[string]struct { evt EventPayloadCheckServiceNode sub string diff --git a/agent/consul/state/config_entry_oss.go b/agent/consul/state/config_entry_ce.go similarity index 95% rename from agent/consul/state/config_entry_oss.go rename to agent/consul/state/config_entry_ce.go index ac4d1d6cb0..07e7167b38 100644 --- a/agent/consul/state/config_entry_oss.go +++ b/agent/consul/state/config_entry_ce.go @@ -62,7 +62,7 @@ func configIntentionsConvertToList(iter memdb.ResultIterator, _ *acl.EnterpriseM } // getExportedServicesMatchServicesNames returns a list of service names that are considered matches when -// found in a list of exported-services config entries. For OSS, namespace is not considered, so a match is one of: +// found in a list of exported-services config entries. For CE, namespace is not considered, so a match is one of: // - the service name matches // - the service name is a wildcard // diff --git a/agent/consul/state/config_entry_oss_test.go b/agent/consul/state/config_entry_ce_test.go similarity index 100% rename from agent/consul/state/config_entry_oss_test.go rename to agent/consul/state/config_entry_ce_test.go diff --git a/agent/consul/state/config_entry_intention.go b/agent/consul/state/config_entry_intention.go index 17183e7cee..76b5a487af 100644 --- a/agent/consul/state/config_entry_intention.go +++ b/agent/consul/state/config_entry_intention.go @@ -80,7 +80,7 @@ type ServiceIntentionSourceIndex struct { } // Compile-time assert that these interfaces hold to ensure that the -// methods correctly exist across the oss/ent split. +// methods correctly exist across the ce/ent split. var _ memdb.Indexer = (*ServiceIntentionSourceIndex)(nil) var _ memdb.MultiIndexer = (*ServiceIntentionSourceIndex)(nil) diff --git a/agent/consul/state/config_entry_intention_oss.go b/agent/consul/state/config_entry_intention_ce.go similarity index 100% rename from agent/consul/state/config_entry_intention_oss.go rename to agent/consul/state/config_entry_intention_ce.go diff --git a/agent/consul/state/coordinate_oss.go b/agent/consul/state/coordinate_ce.go similarity index 100% rename from agent/consul/state/coordinate_oss.go rename to agent/consul/state/coordinate_ce.go diff --git a/agent/consul/state/coordinate_oss_test.go b/agent/consul/state/coordinate_ce_test.go similarity index 100% rename from agent/consul/state/coordinate_oss_test.go rename to agent/consul/state/coordinate_ce_test.go diff --git a/agent/consul/state/delay_oss.go b/agent/consul/state/delay_ce.go similarity index 100% rename from agent/consul/state/delay_oss.go rename to agent/consul/state/delay_ce.go diff --git a/agent/consul/state/graveyard_oss.go b/agent/consul/state/graveyard_ce.go similarity index 100% rename from agent/consul/state/graveyard_oss.go rename to agent/consul/state/graveyard_ce.go diff --git a/agent/consul/state/intention_oss.go b/agent/consul/state/intention_ce.go similarity index 100% rename from agent/consul/state/intention_oss.go rename to agent/consul/state/intention_ce.go diff --git a/agent/consul/state/kvs_oss.go b/agent/consul/state/kvs_ce.go similarity index 100% rename from agent/consul/state/kvs_oss.go rename to agent/consul/state/kvs_ce.go diff --git a/agent/consul/state/kvs_oss_test.go b/agent/consul/state/kvs_ce_test.go similarity index 100% rename from agent/consul/state/kvs_oss_test.go rename to agent/consul/state/kvs_ce_test.go diff --git a/agent/consul/state/operations_oss.go b/agent/consul/state/operations_ce.go similarity index 100% rename from agent/consul/state/operations_oss.go rename to agent/consul/state/operations_ce.go diff --git a/agent/consul/state/peering.go b/agent/consul/state/peering.go index 3fafb98cba..5fbd1b79f2 100644 --- a/agent/consul/state/peering.go +++ b/agent/consul/state/peering.go @@ -1428,7 +1428,7 @@ func peersForServiceTxn( ) // Ensure the metadata is defaulted since we make assertions against potentially empty values below. - // In OSS this is a no-op. + // In CE this is a no-op. if entMeta == nil { entMeta = acl.DefaultEnterpriseMeta() } diff --git a/agent/consul/state/peering_oss.go b/agent/consul/state/peering_ce.go similarity index 100% rename from agent/consul/state/peering_oss.go rename to agent/consul/state/peering_ce.go diff --git a/agent/consul/state/peering_oss_test.go b/agent/consul/state/peering_ce_test.go similarity index 100% rename from agent/consul/state/peering_oss_test.go rename to agent/consul/state/peering_ce_test.go diff --git a/agent/consul/state/query_oss.go b/agent/consul/state/query_ce.go similarity index 100% rename from agent/consul/state/query_oss.go rename to agent/consul/state/query_ce.go diff --git a/agent/consul/state/schema_oss.go b/agent/consul/state/schema_ce.go similarity index 100% rename from agent/consul/state/schema_oss.go rename to agent/consul/state/schema_ce.go diff --git a/agent/consul/state/schema_oss_test.go b/agent/consul/state/schema_ce_test.go similarity index 100% rename from agent/consul/state/schema_oss_test.go rename to agent/consul/state/schema_ce_test.go diff --git a/agent/consul/state/session_oss.go b/agent/consul/state/session_ce.go similarity index 100% rename from agent/consul/state/session_oss.go rename to agent/consul/state/session_ce.go diff --git a/agent/consul/state/state_store_oss_test.go b/agent/consul/state/state_store_ce_test.go similarity index 100% rename from agent/consul/state/state_store_oss_test.go rename to agent/consul/state/state_store_ce_test.go diff --git a/agent/consul/state/usage_oss.go b/agent/consul/state/usage_ce.go similarity index 100% rename from agent/consul/state/usage_oss.go rename to agent/consul/state/usage_ce.go diff --git a/agent/consul/usagemetrics/usagemetrics_oss.go b/agent/consul/usagemetrics/usagemetrics_ce.go similarity index 100% rename from agent/consul/usagemetrics/usagemetrics_oss.go rename to agent/consul/usagemetrics/usagemetrics_ce.go diff --git a/agent/consul/usagemetrics/usagemetrics_oss_test.go b/agent/consul/usagemetrics/usagemetrics_ce_test.go similarity index 99% rename from agent/consul/usagemetrics/usagemetrics_oss_test.go rename to agent/consul/usagemetrics/usagemetrics_ce_test.go index 4f2a1efc8e..4367fc7a84 100644 --- a/agent/consul/usagemetrics/usagemetrics_oss_test.go +++ b/agent/consul/usagemetrics/usagemetrics_ce_test.go @@ -900,7 +900,7 @@ var baseCases = map[string]testCase{ }, } -func TestUsageReporter_emitNodeUsage_OSS(t *testing.T) { +func TestUsageReporter_emitNodeUsage_CE(t *testing.T) { cases := baseCases for name, tcase := range cases { @@ -939,7 +939,7 @@ func TestUsageReporter_emitNodeUsage_OSS(t *testing.T) { } } -func TestUsageReporter_emitPeeringUsage_OSS(t *testing.T) { +func TestUsageReporter_emitPeeringUsage_CE(t *testing.T) { cases := make(map[string]testCase) for k, v := range baseCases { eg := make(map[string]metrics.GaugeValue) @@ -1043,7 +1043,7 @@ func TestUsageReporter_emitPeeringUsage_OSS(t *testing.T) { } } -func TestUsageReporter_emitServiceUsage_OSS(t *testing.T) { +func TestUsageReporter_emitServiceUsage_CE(t *testing.T) { cases := make(map[string]testCase) for k, v := range baseCases { eg := make(map[string]metrics.GaugeValue) @@ -1303,7 +1303,7 @@ func TestUsageReporter_emitServiceUsage_OSS(t *testing.T) { } } -func TestUsageReporter_emitKVUsage_OSS(t *testing.T) { +func TestUsageReporter_emitKVUsage_CE(t *testing.T) { cases := make(map[string]testCase) for k, v := range baseCases { eg := make(map[string]metrics.GaugeValue) diff --git a/agent/dns_oss.go b/agent/dns_ce.go similarity index 100% rename from agent/dns_oss.go rename to agent/dns_ce.go diff --git a/agent/dns_oss_test.go b/agent/dns_ce_test.go similarity index 98% rename from agent/dns_oss_test.go rename to agent/dns_ce_test.go index c3cf264c68..26ee6dc247 100644 --- a/agent/dns_oss_test.go +++ b/agent/dns_ce_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestDNS_OSS_PeeredServices(t *testing.T) { +func TestDNS_CE_PeeredServices(t *testing.T) { if testing.Short() { t.Skip("too slow for testing.Short") } diff --git a/agent/enterprise_delegate_oss.go b/agent/enterprise_delegate_ce.go similarity index 67% rename from agent/enterprise_delegate_oss.go rename to agent/enterprise_delegate_ce.go index 876c8837af..3998489825 100644 --- a/agent/enterprise_delegate_oss.go +++ b/agent/enterprise_delegate_ce.go @@ -3,5 +3,5 @@ package agent -// enterpriseDelegate has no functions in OSS +// enterpriseDelegate has no functions in CE type enterpriseDelegate interface{} diff --git a/agent/http_oss.go b/agent/http_ce.go similarity index 99% rename from agent/http_oss.go rename to agent/http_ce.go index 94eb575c36..04c14b7f32 100644 --- a/agent/http_oss.go +++ b/agent/http_ce.go @@ -36,7 +36,7 @@ func (s *HTTPHandlers) validateEnterpriseIntentionPartition(logName, partition s return nil } - // No special handling for wildcard namespaces as they are pointless in OSS. + // No special handling for wildcard namespaces as they are pointless in CE. return HTTPError{ StatusCode: http.StatusBadRequest, @@ -51,7 +51,7 @@ func (s *HTTPHandlers) validateEnterpriseIntentionNamespace(logName, ns string, return nil } - // No special handling for wildcard namespaces as they are pointless in OSS. + // No special handling for wildcard namespaces as they are pointless in CE. return HTTPError{ StatusCode: http.StatusBadRequest, diff --git a/agent/http_oss_test.go b/agent/http_ce_test.go similarity index 97% rename from agent/http_oss_test.go rename to agent/http_ce_test.go index 5da29e614a..b6cb8fe2bb 100644 --- a/agent/http_oss_test.go +++ b/agent/http_ce_test.go @@ -59,7 +59,7 @@ func newHttpClient(timeout time.Duration) *http.Client { } } -func TestHTTPAPI_MethodNotAllowed_OSS(t *testing.T) { +func TestHTTPAPI_MethodNotAllowed_CE(t *testing.T) { if testing.Short() { t.Skip("too slow for testing.Short") } @@ -127,7 +127,7 @@ func TestHTTPAPI_MethodNotAllowed_OSS(t *testing.T) { } } -func TestHTTPAPI_OptionMethod_OSS(t *testing.T) { +func TestHTTPAPI_OptionMethod_CE(t *testing.T) { if testing.Short() { t.Skip("too slow for testing.Short") } @@ -169,7 +169,7 @@ func TestHTTPAPI_OptionMethod_OSS(t *testing.T) { } } -func TestHTTPAPI_AllowedNets_OSS(t *testing.T) { +func TestHTTPAPI_AllowedNets_CE(t *testing.T) { if testing.Short() { t.Skip("too slow for testing.Short") } diff --git a/agent/intentions_endpoint_oss_test.go b/agent/intentions_endpoint_ce_test.go similarity index 95% rename from agent/intentions_endpoint_oss_test.go rename to agent/intentions_endpoint_ce_test.go index eb04d978bd..74163f9fdd 100644 --- a/agent/intentions_endpoint_oss_test.go +++ b/agent/intentions_endpoint_ce_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestOSS_IntentionsCreate_failure(t *testing.T) { +func TestCE_IntentionsCreate_failure(t *testing.T) { if testing.Short() { t.Skip("too slow for testing.Short") } diff --git a/agent/operator_endpoint_oss.go b/agent/operator_endpoint_ce.go similarity index 97% rename from agent/operator_endpoint_oss.go rename to agent/operator_endpoint_ce.go index 9367cc367a..e31dacae46 100644 --- a/agent/operator_endpoint_oss.go +++ b/agent/operator_endpoint_ce.go @@ -9,7 +9,7 @@ import ( ) func autopilotToAPIServerEnterprise(_ *autopilot.ServerState, _ *api.AutopilotServer) { - // noop in oss + // noop in ce } func autopilotToAPIStateEnterprise(state *autopilot.State, apiState *api.AutopilotState) { diff --git a/agent/operator_endpoint_oss_test.go b/agent/operator_endpoint_ce_test.go similarity index 100% rename from agent/operator_endpoint_oss_test.go rename to agent/operator_endpoint_ce_test.go diff --git a/agent/peering_endpoint.go b/agent/peering_endpoint.go index f625e9c78e..42ae160e53 100644 --- a/agent/peering_endpoint.go +++ b/agent/peering_endpoint.go @@ -75,7 +75,7 @@ func (s *HTTPHandlers) peeringRead(resp http.ResponseWriter, req *http.Request, return result.Peering.ToAPI(), nil } -// PeeringList fetches all peerings in the datacenter in OSS or in a given partition in Consul Enterprise. +// PeeringList fetches all peerings in the datacenter in CE or in a given partition in Consul Enterprise. func (s *HTTPHandlers) PeeringList(resp http.ResponseWriter, req *http.Request) (interface{}, error) { var entMeta acl.EnterpriseMeta if err := s.parseEntMetaPartition(req, &entMeta); err != nil { diff --git a/agent/peering_endpoint_oss_test.go b/agent/peering_endpoint_ce_test.go similarity index 85% rename from agent/peering_endpoint_oss_test.go rename to agent/peering_endpoint_ce_test.go index 5e00b05767..2019791ed8 100644 --- a/agent/peering_endpoint_oss_test.go +++ b/agent/peering_endpoint_ce_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/consul/testrpc" ) -func TestHTTP_Peering_GenerateToken_OSS_Failure(t *testing.T) { +func TestHTTP_Peering_GenerateToken_CE_Failure(t *testing.T) { if testing.Short() { t.Skip("too slow for testing.Short") } @@ -27,7 +27,7 @@ func TestHTTP_Peering_GenerateToken_OSS_Failure(t *testing.T) { a := NewTestAgent(t, "") testrpc.WaitForTestAgent(t, a.RPC, "dc1") - t.Run("Doesn't allow partitions in OSS HTTP requests", func(t *testing.T) { + t.Run("Doesn't allow partitions in CE HTTP requests", func(t *testing.T) { reqBody := &pbpeering.GenerateTokenRequest{ PeerName: "peering-a", } @@ -44,7 +44,7 @@ func TestHTTP_Peering_GenerateToken_OSS_Failure(t *testing.T) { }) } -func TestHTTP_PeeringEndpoint_OSS_Failure(t *testing.T) { +func TestHTTP_PeeringEndpoint_CE_Failure(t *testing.T) { if testing.Short() { t.Skip("too slow for testing.Short") } @@ -54,7 +54,7 @@ func TestHTTP_PeeringEndpoint_OSS_Failure(t *testing.T) { a := NewTestAgent(t, "") testrpc.WaitForTestAgent(t, a.RPC, "dc1") - t.Run("Doesn't allow partitions on PeeringEndpoint in OSS HTTP requests", func(t *testing.T) { + t.Run("Doesn't allow partitions on PeeringEndpoint in CE HTTP requests", func(t *testing.T) { req, err := http.NewRequest("GET", "/v1/peering/foo?partition=foo", nil) require.NoError(t, err) resp := httptest.NewRecorder() diff --git a/agent/proxycfg-glue/intentions_oss.go b/agent/proxycfg-glue/intentions_ce.go similarity index 100% rename from agent/proxycfg-glue/intentions_oss.go rename to agent/proxycfg-glue/intentions_ce.go diff --git a/agent/proxycfg/data_sources_oss.go b/agent/proxycfg/data_sources_ce.go similarity index 100% rename from agent/proxycfg/data_sources_oss.go rename to agent/proxycfg/data_sources_ce.go diff --git a/agent/proxycfg/mesh_gateway_oss.go b/agent/proxycfg/mesh_gateway_ce.go similarity index 100% rename from agent/proxycfg/mesh_gateway_oss.go rename to agent/proxycfg/mesh_gateway_ce.go diff --git a/agent/proxycfg/naming.go b/agent/proxycfg/naming.go index 0ab355160d..ec8a3d5992 100644 --- a/agent/proxycfg/naming.go +++ b/agent/proxycfg/naming.go @@ -150,7 +150,7 @@ func ParseUpstreamIDString(input string) (typ, dc, name string, meta *acl.Enterp // This should be used for any situation where we generate identifiers in Envoy // xDS structures for this upstream. // -// This will ensure that generated identifiers for the same thing in OSS and +// This will ensure that generated identifiers for the same thing in CE and // Enterprise render the same and omit default namespaces and partitions. func (u UpstreamID) EnvoyID() string { name := u.enterpriseIdentifierPrefix() + u.Name diff --git a/agent/proxycfg/naming_oss.go b/agent/proxycfg/naming_ce.go similarity index 100% rename from agent/proxycfg/naming_oss.go rename to agent/proxycfg/naming_ce.go diff --git a/agent/proxycfg/snapshot.go b/agent/proxycfg/snapshot.go index edb52053c6..4ef2f7443e 100644 --- a/agent/proxycfg/snapshot.go +++ b/agent/proxycfg/snapshot.go @@ -64,7 +64,7 @@ type ConfigSnapshotUpstreams struct { // gateway endpoints. // // Note that the string form of GatewayKey is used as the key so empty - // fields can be normalized in OSS. + // fields can be normalized in CE. // GatewayKey.String() -> structs.CheckServiceNodes WatchedLocalGWEndpoints watch.Map[string, structs.CheckServiceNodes] diff --git a/agent/proxycfg/state_oss_test.go b/agent/proxycfg/state_ce_test.go similarity index 100% rename from agent/proxycfg/state_oss_test.go rename to agent/proxycfg/state_ce_test.go diff --git a/agent/proxycfg/state_test.go b/agent/proxycfg/state_test.go index 7093a71265..2b339c79a0 100644 --- a/agent/proxycfg/state_test.go +++ b/agent/proxycfg/state_test.go @@ -454,7 +454,7 @@ func TestState_WatchesAndUpdates(t *testing.T) { indexedRoots, issuedCert := TestCerts(t) peerTrustBundles := TestPeerTrustBundles(t) - // Used to account for differences in OSS/ent implementations of ServiceID.String() + // Used to account for differences in ce/ent implementations of ServiceID.String() var ( db = structs.NewServiceName("db", nil) billing = structs.NewServiceName("billing", nil) diff --git a/agent/proxycfg/testing_oss.go b/agent/proxycfg/testing_ce.go similarity index 100% rename from agent/proxycfg/testing_oss.go rename to agent/proxycfg/testing_ce.go diff --git a/agent/proxycfg/testing_ingress_gateway.go b/agent/proxycfg/testing_ingress_gateway.go index 5e981b9e57..4712ea6b04 100644 --- a/agent/proxycfg/testing_ingress_gateway.go +++ b/agent/proxycfg/testing_ingress_gateway.go @@ -1110,10 +1110,10 @@ func TestConfigSnapshotIngressGatewayWithChain( webUpstream := structs.Upstream{ DestinationName: "web", // We use empty not default here because of the way upstream identifiers - // vary between OSS and Enterprise currently causing test conflicts. In + // vary between CE and Enterprise currently causing test conflicts. In // real life `proxycfg` always sets ingress upstream namespaces to // `NamespaceOrDefault` which shouldn't matter because we should be - // consistent within a single binary it's just inconvenient if OSS and + // consistent within a single binary it's just inconvenient if CE and // enterprise tests generate different output. DestinationNamespace: webEntMeta.NamespaceOrEmpty(), DestinationPartition: webEntMeta.PartitionOrEmpty(), diff --git a/agent/rpc/peering/service.go b/agent/rpc/peering/service.go index 8d0e8a7760..46fe5e23af 100644 --- a/agent/rpc/peering/service.go +++ b/agent/rpc/peering/service.go @@ -272,7 +272,7 @@ func (s *Server) GenerateToken( Name: req.PeerName, Meta: req.Meta, - // PartitionOrEmpty is used to avoid writing "default" in OSS. + // PartitionOrEmpty is used to avoid writing "default" in CE. Partition: entMeta.PartitionOrEmpty(), } } else { @@ -446,7 +446,7 @@ func (s *Server) Establish( // while the original connection is still active. // State: pbpeering.PeeringState_ESTABLISHING, - // PartitionOrEmpty is used to avoid writing "default" in OSS. + // PartitionOrEmpty is used to avoid writing "default" in CE. Partition: entMeta.PartitionOrEmpty(), Remote: &pbpeering.RemoteInfo{ Partition: tok.Remote.Partition, @@ -936,7 +936,7 @@ func (s *Server) PeeringDelete(ctx context.Context, req *pbpeering.PeeringDelete PeerServerAddresses: existing.PeerServerAddresses, DeletedAt: timestamppb.New(time.Now().UTC()), - // PartitionOrEmpty is used to avoid writing "default" in OSS. + // PartitionOrEmpty is used to avoid writing "default" in CE. Partition: entMeta.PartitionOrEmpty(), }, } diff --git a/agent/rpc/peering/service_oss_test.go b/agent/rpc/peering/service_ce_test.go similarity index 100% rename from agent/rpc/peering/service_oss_test.go rename to agent/rpc/peering/service_ce_test.go diff --git a/agent/rpc/peering/testutil_oss_test.go b/agent/rpc/peering/testutil_ce_test.go similarity index 100% rename from agent/rpc/peering/testutil_oss_test.go rename to agent/rpc/peering/testutil_ce_test.go diff --git a/agent/rpcclient/health/view_test.go b/agent/rpcclient/health/view_test.go index f1d2cd0869..982e5dbf3f 100644 --- a/agent/rpcclient/health/view_test.go +++ b/agent/rpcclient/health/view_test.go @@ -718,7 +718,7 @@ func newNewSnapshotToFollowEvent() *pbsubscribe.Event { } // getNamespace returns a namespace if namespace support exists, otherwise -// returns the empty string. It allows the same tests to work in both oss and ent +// returns the empty string. It allows the same tests to work in both ce and ent // without duplicating the tests. func getNamespace(ns string) string { meta := structs.NewEnterpriseMetaInDefaultPartition(ns) diff --git a/agent/setup.go b/agent/setup.go index aef10abf45..43ed8c74bf 100644 --- a/agent/setup.go +++ b/agent/setup.go @@ -456,7 +456,7 @@ func getPrometheusDefs(cfg *config.RuntimeConfig, isServer bool) ([]prometheus.G consul.LeaderSummaries, consul.PreparedQuerySummaries, consul.RPCSummaries, - consul.SegmentOSSSummaries, + consul.SegmentCESummaries, consul.SessionSummaries, consul.SessionEndpointSummaries, consul.TxnSummaries, diff --git a/agent/setup_oss.go b/agent/setup_ce.go similarity index 100% rename from agent/setup_oss.go rename to agent/setup_ce.go diff --git a/agent/structs/acl_oss.go b/agent/structs/acl_ce.go similarity index 100% rename from agent/structs/acl_oss.go rename to agent/structs/acl_ce.go diff --git a/agent/structs/autopilot_oss.go b/agent/structs/autopilot_ce.go similarity index 100% rename from agent/structs/autopilot_oss.go rename to agent/structs/autopilot_ce.go diff --git a/agent/structs/catalog_oss.go b/agent/structs/catalog_ce.go similarity index 100% rename from agent/structs/catalog_oss.go rename to agent/structs/catalog_ce.go diff --git a/agent/structs/config_entry_oss.go b/agent/structs/config_entry_ce.go similarity index 100% rename from agent/structs/config_entry_oss.go rename to agent/structs/config_entry_ce.go diff --git a/agent/structs/config_entry_oss_test.go b/agent/structs/config_entry_ce_test.go similarity index 97% rename from agent/structs/config_entry_oss_test.go rename to agent/structs/config_entry_ce_test.go index fbf0a9ebd3..ed6fedc4e6 100644 --- a/agent/structs/config_entry_oss_test.go +++ b/agent/structs/config_entry_ce_test.go @@ -4,12 +4,13 @@ package structs import ( + "testing" + "github.com/hashicorp/hcl" "github.com/stretchr/testify/require" - "testing" ) -func TestDecodeConfigEntry_OSS(t *testing.T) { +func TestDecodeConfigEntry_CE(t *testing.T) { for _, tc := range []struct { name string diff --git a/agent/structs/config_entry_discoverychain_oss.go b/agent/structs/config_entry_discoverychain_ce.go similarity index 100% rename from agent/structs/config_entry_discoverychain_oss.go rename to agent/structs/config_entry_discoverychain_ce.go diff --git a/agent/structs/config_entry_discoverychain_oss_test.go b/agent/structs/config_entry_discoverychain_ce_test.go similarity index 90% rename from agent/structs/config_entry_discoverychain_oss_test.go rename to agent/structs/config_entry_discoverychain_ce_test.go index 9f962c8bd4..c584487715 100644 --- a/agent/structs/config_entry_discoverychain_oss_test.go +++ b/agent/structs/config_entry_discoverychain_ce_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestServiceResolverConfigEntry_OSS(t *testing.T) { +func TestServiceResolverConfigEntry_CE(t *testing.T) { type testcase struct { name string entry *ServiceResolverConfigEntry @@ -22,7 +22,7 @@ func TestServiceResolverConfigEntry_OSS(t *testing.T) { cases := []testcase{ { - name: "failover with a namespace on OSS", + name: "failover with a namespace on CE", entry: &ServiceResolverConfigEntry{ Kind: ServiceResolver, Name: "test", @@ -36,7 +36,7 @@ func TestServiceResolverConfigEntry_OSS(t *testing.T) { validateErr: `Bad Failover["*"]: Setting Namespace requires Consul Enterprise`, }, { - name: "failover Targets cannot set Namespace on OSS", + name: "failover Targets cannot set Namespace on CE", entry: &ServiceResolverConfigEntry{ Kind: ServiceResolver, Name: "test", @@ -49,7 +49,7 @@ func TestServiceResolverConfigEntry_OSS(t *testing.T) { validateErr: `Bad Failover["*"].Targets[0]: Setting Namespace requires Consul Enterprise`, }, { - name: "failover Targets cannot set Partition on OSS", + name: "failover Targets cannot set Partition on CE", entry: &ServiceResolverConfigEntry{ Kind: ServiceResolver, Name: "test", @@ -62,7 +62,7 @@ func TestServiceResolverConfigEntry_OSS(t *testing.T) { validateErr: `Bad Failover["*"].Targets[0]: Setting Partition requires Consul Enterprise`, }, { - name: "setting failover Namespace on OSS", + name: "setting failover Namespace on CE", entry: &ServiceResolverConfigEntry{ Kind: ServiceResolver, Name: "test", @@ -73,7 +73,7 @@ func TestServiceResolverConfigEntry_OSS(t *testing.T) { validateErr: `Bad Failover["*"]: Setting Namespace requires Consul Enterprise`, }, { - name: "setting redirect Namespace on OSS", + name: "setting redirect Namespace on CE", entry: &ServiceResolverConfigEntry{ Kind: ServiceResolver, Name: "test", @@ -84,7 +84,7 @@ func TestServiceResolverConfigEntry_OSS(t *testing.T) { validateErr: `Redirect: Setting Namespace requires Consul Enterprise`, }, { - name: "setting redirect Partition on OSS", + name: "setting redirect Partition on CE", entry: &ServiceResolverConfigEntry{ Kind: ServiceResolver, Name: "test", diff --git a/agent/structs/config_entry_export_oss_test.go b/agent/structs/config_entry_exports_ce_test.go similarity index 92% rename from agent/structs/config_entry_export_oss_test.go rename to agent/structs/config_entry_exports_ce_test.go index 19ce3d05f6..6a66d2b319 100644 --- a/agent/structs/config_entry_export_oss_test.go +++ b/agent/structs/config_entry_exports_ce_test.go @@ -7,9 +7,9 @@ import ( "testing" ) -func TestExportedServicesConfigEntry_OSS(t *testing.T) { +func TestExportedServicesConfigEntry_CE(t *testing.T) { cases := map[string]configEntryTestcase{ - "normalize: noop in oss": { + "normalize: noop in ce": { entry: &ExportedServicesConfigEntry{ Name: "default", Services: []ExportedService{ diff --git a/agent/structs/config_entry_gateways_test.go b/agent/structs/config_entry_gateways_test.go index 1302cb2ad7..32976c2c13 100644 --- a/agent/structs/config_entry_gateways_test.go +++ b/agent/structs/config_entry_gateways_test.go @@ -521,7 +521,7 @@ func TestIngressGatewayConfigEntry(t *testing.T) { }, }, // Match only the last part of the exected error because the service name - // differs between Ent and OSS default/default/web vs web + // differs between Ent and CE default/default/web vs web validateErr: "cannot be added multiple times (listener on port 1111)", }, "TLS.SDS kitchen sink": { @@ -865,7 +865,7 @@ func TestIngressGatewayConfigEntry(t *testing.T) { }, }, // Note we don't assert the last part `(service \"*\" on listener on port 1111)` - // since the service name is normalized differently on OSS and Ent + // since the service name is normalized differently on CE and Ent validateErr: "A service specifying TLS.SDS.CertResource must have at least one item in Hosts", }, "TLS.SDS at service level needs a cluster from somewhere": { @@ -892,7 +892,7 @@ func TestIngressGatewayConfigEntry(t *testing.T) { }, }, // Note we don't assert the last part `(service \"foo\" on listener on port 1111)` - // since the service name is normalized differently on OSS and Ent + // since the service name is normalized differently on CE and Ent validateErr: "TLS.SDS.ClusterName is required if CertResource is set", }, } diff --git a/agent/structs/config_entry_intentions_oss.go b/agent/structs/config_entry_intentions_ce.go similarity index 100% rename from agent/structs/config_entry_intentions_oss.go rename to agent/structs/config_entry_intentions_ce.go diff --git a/agent/structs/config_entry_mesh_oss.go b/agent/structs/config_entry_mesh_ce.go similarity index 100% rename from agent/structs/config_entry_mesh_oss.go rename to agent/structs/config_entry_mesh_ce.go diff --git a/agent/structs/config_entry_test.go b/agent/structs/config_entry_test.go index 2591d5d1ff..9aa4ea0c6a 100644 --- a/agent/structs/config_entry_test.go +++ b/agent/structs/config_entry_test.go @@ -3390,7 +3390,7 @@ func testConfigEntryNormalizeAndValidate(t *testing.T, cases map[string]configEn } if tc.expectUnchanged { - // EnterpriseMeta.Normalize behaves differently in Ent and OSS which + // EnterpriseMeta.Normalize behaves differently in Ent and CE which // causes an exact comparison to fail. It's still useful to assert that // nothing else changes though during Normalize. So we ignore // EnterpriseMeta Defaults. diff --git a/agent/structs/connect_oss.go b/agent/structs/connect_ce.go similarity index 100% rename from agent/structs/connect_oss.go rename to agent/structs/connect_ce.go diff --git a/agent/structs/connect_proxy_config_oss.go b/agent/structs/connect_proxy_config_ce.go similarity index 100% rename from agent/structs/connect_proxy_config_oss.go rename to agent/structs/connect_proxy_config_ce.go diff --git a/agent/structs/discovery_chain_oss.go b/agent/structs/discovery_chain_ce.go similarity index 100% rename from agent/structs/discovery_chain_oss.go rename to agent/structs/discovery_chain_ce.go diff --git a/agent/structs/intention_oss.go b/agent/structs/intention_ce.go similarity index 90% rename from agent/structs/intention_oss.go rename to agent/structs/intention_ce.go index e35b9b5b3d..fbae3b4099 100644 --- a/agent/structs/intention_oss.go +++ b/agent/structs/intention_ce.go @@ -28,21 +28,21 @@ func (e *IntentionQueryExact) DestinationEnterpriseMeta() *acl.EnterpriseMeta { } // FillAuthzContext can fill in an acl.AuthorizerContext object to setup -// extra parameters for ACL enforcement. In OSS there is currently nothing +// extra parameters for ACL enforcement. In CE there is currently nothing // extra to be done. func (_ *Intention) FillAuthzContext(_ *acl.AuthorizerContext, _ bool) { // do nothing } // FillAuthzContext can fill in an acl.AuthorizerContext object to setup -// extra parameters for ACL enforcement. In OSS there is currently nothing +// extra parameters for ACL enforcement. In CE there is currently nothing // extra to be done. func (_ *IntentionMatchEntry) FillAuthzContext(_ *acl.AuthorizerContext) { // do nothing } // FillAuthzContext can fill in an acl.AuthorizerContext object to setup -// extra parameters for ACL enforcement. In OSS there is currently nothing +// extra parameters for ACL enforcement. In CE there is currently nothing // extra to be done. func (_ *IntentionQueryCheck) FillAuthzContext(_ *acl.AuthorizerContext) { // do nothing diff --git a/agent/structs/structs_oss.go b/agent/structs/structs_ce.go similarity index 99% rename from agent/structs/structs_oss.go rename to agent/structs/structs_ce.go index 0dcd9d77b0..dcb1641aa0 100644 --- a/agent/structs/structs_oss.go +++ b/agent/structs/structs_ce.go @@ -81,13 +81,13 @@ func (_ *RegisterRequest) GetEnterpriseMeta() *acl.EnterpriseMeta { return nil } -// OSS Stub +// CE Stub func (op *TxnNodeOp) FillAuthzContext(ctx *acl.AuthorizerContext) {} -// OSS Stub +// CE Stub func (_ *TxnServiceOp) FillAuthzContext(_ *acl.AuthorizerContext) {} -// OSS Stub +// CE Stub func (_ *TxnCheckOp) FillAuthzContext(_ *acl.AuthorizerContext) {} func NodeNameString(node string, _ *acl.EnterpriseMeta) string { diff --git a/agent/structs/structs_oss_test.go b/agent/structs/structs_ce_test.go similarity index 100% rename from agent/structs/structs_oss_test.go rename to agent/structs/structs_ce_test.go diff --git a/agent/token/store_oss.go b/agent/token/store_ce.go similarity index 91% rename from agent/token/store_oss.go rename to agent/token/store_ce.go index ef8b5336d2..5cc2b01176 100644 --- a/agent/token/store_oss.go +++ b/agent/token/store_ce.go @@ -10,7 +10,7 @@ type EnterpriseConfig struct { type enterpriseTokens struct { } -// enterpriseAgentToken OSS stub +// enterpriseAgentToken CE stub func (t *Store) enterpriseAgentToken() string { return "" } diff --git a/agent/ui_endpoint_oss_test.go b/agent/ui_endpoint_ce_test.go similarity index 100% rename from agent/ui_endpoint_oss_test.go rename to agent/ui_endpoint_ce_test.go diff --git a/agent/ui_endpoint_test.go b/agent/ui_endpoint_test.go index 2b4eb43d9d..362a27dbb3 100644 --- a/agent/ui_endpoint_test.go +++ b/agent/ui_endpoint_test.go @@ -1112,7 +1112,7 @@ func TestUIGatewayServiceNodes_Ingress(t *testing.T) { require.Nil(t, err) assertIndex(t, resp) - // Construct expected addresses so that differences between OSS/Ent are + // Construct expected addresses so that differences between CE/Ent are // handled by code. We specifically don't include the trailing DNS . here as // we are constructing what we are expecting, not the actual value webDNS := serviceIngressDNSName("web", "dc1", "consul", structs.DefaultEnterpriseMetaInDefaultPartition()) diff --git a/agent/xds/delta_envoy_extender_oss_test.go b/agent/xds/delta_envoy_extender_ce_test.go similarity index 100% rename from agent/xds/delta_envoy_extender_oss_test.go rename to agent/xds/delta_envoy_extender_ce_test.go diff --git a/agent/xds/extensionruntime/runtime_config_oss_test.go b/agent/xds/extensionruntime/runtime_config_ce_test.go similarity index 100% rename from agent/xds/extensionruntime/runtime_config_oss_test.go rename to agent/xds/extensionruntime/runtime_config_ce_test.go diff --git a/agent/xds/listeners_ingress.go b/agent/xds/listeners_ingress.go index 40eb24230e..9592690a20 100644 --- a/agent/xds/listeners_ingress.go +++ b/agent/xds/listeners_ingress.go @@ -332,7 +332,7 @@ func routeNameForUpstream(l structs.IngressListener, s structs.IngressService) s // Return a specific route for this service as it needs a custom FilterChain // to serve its custom cert so we should attach its routes to a separate Route - // too. We need this to be consistent between OSS and Enterprise to avoid xDS + // too. We need this to be consistent between CE and Enterprise to avoid xDS // config golden files in tests conflicting so we can't use ServiceID.String() // which normalizes to included all identifiers in Enterprise. sn := s.ToServiceName() diff --git a/agent/xds/resources_oss_test.go b/agent/xds/resources_ce_test.go similarity index 100% rename from agent/xds/resources_oss_test.go rename to agent/xds/resources_ce_test.go diff --git a/agent/xds/server_oss.go b/agent/xds/server_ce.go similarity index 100% rename from agent/xds/server_oss.go rename to agent/xds/server_ce.go diff --git a/api/oss_test.go b/api/ce_test.go similarity index 79% rename from api/oss_test.go rename to api/ce_test.go index e4e266a389..03ff93c994 100644 --- a/api/oss_test.go +++ b/api/ce_test.go @@ -3,8 +3,8 @@ package api -// The following defaults return "default" in enterprise and "" in OSS. +// The following defaults return "default" in enterprise and "" in CE. // This constant is useful when a default value is needed for an -// operation that will reject non-empty values in OSS. +// operation that will reject non-empty values in CE. const defaultNamespace = "" const defaultPartition = "" diff --git a/api/config_entry_gateways_test.go b/api/config_entry_gateways_test.go index 7780b4f835..5aaac9c465 100644 --- a/api/config_entry_gateways_test.go +++ b/api/config_entry_gateways_test.go @@ -173,7 +173,7 @@ func TestAPI_ConfigEntries_IngressGateway(t *testing.T) { require.Len(t, readIngress.Listeners, 1) require.Len(t, readIngress.Listeners[0].Services, 1) - // Set namespace and partition to blank so that OSS and ent can utilize the same tests + // Set namespace and partition to blank so that CE and ent can utilize the same tests readIngress.Listeners[0].Services[0].Namespace = "" readIngress.Listeners[0].Services[0].Partition = "" @@ -192,7 +192,7 @@ func TestAPI_ConfigEntries_IngressGateway(t *testing.T) { require.Len(t, readIngress.Listeners, 1) require.Len(t, readIngress.Listeners[0].Services, 1) - // Set namespace and partition to blank so that OSS and ent can utilize the same tests + // Set namespace and partition to blank so that CE and ent can utilize the same tests readIngress.Listeners[0].Services[0].Namespace = "" readIngress.Listeners[0].Services[0].Partition = "" @@ -318,7 +318,7 @@ func TestAPI_ConfigEntries_TerminatingGateway(t *testing.T) { require.Equal(t, terminating1.Kind, readTerminating.Kind) require.Equal(t, terminating1.Name, readTerminating.Name) require.Len(t, readTerminating.Services, 1) - // Set namespace to blank so that OSS and ent can utilize the same tests + // Set namespace to blank so that CE and ent can utilize the same tests readTerminating.Services[0].Namespace = "" require.Equal(t, terminating1.Services, readTerminating.Services) @@ -328,7 +328,7 @@ func TestAPI_ConfigEntries_TerminatingGateway(t *testing.T) { require.Equal(t, terminating2.Kind, readTerminating.Kind) require.Equal(t, terminating2.Name, readTerminating.Name) require.Len(t, readTerminating.Services, 1) - // Set namespace to blank so that OSS and ent can utilize the same tests + // Set namespace to blank so that CE and ent can utilize the same tests readTerminating.Services[0].Namespace = "" require.Equal(t, terminating2.Services, readTerminating.Services) diff --git a/build-support/functions/00-vars.sh b/build-support/functions/00-vars.sh index a50aa3f23f..9007057994 100644 --- a/build-support/functions/00-vars.sh +++ b/build-support/functions/00-vars.sh @@ -41,4 +41,5 @@ else SED_EXT="-r" fi +# TODO(spatel): CE refactor CONSUL_BINARY_TYPE=oss diff --git a/build-support/functions/10-util.sh b/build-support/functions/10-util.sh index 9b380dcbb1..678c5d18ba 100644 --- a/build-support/functions/10-util.sh +++ b/build-support/functions/10-util.sh @@ -233,7 +233,7 @@ function get_version { local vers="$VERSION" if test -z "$vers" then - # parse the OSS version from version.go + # parse the CE version from version.go vers="$(parse_version ${1} ${2} ${3})" fi @@ -634,6 +634,7 @@ function ui_logo_type { then echo "enterprise" else + # TODO(spatel): CE refactor echo "oss" fi return 0 diff --git a/build-support/functions/20-build.sh b/build-support/functions/20-build.sh index dee61aea16..fd0e46ffd6 100644 --- a/build-support/functions/20-build.sh +++ b/build-support/functions/20-build.sh @@ -89,6 +89,7 @@ function build_ui { commit_year=$(git show -s --format=%cd --date=format:%Y HEAD) fi + # TODO(spatel): CE refactor local logo_type="${CONSUL_BINARY_TYPE}" if test "$logo_type" != "oss" then diff --git a/command/acl/authmethod/create/authmethod_create_oss.go b/command/acl/authmethod/create/authmethod_create_ce.go similarity index 100% rename from command/acl/authmethod/create/authmethod_create_oss.go rename to command/acl/authmethod/create/authmethod_create_ce.go diff --git a/command/acl/authmethod/update/authmethod_update_oss.go b/command/acl/authmethod/update/authmethod_update_ce.go similarity index 100% rename from command/acl/authmethod/update/authmethod_update_oss.go rename to command/acl/authmethod/update/authmethod_update_ce.go diff --git a/command/acl/token/formatter_oss_test.go b/command/acl/token/formatter_ce_test.go similarity index 70% rename from command/acl/token/formatter_oss_test.go rename to command/acl/token/formatter_ce_test.go index d825a5ee35..6e82c1bc20 100644 --- a/command/acl/token/formatter_oss_test.go +++ b/command/acl/token/formatter_ce_test.go @@ -8,5 +8,5 @@ import ( ) func TestFormatTokenExpanded(t *testing.T) { - testFormatTokenExpanded(t, "FormatTokenExpanded/oss") + testFormatTokenExpanded(t, "FormatTokenExpanded/ce") } diff --git a/command/acl/token/testdata/FormatTokenExpanded/oss/basic.json.golden b/command/acl/token/testdata/FormatTokenExpanded/ce/basic.json.golden similarity index 100% rename from command/acl/token/testdata/FormatTokenExpanded/oss/basic.json.golden rename to command/acl/token/testdata/FormatTokenExpanded/ce/basic.json.golden diff --git a/command/acl/token/testdata/FormatTokenExpanded/oss/basic.pretty-meta.golden b/command/acl/token/testdata/FormatTokenExpanded/ce/basic.pretty-meta.golden similarity index 100% rename from command/acl/token/testdata/FormatTokenExpanded/oss/basic.pretty-meta.golden rename to command/acl/token/testdata/FormatTokenExpanded/ce/basic.pretty-meta.golden diff --git a/command/acl/token/testdata/FormatTokenExpanded/oss/basic.pretty.golden b/command/acl/token/testdata/FormatTokenExpanded/ce/basic.pretty.golden similarity index 100% rename from command/acl/token/testdata/FormatTokenExpanded/oss/basic.pretty.golden rename to command/acl/token/testdata/FormatTokenExpanded/ce/basic.pretty.golden diff --git a/command/acl/token/testdata/FormatTokenExpanded/oss/complex.json.golden b/command/acl/token/testdata/FormatTokenExpanded/ce/complex.json.golden similarity index 100% rename from command/acl/token/testdata/FormatTokenExpanded/oss/complex.json.golden rename to command/acl/token/testdata/FormatTokenExpanded/ce/complex.json.golden diff --git a/command/acl/token/testdata/FormatTokenExpanded/oss/complex.pretty-meta.golden b/command/acl/token/testdata/FormatTokenExpanded/ce/complex.pretty-meta.golden similarity index 100% rename from command/acl/token/testdata/FormatTokenExpanded/oss/complex.pretty-meta.golden rename to command/acl/token/testdata/FormatTokenExpanded/ce/complex.pretty-meta.golden diff --git a/command/acl/token/testdata/FormatTokenExpanded/oss/complex.pretty.golden b/command/acl/token/testdata/FormatTokenExpanded/ce/complex.pretty.golden similarity index 100% rename from command/acl/token/testdata/FormatTokenExpanded/oss/complex.pretty.golden rename to command/acl/token/testdata/FormatTokenExpanded/ce/complex.pretty.golden diff --git a/command/catalog/helpers_oss.go b/command/catalog/helpers_ce.go similarity index 100% rename from command/catalog/helpers_oss.go rename to command/catalog/helpers_ce.go diff --git a/command/connect/envoy/bootstrap_config_test.go b/command/connect/envoy/bootstrap_config_test.go index 66a658c23a..066b9e67a1 100644 --- a/command/connect/envoy/bootstrap_config_test.go +++ b/command/connect/envoy/bootstrap_config_test.go @@ -1521,7 +1521,7 @@ func TestConsulTagSpecifiers(t *testing.T) { }, }, { - name: "tcp listener no namespace or partition (OSS)", + name: "tcp listener no namespace or partition (CE)", stat: "tcp.upstream.db.dc1.downstream_cx_total", expect: map[string][]string{ "consul.upstream.datacenter": {"db.dc1.", "dc1"}, @@ -1531,7 +1531,7 @@ func TestConsulTagSpecifiers(t *testing.T) { }, }, { - name: "tcp peered listener no namespace or partition (OSS)", + name: "tcp peered listener no namespace or partition (CE)", stat: "tcp.upstream_peered.db.cloudpeer.downstream_cx_total", expect: map[string][]string{ "consul.upstream.peer": {"db.cloudpeer.", "cloudpeer"}, @@ -1559,7 +1559,7 @@ func TestConsulTagSpecifiers(t *testing.T) { }, }, { - name: "http listener no namespace or partition (OSS)", + name: "http listener no namespace or partition (CE)", stat: "http.upstream.web.dc1.downstream_cx_total", expect: map[string][]string{ "consul.upstream.datacenter": {"web.dc1.", "dc1"}, @@ -1569,7 +1569,7 @@ func TestConsulTagSpecifiers(t *testing.T) { }, }, { - name: "http peered listener no namespace or partition (OSS)", + name: "http peered listener no namespace or partition (CE)", stat: "http.upstream_peered.web.cloudpeer.downstream_cx_total", expect: map[string][]string{ "consul.upstream.peer": {"web.cloudpeer.", "cloudpeer"}, diff --git a/command/connect/envoy/envoy_oss_test.go b/command/connect/envoy/envoy_ce_test.go similarity index 100% rename from command/connect/envoy/envoy_oss_test.go rename to command/connect/envoy/envoy_ce_test.go diff --git a/command/login/login_oss.go b/command/login/login_ce.go similarity index 100% rename from command/login/login_oss.go rename to command/login/login_ce.go diff --git a/command/operator/autopilot/state/operator_autopilot_state_test.go b/command/operator/autopilot/state/operator_autopilot_state_test.go index 332f53059c..6462bccbb3 100644 --- a/command/operator/autopilot/state/operator_autopilot_state_test.go +++ b/command/operator/autopilot/state/operator_autopilot_state_test.go @@ -104,7 +104,7 @@ func TestStateCommand_JSON(t *testing.T) { func TestStateCommand_Formatter(t *testing.T) { cases := []string{ - "oss", + "ce", "enterprise", } diff --git a/command/operator/autopilot/state/testdata/oss/json.golden b/command/operator/autopilot/state/testdata/ce/json.golden similarity index 100% rename from command/operator/autopilot/state/testdata/oss/json.golden rename to command/operator/autopilot/state/testdata/ce/json.golden diff --git a/command/operator/autopilot/state/testdata/oss/pretty.golden b/command/operator/autopilot/state/testdata/ce/pretty.golden similarity index 100% rename from command/operator/autopilot/state/testdata/oss/pretty.golden rename to command/operator/autopilot/state/testdata/ce/pretty.golden diff --git a/command/operator/autopilot/state/testdata/oss/state.json b/command/operator/autopilot/state/testdata/ce/state.json similarity index 100% rename from command/operator/autopilot/state/testdata/oss/state.json rename to command/operator/autopilot/state/testdata/ce/state.json diff --git a/command/operator/usage/instances/usage_instances_oss.go b/command/operator/usage/instances/usage_instances_ce.go similarity index 100% rename from command/operator/usage/instances/usage_instances_oss.go rename to command/operator/usage/instances/usage_instances_ce.go diff --git a/command/operator/usage/instances/usage_instances_oss_test.go b/command/operator/usage/instances/usage_instances_ce_test.go similarity index 100% rename from command/operator/usage/instances/usage_instances_oss_test.go rename to command/operator/usage/instances/usage_instances_ce_test.go diff --git a/command/registry_oss.go b/command/registry_ce.go similarity index 100% rename from command/registry_oss.go rename to command/registry_ce.go diff --git a/docs/config/checklist-adding-config-fields.md b/docs/config/checklist-adding-config-fields.md index 4f9a6e657d..1f6b251e98 100644 --- a/docs/config/checklist-adding-config-fields.md +++ b/docs/config/checklist-adding-config-fields.md @@ -11,7 +11,7 @@ through in your PR description**. Examples of special cases this doesn't cover are: - If the config needs special treatment like a different default in `-dev` mode - or differences between OSS and Enterprise. + or differences between CE and Enterprise. - If custom logic is needed to support backwards compatibility when changing syntax or semantics of anything diff --git a/docs/persistence/README.md b/docs/persistence/README.md index bb907d7d13..a9388c714c 100644 --- a/docs/persistence/README.md +++ b/docs/persistence/README.md @@ -58,11 +58,11 @@ There are two styles for defining table indexes. The original style uses generic implementations from [hashicorp/go-memdb] (ex: `StringFieldIndex`). These indexes use [reflect] to find values for an index. These generic indexers work well when the index value is a single value available directly from the struct field, and there are no -oss/enterprise differences. +ce/enterprise differences. The second style of indexers are custom indexers implemented using only functions and based on the types defined in [indexer.go]. This style of index works well when the index -value is a value derived from one or multiple fields, or when there are oss/enterprise +value is a value derived from one or multiple fields, or when there are ce/enterprise differences between the indexes. [reflect]: https://golang.org/pkg/reflect/ diff --git a/internal/tools/protoc-gen-consul-rate-limit/postprocess/main.go b/internal/tools/protoc-gen-consul-rate-limit/postprocess/main.go index 564a37796b..adf3c25f3c 100644 --- a/internal/tools/protoc-gen-consul-rate-limit/postprocess/main.go +++ b/internal/tools/protoc-gen-consul-rate-limit/postprocess/main.go @@ -52,16 +52,16 @@ func run(inputPaths []string, outputPath string) error { return errors.New("-output path must end in .go") } - oss, ent, err := collectSpecs(inputPaths) + ce, ent, err := collectSpecs(inputPaths) if err != nil { return err } - ossSource, err := generateOSS(oss) + ceSource, err := generateCE(ce) if err != nil { return err } - if err := os.WriteFile(outputPath, ossSource, 0666); err != nil { + if err := os.WriteFile(outputPath, ceSource, 0666); err != nil { return fmt.Errorf("failed to write output file: %s - %w", outputPath, err) } @@ -83,6 +83,7 @@ func run(inputPaths []string, outputPath string) error { // enterpriseFileName adds the _ent filename suffix before the extension. // // Example: +// // enterpriseFileName("bar/baz/foo.gen.go") => "bar/baz/foo_ent.gen.go" func enterpriseFileName(filename string) string { fileName := filepath.Base(filename) @@ -137,19 +138,19 @@ func collectSpecs(inputPaths []string) ([]spec, []spec, error) { return specs[a].MethodName < specs[b].MethodName }) - var oss, ent []spec + var ce, ent []spec for _, spec := range specs { if spec.Enterprise { ent = append(ent, spec) } else { - oss = append(oss, spec) + ce = append(ce, spec) } } - return oss, ent, nil + return ce, ent, nil } -func generateOSS(specs []spec) ([]byte, error) { +func generateCE(specs []spec) ([]byte, error) { var output bytes.Buffer output.WriteString(fileHeader) diff --git a/lib/useragent.go b/lib/useragent.go index 84e76d4dfb..f083fe3f19 100644 --- a/lib/useragent.go +++ b/lib/useragent.go @@ -16,7 +16,7 @@ var ( // versionFunc is the func that returns the current version. This is a // function to take into account the different build processes and distinguish - // between enterprise and oss builds. + // between enterprise and CE builds. versionFunc = func() string { return version.GetHumanVersion() } diff --git a/proto/pbautoconf/auto_config_oss.go b/proto/pbautoconf/auto_config_ce.go similarity index 100% rename from proto/pbautoconf/auto_config_oss.go rename to proto/pbautoconf/auto_config_ce.go diff --git a/proto/pbcommon/common_oss.go b/proto/pbcommon/common_ce.go similarity index 100% rename from proto/pbcommon/common_oss.go rename to proto/pbcommon/common_ce.go diff --git a/proto/pbpeering/peering_oss.go b/proto/pbpeering/peering_ce.go similarity index 100% rename from proto/pbpeering/peering_oss.go rename to proto/pbpeering/peering_ce.go diff --git a/proto/pbservice/convert_oss.go b/proto/pbservice/convert_ce.go similarity index 100% rename from proto/pbservice/convert_oss.go rename to proto/pbservice/convert_ce.go diff --git a/proto/pbservice/convert_oss_test.go b/proto/pbservice/convert_ce_test.go similarity index 100% rename from proto/pbservice/convert_oss_test.go rename to proto/pbservice/convert_ce_test.go diff --git a/sentinel/sentinel_oss.go b/sentinel/sentinel_ce.go similarity index 100% rename from sentinel/sentinel_oss.go rename to sentinel/sentinel_ce.go diff --git a/test/integration/consul-container/libs/utils/version.go b/test/integration/consul-container/libs/utils/version.go index 9f63622862..bcee84191c 100644 --- a/test/integration/consul-container/libs/utils/version.go +++ b/test/integration/consul-container/libs/utils/version.go @@ -19,7 +19,7 @@ var ( ) const ( - DefaultImageNameOSS = "hashicorp/consul" + DefaultImageNameCE = "hashicorp/consul" DefaultImageNameENT = "hashicorp/consul-enterprise" ImageVersionSuffixENT = "-ent" ) diff --git a/test/integration/consul-container/libs/utils/version_oss.go b/test/integration/consul-container/libs/utils/version_ce.go similarity index 69% rename from test/integration/consul-container/libs/utils/version_oss.go rename to test/integration/consul-container/libs/utils/version_ce.go index 0f615e4deb..d8f366e1df 100644 --- a/test/integration/consul-container/libs/utils/version_oss.go +++ b/test/integration/consul-container/libs/utils/version_ce.go @@ -4,6 +4,6 @@ package utils const ( - defaultImageName = DefaultImageNameOSS + defaultImageName = DefaultImageNameCE ImageVersionSuffix = "" ) diff --git a/test/integration/consul-container/test/gateways/namespace_oss.go b/test/integration/consul-container/test/gateways/namespace_ce.go similarity index 100% rename from test/integration/consul-container/test/gateways/namespace_oss.go rename to test/integration/consul-container/test/gateways/namespace_ce.go diff --git a/test/integration/consul-container/test/upgrade/README.md b/test/integration/consul-container/test/upgrade/README.md index 6815323af0..0a4698323f 100644 --- a/test/integration/consul-container/test/upgrade/README.md +++ b/test/integration/consul-container/test/upgrade/README.md @@ -67,9 +67,9 @@ disable following container logs, run the test with `-follow-log false`. Below are the supported CLI options | Flags | Default value | Description | | ----------- | ----------- | ----------- | -| --latest-image | `consul` in OSS, `hashicorp/consulenterprise` in ENT | Name of the Docker image to deploy initially. +| --latest-image | `consul` in CE, `hashicorp/consulenterprise` in ENT | Name of the Docker image to deploy initially. | --latest-version | latest | Tag of the Docker image to deploy initially. -| --target-image | `consul` in OSS, `hashicorp/consulenterprise` in ENT | Name of the Docker image to upgrade to. +| --target-image | `consul` in Ce, `hashicorp/consulenterprise` in ENT | Name of the Docker image to upgrade to. | --target-version | local | Tag of the Docker image to upgrade to. `local` is the tag built by `make dev-docker` above. | -follow-log | true | Emit all container logs. These can be noisy, so we recommend `--follow-log=false` for local development. diff --git a/ui/README.md b/ui/README.md index dc3f8e64b6..850cff2ab4 100644 --- a/ui/README.md +++ b/ui/README.md @@ -53,7 +53,7 @@ List of available project commands. `yarn run ` | Command | Description | |---------------------|------------------------------------| | doc:toc | Re-builds the ToC for this README. | -| compliance:licenses | Checks that all dependencies have OSS-compatible licenses. | +| compliance:licenses | Checks that all dependencies have CE-compatible licenses. | ## Contributing diff --git a/ui/packages/consul-peerings/app/components/consul/peer/form/token/fieldsets/index.hbs b/ui/packages/consul-peerings/app/components/consul/peer/form/token/fieldsets/index.hbs index b2a53bdd06..ba1cf4ddda 100644 --- a/ui/packages/consul-peerings/app/components/consul/peer/form/token/fieldsets/index.hbs +++ b/ui/packages/consul-peerings/app/components/consul/peer/form/token/fieldsets/index.hbs @@ -19,7 +19,7 @@
  • Switch to the peer
    - Someone on your team should log into the Datacenter (OSS) or Admin Partition (Enterprise) that you want this one to connect with. + Someone on your team should log into the Datacenter (CE) or Admin Partition (Enterprise) that you want this one to connect with.
  • Initiate the peering
    diff --git a/ui/packages/consul-ui/GNUmakefile b/ui/packages/consul-ui/GNUmakefile index 0855de1dab..68ad9cc414 100644 --- a/ui/packages/consul-ui/GNUmakefile +++ b/ui/packages/consul-ui/GNUmakefile @@ -34,6 +34,7 @@ start-api: deps # things with 'view' will open your browser for you # otherwise its headless +# TODO(spatel): CE refactor # oss is currently with namespace support disabled test: deps test-node yarn run test diff --git a/ui/packages/consul-ui/app/services/client/http.js b/ui/packages/consul-ui/app/services/client/http.js index d36c70260e..49c095bb36 100644 --- a/ui/packages/consul-ui/app/services/client/http.js +++ b/ui/packages/consul-ui/app/services/client/http.js @@ -252,7 +252,7 @@ export default class HttpService extends Service { // we can use them later for store reconciliation. Namespace // will look at the ns query parameter first, followed by the // Namespace property of the users token, defaulting back to - // 'default' which will mainly be used in OSS + // 'default' which will mainly be used in CE [CONSUL_DATACENTER]: params.data.dc, [CONSUL_NAMESPACE]: params.data.ns || token.Namespace || 'default', [CONSUL_PARTITION]: params.data.partition || token.Partition || 'default', diff --git a/ui/packages/consul-ui/app/utils/create-fingerprinter.js b/ui/packages/consul-ui/app/utils/create-fingerprinter.js index f1b91cfc0d..f2f4657630 100644 --- a/ui/packages/consul-ui/app/utils/create-fingerprinter.js +++ b/ui/packages/consul-ui/app/utils/create-fingerprinter.js @@ -30,7 +30,7 @@ export default function (foreignKey, nspaceKey, partitionKey, hash = JSON.string }) .compact(); // This ensures that all data objects have a Namespace and a Partition - // value set, even in OSS. + // value set, even in CE. if (typeof item[nspaceKey] === 'undefined') { if (nspaceValue === '*') { nspaceValue = 'default'; diff --git a/ui/packages/consul-ui/config/environment.js b/ui/packages/consul-ui/config/environment.js index 4913c4cc82..1289a2ca37 100644 --- a/ui/packages/consul-ui/config/environment.js +++ b/ui/packages/consul-ui/config/environment.js @@ -70,6 +70,7 @@ module.exports = function (environment, $ = process.env) { CONSUL_COPYRIGHT_YEAR: env('CONSUL_COPYRIGHT_YEAR', repositoryYear), CONSUL_GIT_SHA: env('CONSUL_GIT_SHA', repositorySHA), CONSUL_VERSION: env('CONSUL_VERSION', binaryVersion), + // TODO(spatel): CE refactor CONSUL_BINARY_TYPE: env('CONSUL_BINARY_TYPE', 'oss'), // These can be overwritten by the UI user at runtime by setting localStorage values diff --git a/ui/packages/consul-ui/docs/significant-patterns.mdx b/ui/packages/consul-ui/docs/significant-patterns.mdx index 0cd9d43655..f60e2d2870 100644 --- a/ui/packages/consul-ui/docs/significant-patterns.mdx +++ b/ui/packages/consul-ui/docs/significant-patterns.mdx @@ -116,7 +116,7 @@ Please see our package.json file dependencies. ### Namespace support -Whilst Consul namespaces are a OSS feature of Consul, we almost always build +Whilst Consul namespaces are a CE feature of Consul, we almost always build things 'pretending' that namespaces are always enabled. Then there is code within the data layer of the application that removes any namespace related query parameters.