OSS -> CE (community edition) changes (#18517)

This commit is contained in:
Semir Patel 2023-08-22 09:46:03 -05:00 committed by GitHub
parent 547f4f8395
commit 53e28a4963
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
243 changed files with 258 additions and 250 deletions

View File

@ -13,7 +13,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"
;;
*)

View File

@ -13,7 +13,7 @@ case "$GITHUB_REPOSITORY" in
echo "compute-small=['self-hosted', 'windows', 'small']" >> "$GITHUB_OUTPUT"
echo "compute-medium=['self-hosted', 'windows', 'medium']" >> "$GITHUB_OUTPUT"
echo "compute-large=['self-hosted', 'windows', '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', 'windows', 'type=m5d.8xlarge']" >> "$GITHUB_OUTPUT"
;;
*)

View File

@ -80,7 +80,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@2a1a44ac4aa01993040736bd95bb470da1a38365 # v2.9.0
# 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@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:

View File

@ -13,6 +13,7 @@ on:
env:
PKG_NAME: consul
# TODO(spatel): CE refactor
METADATA: oss
GOPRIVATE: github.com/hashicorp # Required for enterprise deps

View File

@ -1,7 +1,7 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
name: Trigger OSS to Enterprise Merge
name: Trigger Community Edition to Enterprise Merge
on:
pull_request_target:
types:
@ -11,8 +11,8 @@ on:
- release/**
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:
@ -22,6 +22,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' \

View File

@ -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

View File

@ -199,7 +199,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
@ -213,7 +213,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
@ -231,7 +231,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
@ -476,7 +476,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

View File

@ -43,7 +43,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
@ -65,27 +65,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@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -104,13 +104,13 @@ jobs:
working-directory: ./ui
run: make deps
- name: Download OSS Frontend
- name: Download CE Frontend
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
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
@ -138,7 +138,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
@ -157,7 +157,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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -219,7 +219,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

View File

@ -43,7 +43,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
@ -65,27 +65,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@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -104,13 +104,13 @@ jobs:
working-directory: ./ui
run: make deps
- name: Download OSS Frontend
- name: Download CE Frontend
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
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
@ -138,7 +138,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
@ -157,7 +157,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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -219,7 +219,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

View File

@ -43,7 +43,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
@ -65,27 +65,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@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -104,13 +104,13 @@ jobs:
working-directory: ./ui
run: make deps
- name: Download OSS Frontend
- name: Download CE Frontend
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
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
@ -138,7 +138,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
@ -157,7 +157,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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -219,7 +219,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

View File

@ -43,7 +43,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
@ -65,27 +65,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@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -104,13 +104,13 @@ jobs:
working-directory: ./ui
run: make deps
- name: Download OSS Frontend
- name: Download CE Frontend
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
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
@ -138,7 +138,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
@ -157,7 +157,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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -219,7 +219,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

View File

@ -43,7 +43,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
@ -65,27 +65,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@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -104,13 +104,13 @@ jobs:
working-directory: ./ui
run: make deps
- name: Download OSS Frontend
- name: Download CE Frontend
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
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
@ -138,7 +138,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
@ -157,7 +157,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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -219,7 +219,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

View File

@ -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:

View File

@ -11,6 +11,7 @@ binary {
secrets = false
go_modules = false
osv = true
# TODO(spatel): CE refactor
oss_index = true
nvd = true
}

View File

@ -17,7 +17,7 @@ const (
const DefaultNamespaceName = "default"
type EnterpriseConfig struct {
// no fields in OSS
// no fields in CE
}
func (_ *EnterpriseConfig) Close() {

View File

@ -3755,7 +3755,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()) {

View File

@ -6,7 +6,7 @@
package autoconf
// AutoConfigEnterprise has no fields in OSS
// AutoConfigEnterprise has no fields in CE
type AutoConfigEnterprise struct{}
// newAutoConfigEnterprise initializes the enterprise AutoConfig struct

View File

@ -9,7 +9,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
}

View File

@ -10,7 +10,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 {

View File

@ -13,7 +13,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) {

View File

@ -35,9 +35,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)

View File

@ -18,7 +18,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,
},
@ -42,7 +42,7 @@ func TestSegments(t *testing.T) {
},
},
{
desc: "segments not in OSS",
desc: "segments not in CE",
args: []string{
`-data-dir=` + dataDir,
},

View File

@ -31,7 +31,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"
}
@ -48,7 +48,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"
}
@ -109,7 +109,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"
}

View File

@ -13,7 +13,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{}
}

View File

@ -13,7 +13,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{}
}

View File

@ -43,10 +43,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
}

View File

@ -13,13 +13,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 {

View File

@ -36,13 +36,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
}

View File

@ -450,7 +450,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 != "" {

View File

@ -77,7 +77,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")
}
@ -89,7 +89,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")
}

View File

@ -264,7 +264,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)
}

View File

@ -18,7 +18,7 @@ import (
)
func init() {
registerPersister(persistOSS)
registerPersister(persistCE)
registerRestorer(structs.RegisterRequestType, restoreRegistration)
registerRestorer(structs.KVSRequestType, restoreKV)
@ -47,7 +47,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
}

View File

@ -34,7 +34,7 @@ func TestRestoreFromEnterprise(t *testing.T) {
StorageBackend: storageBackend,
})
// 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}
@ -58,6 +58,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()
}

View File

@ -27,7 +27,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)
@ -941,7 +941,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)

View File

@ -13,7 +13,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"
@ -56,7 +56,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".

View File

@ -16,7 +16,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

View File

@ -17,7 +17,7 @@ import (
"github.com/stretchr/testify/require"
)
func TestPreparedQuery_OSS_Apply(t *testing.T) {
func TestPreparedQuery_CE_Apply(t *testing.T) {
if testing.Short() {
t.Skip("too slow for testing.Short")
}

View File

@ -14,7 +14,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.",
@ -26,7 +26,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 {
@ -36,7 +36,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 {
@ -46,6 +46,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) {
}

View File

@ -87,7 +87,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
}

View File

@ -115,7 +115,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.

View File

@ -14,7 +14,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

View File

@ -65,7 +65,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
//

View File

@ -83,7 +83,7 @@ type SamenessGroupMemberIndex 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 = (*SamenessGroupMemberIndex)(nil)
var _ memdb.MultiIndexer = (*SamenessGroupMemberIndex)(nil)
@ -135,7 +135,7 @@ type ServiceIntentionSourceSamenessGroupIndex 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 = (*ServiceIntentionSourceSamenessGroupIndex)(nil)
var _ memdb.MultiIndexer = (*ServiceIntentionSourceSamenessGroupIndex)(nil)
@ -199,7 +199,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)

Some files were not shown because too many files have changed in this diff Show More