mirror of https://github.com/status-im/consul.git
OSS -> CE (community edition) changes (#18517)
This commit is contained in:
parent
547f4f8395
commit
53e28a4963
|
@ -13,7 +13,7 @@ case "$GITHUB_REPOSITORY" in
|
||||||
echo "compute-small=['self-hosted', 'linux', 'small']" >> "$GITHUB_OUTPUT"
|
echo "compute-small=['self-hosted', 'linux', 'small']" >> "$GITHUB_OUTPUT"
|
||||||
echo "compute-medium=['self-hosted', 'linux', 'medium']" >> "$GITHUB_OUTPUT"
|
echo "compute-medium=['self-hosted', 'linux', 'medium']" >> "$GITHUB_OUTPUT"
|
||||||
echo "compute-large=['self-hosted', 'linux', 'large']" >> "$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"
|
echo "compute-xl=['self-hosted', 'ondemand', 'linux', 'type=m5d.8xlarge']" >> "$GITHUB_OUTPUT"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -13,7 +13,7 @@ case "$GITHUB_REPOSITORY" in
|
||||||
echo "compute-small=['self-hosted', 'windows', 'small']" >> "$GITHUB_OUTPUT"
|
echo "compute-small=['self-hosted', 'windows', 'small']" >> "$GITHUB_OUTPUT"
|
||||||
echo "compute-medium=['self-hosted', 'windows', 'medium']" >> "$GITHUB_OUTPUT"
|
echo "compute-medium=['self-hosted', 'windows', 'medium']" >> "$GITHUB_OUTPUT"
|
||||||
echo "compute-large=['self-hosted', 'windows', 'large']" >> "$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"
|
echo "compute-xl=['self-hosted', 'ondemand', 'windows', 'type=m5d.8xlarge']" >> "$GITHUB_OUTPUT"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -80,7 +80,7 @@ jobs:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@2a1a44ac4aa01993040736bd95bb470da1a38365 # v2.9.0
|
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
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -13,6 +13,7 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PKG_NAME: consul
|
PKG_NAME: consul
|
||||||
|
# TODO(spatel): CE refactor
|
||||||
METADATA: oss
|
METADATA: oss
|
||||||
GOPRIVATE: github.com/hashicorp # Required for enterprise deps
|
GOPRIVATE: github.com/hashicorp # Required for enterprise deps
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright (c) HashiCorp, Inc.
|
# Copyright (c) HashiCorp, Inc.
|
||||||
# SPDX-License-Identifier: MPL-2.0
|
# SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
name: Trigger OSS to Enterprise Merge
|
name: Trigger Community Edition to Enterprise Merge
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types:
|
types:
|
||||||
|
@ -11,8 +11,8 @@ on:
|
||||||
- release/**
|
- release/**
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
trigger-oss-merge:
|
trigger-ce-merge:
|
||||||
# run this only on merge events in OSS repo
|
# run this only on merge events in CE repo
|
||||||
if: ${{ github.event.pull_request.merged && github.repository == 'hashicorp/consul' }}
|
if: ${{ github.event.pull_request.merged && github.repository == 'hashicorp/consul' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -22,6 +22,7 @@ jobs:
|
||||||
GIT_SHA: ${{ github.sha }}
|
GIT_SHA: ${{ github.sha }}
|
||||||
GH_PAT: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
GH_PAT: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||||
GIT_ACTOR: ${{ github.actor }}
|
GIT_ACTOR: ${{ github.actor }}
|
||||||
|
# TODO(spatel): CE refactor
|
||||||
run: |
|
run: |
|
||||||
curl -H "Authorization: token $GH_PAT" \
|
curl -H "Authorization: token $GH_PAT" \
|
||||||
-H 'Accept: application/json' \
|
-H 'Accept: application/json' \
|
|
@ -79,7 +79,7 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
partition: [1, 2, 3, 4]
|
partition: [1, 2, 3, 4]
|
||||||
env:
|
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
|
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.
|
CONSUL_NSPACES_ENABLED: ${{ endsWith(github.repository, '-enterprise') && 1 || 0 }} # NOTE: this should be 1 in ENT.
|
||||||
JOBS: 2 # limit parallelism for broccoli-babel-transpiler
|
JOBS: 2 # limit parallelism for broccoli-babel-transpiler
|
||||||
|
|
|
@ -199,7 +199,7 @@ jobs:
|
||||||
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||||
|
|
||||||
# dev-build-arm64:
|
# 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') }}
|
# if: ${{ endsWith(github.repository, '-enterprise') }}
|
||||||
# needs:
|
# needs:
|
||||||
# - setup
|
# - setup
|
||||||
|
@ -213,7 +213,7 @@ jobs:
|
||||||
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
||||||
|
|
||||||
# go-test-arm64:
|
# 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') }}
|
# if: ${{ endsWith(github.repository, '-enterprise') }}
|
||||||
# needs:
|
# needs:
|
||||||
# - setup
|
# - setup
|
||||||
|
@ -231,7 +231,7 @@ jobs:
|
||||||
# consul-license: ${{secrets.CONSUL_LICENSE}}
|
# consul-license: ${{secrets.CONSUL_LICENSE}}
|
||||||
# datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
# datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"
|
||||||
|
|
||||||
go-test-oss:
|
go-test-ce:
|
||||||
needs:
|
needs:
|
||||||
- setup
|
- setup
|
||||||
- dev-build
|
- dev-build
|
||||||
|
@ -476,7 +476,7 @@ jobs:
|
||||||
- lint-32bit
|
- lint-32bit
|
||||||
# - go-test-arm64
|
# - go-test-arm64
|
||||||
- go-test-enterprise
|
- go-test-enterprise
|
||||||
- go-test-oss
|
- go-test-ce
|
||||||
- go-test-race
|
- go-test-race
|
||||||
- go-test-envoyextensions
|
- go-test-envoyextensions
|
||||||
- go-test-troubleshoot
|
- go-test-troubleshoot
|
||||||
|
|
|
@ -43,7 +43,7 @@ jobs:
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make test-node
|
run: make test-node
|
||||||
|
|
||||||
frontend-build-oss:
|
frontend-build-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
JOBS: 2
|
JOBS: 2
|
||||||
|
@ -65,27 +65,27 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build OSS
|
- name: Ember Build CE
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
- name: Upload OSS Frontend
|
- name: Upload CE Frontend
|
||||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
frontend-test-oss:
|
frontend-test-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-build-oss]
|
needs: [frontend-build-ce]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 0
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -104,13 +104,13 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Download OSS Frontend
|
- name: Download CE Frontend
|
||||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
|
|
||||||
- name: Ember Test OSS
|
- name: Ember Test CE
|
||||||
id: cache
|
id: cache
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit
|
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
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build ENT
|
- name: Ember Build ENT
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ jobs:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 1
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -219,7 +219,7 @@ jobs:
|
||||||
|
|
||||||
slack-failure-notification:
|
slack-failure-notification:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-test-oss, frontend-test-ent]
|
needs: [frontend-test-ce, frontend-test-ent]
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Slack Notification
|
- name: Slack Notification
|
||||||
|
|
|
@ -43,7 +43,7 @@ jobs:
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make test-node
|
run: make test-node
|
||||||
|
|
||||||
frontend-build-oss:
|
frontend-build-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
JOBS: 2
|
JOBS: 2
|
||||||
|
@ -65,27 +65,27 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build OSS
|
- name: Ember Build CE
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
- name: Upload OSS Frontend
|
- name: Upload CE Frontend
|
||||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
frontend-test-oss:
|
frontend-test-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-build-oss]
|
needs: [frontend-build-ce]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 0
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -104,13 +104,13 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Download OSS Frontend
|
- name: Download CE Frontend
|
||||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
|
|
||||||
- name: Ember Test OSS
|
- name: Ember Test CE
|
||||||
id: cache
|
id: cache
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit
|
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
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build ENT
|
- name: Ember Build ENT
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ jobs:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 1
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -219,7 +219,7 @@ jobs:
|
||||||
|
|
||||||
slack-failure-notification:
|
slack-failure-notification:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-test-oss, frontend-test-ent]
|
needs: [frontend-test-ce, frontend-test-ent]
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Slack Notification
|
- name: Slack Notification
|
||||||
|
|
|
@ -43,7 +43,7 @@ jobs:
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make test-node
|
run: make test-node
|
||||||
|
|
||||||
frontend-build-oss:
|
frontend-build-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
JOBS: 2
|
JOBS: 2
|
||||||
|
@ -65,27 +65,27 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build OSS
|
- name: Ember Build CE
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
- name: Upload OSS Frontend
|
- name: Upload CE Frontend
|
||||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
frontend-test-oss:
|
frontend-test-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-build-oss]
|
needs: [frontend-build-ce]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 0
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -104,13 +104,13 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Download OSS Frontend
|
- name: Download CE Frontend
|
||||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
|
|
||||||
- name: Ember Test OSS
|
- name: Ember Test CE
|
||||||
id: cache
|
id: cache
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit
|
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
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build ENT
|
- name: Ember Build ENT
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ jobs:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 1
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -219,7 +219,7 @@ jobs:
|
||||||
|
|
||||||
slack-failure-notification:
|
slack-failure-notification:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-test-oss, frontend-test-ent]
|
needs: [frontend-test-ce, frontend-test-ent]
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Slack Notification
|
- name: Slack Notification
|
||||||
|
|
|
@ -43,7 +43,7 @@ jobs:
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make test-node
|
run: make test-node
|
||||||
|
|
||||||
frontend-build-oss:
|
frontend-build-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
JOBS: 2
|
JOBS: 2
|
||||||
|
@ -65,27 +65,27 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build OSS
|
- name: Ember Build CE
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
- name: Upload OSS Frontend
|
- name: Upload CE Frontend
|
||||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
frontend-test-oss:
|
frontend-test-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-build-oss]
|
needs: [frontend-build-ce]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 0
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -104,13 +104,13 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Download OSS Frontend
|
- name: Download CE Frontend
|
||||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
|
|
||||||
- name: Ember Test OSS
|
- name: Ember Test CE
|
||||||
id: cache
|
id: cache
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit
|
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
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build ENT
|
- name: Ember Build ENT
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ jobs:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 1
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -219,7 +219,7 @@ jobs:
|
||||||
|
|
||||||
slack-failure-notification:
|
slack-failure-notification:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-test-oss, frontend-test-ent]
|
needs: [frontend-test-ce, frontend-test-ent]
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Slack Notification
|
- name: Slack Notification
|
||||||
|
|
|
@ -43,7 +43,7 @@ jobs:
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make test-node
|
run: make test-node
|
||||||
|
|
||||||
frontend-build-oss:
|
frontend-build-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
JOBS: 2
|
JOBS: 2
|
||||||
|
@ -65,27 +65,27 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build OSS
|
- name: Ember Build CE
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
- name: Upload OSS Frontend
|
- name: Upload CE Frontend
|
||||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
frontend-test-oss:
|
frontend-test-ce:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-build-oss]
|
needs: [frontend-build-ce]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 0
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -104,13 +104,13 @@ jobs:
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: make deps
|
run: make deps
|
||||||
|
|
||||||
- name: Download OSS Frontend
|
- name: Download CE Frontend
|
||||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||||
with:
|
with:
|
||||||
name: frontend-oss-${{ env.BRANCH_NAME }}
|
name: frontend-ce-${{ env.BRANCH_NAME }}
|
||||||
path: ./ui/packages/consul-ui/dist
|
path: ./ui/packages/consul-ui/dist
|
||||||
|
|
||||||
- name: Ember Test OSS
|
- name: Ember Test CE
|
||||||
id: cache
|
id: cache
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit
|
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
|
run: make deps
|
||||||
|
|
||||||
- name: Ember Build ENT
|
- name: Ember Build ENT
|
||||||
id: build-oss
|
id: build-ce
|
||||||
working-directory: ./ui/packages/consul-ui
|
working-directory: ./ui/packages/consul-ui
|
||||||
run: make build-ci
|
run: make build-ci
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ jobs:
|
||||||
partition: [ 1, 2, 3, 4 ]
|
partition: [ 1, 2, 3, 4 ]
|
||||||
env:
|
env:
|
||||||
CONSUL_NSPACES_ENABLED: 1
|
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
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
@ -219,7 +219,7 @@ jobs:
|
||||||
|
|
||||||
slack-failure-notification:
|
slack-failure-notification:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend-test-oss, frontend-test-ent]
|
needs: [frontend-test-ce, frontend-test-ent]
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
steps:
|
steps:
|
||||||
- name: Slack Notification
|
- name: Slack Notification
|
||||||
|
|
|
@ -51,11 +51,11 @@ issues:
|
||||||
- linters: [unparam]
|
- linters: [unparam]
|
||||||
text: "`(t|resp|req|entMeta)` is unused"
|
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"
|
# 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]
|
- 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:
|
linters-settings:
|
||||||
govet:
|
govet:
|
||||||
|
|
|
@ -11,6 +11,7 @@ binary {
|
||||||
secrets = false
|
secrets = false
|
||||||
go_modules = false
|
go_modules = false
|
||||||
osv = true
|
osv = true
|
||||||
|
# TODO(spatel): CE refactor
|
||||||
oss_index = true
|
oss_index = true
|
||||||
nvd = true
|
nvd = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ const (
|
||||||
const DefaultNamespaceName = "default"
|
const DefaultNamespaceName = "default"
|
||||||
|
|
||||||
type EnterpriseConfig struct {
|
type EnterpriseConfig struct {
|
||||||
// no fields in OSS
|
// no fields in CE
|
||||||
}
|
}
|
||||||
|
|
||||||
func (_ *EnterpriseConfig) Close() {
|
func (_ *EnterpriseConfig) Close() {
|
|
@ -3755,7 +3755,7 @@ func (a *Agent) loadServices(conf *config.RuntimeConfig, snap map[structs.CheckI
|
||||||
}
|
}
|
||||||
|
|
||||||
if acl.EqualPartitions("", p.Service.PartitionOrEmpty()) {
|
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.
|
// we always default the service partition to the agent's partition.
|
||||||
p.Service.OverridePartition(a.AgentEnterpriseMeta().PartitionOrDefault())
|
p.Service.OverridePartition(a.AgentEnterpriseMeta().PartitionOrDefault())
|
||||||
} else if !acl.EqualPartitions(a.AgentEnterpriseMeta().PartitionOrDefault(), p.Service.PartitionOrDefault()) {
|
} else if !acl.EqualPartitions(a.AgentEnterpriseMeta().PartitionOrDefault(), p.Service.PartitionOrDefault()) {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
package autoconf
|
package autoconf
|
||||||
|
|
||||||
// AutoConfigEnterprise has no fields in OSS
|
// AutoConfigEnterprise has no fields in CE
|
||||||
type AutoConfigEnterprise struct{}
|
type AutoConfigEnterprise struct{}
|
||||||
|
|
||||||
// newAutoConfigEnterprise initializes the enterprise AutoConfig struct
|
// newAutoConfigEnterprise initializes the enterprise AutoConfig struct
|
|
@ -9,7 +9,7 @@ package autoconf
|
||||||
// EnterpriseConfig stub - only populated in Consul Enterprise
|
// EnterpriseConfig stub - only populated in Consul Enterprise
|
||||||
type EnterpriseConfig struct{}
|
type EnterpriseConfig struct{}
|
||||||
|
|
||||||
// finalize is a noop for OSS
|
// finalize is a noop for CE
|
||||||
func (_ *EnterpriseConfig) validateAndFinalize() error {
|
func (_ *EnterpriseConfig) validateAndFinalize() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"testing"
|
"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
|
// It does contain an enterprise config for compatibility
|
||||||
// purposes but that in and of itself is just a stub.
|
// purposes but that in and of itself is just a stub.
|
||||||
type mockedEnterpriseConfig struct {
|
type mockedEnterpriseConfig struct {
|
|
@ -13,7 +13,7 @@ import (
|
||||||
// validateEnterpriseConfig is a function to validate the enterprise specific
|
// validateEnterpriseConfig is a function to validate the enterprise specific
|
||||||
// configuration items after Parsing but before merging into the overall
|
// configuration items after Parsing but before merging into the overall
|
||||||
// configuration. The original intent is to use it to ensure that we warn
|
// 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 {
|
func validateEnterpriseConfigKeys(config *Config) []error {
|
||||||
var result []error
|
var result []error
|
||||||
add := func(k string) {
|
add := func(k string) {
|
|
@ -35,9 +35,9 @@ var enterpriseConfigKeyWarnings = []string{
|
||||||
enterpriseConfigKeyError{key: "reporting.license.enabled"}.Error(),
|
enterpriseConfigKeyError{key: "reporting.license.enabled"}.Error(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// OSS-only equivalent of TestConfigFlagsAndEdgecases
|
// CE-only equivalent of TestConfigFlagsAndEdgecases
|
||||||
// used for flags validated in ent-only code
|
// 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")
|
dataDir := testutil.TempDir(t, "consul")
|
||||||
defer os.RemoveAll(dataDir)
|
defer os.RemoveAll(dataDir)
|
||||||
|
|
|
@ -18,7 +18,7 @@ func TestSegments(t *testing.T) {
|
||||||
|
|
||||||
tests := []testCase{
|
tests := []testCase{
|
||||||
{
|
{
|
||||||
desc: "segment name not in OSS",
|
desc: "segment name not in CE",
|
||||||
args: []string{
|
args: []string{
|
||||||
`-data-dir=` + dataDir,
|
`-data-dir=` + dataDir,
|
||||||
},
|
},
|
||||||
|
@ -42,7 +42,7 @@ func TestSegments(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "segments not in OSS",
|
desc: "segments not in CE",
|
||||||
args: []string{
|
args: []string{
|
||||||
`-data-dir=` + dataDir,
|
`-data-dir=` + dataDir,
|
||||||
},
|
},
|
|
@ -31,7 +31,7 @@ func UpstreamSNI(u *structs.Upstream, subset string, dc string, trustDomain stri
|
||||||
|
|
||||||
func GatewaySNI(dc string, partition, trustDomain string) string {
|
func GatewaySNI(dc string, partition, trustDomain string) string {
|
||||||
if partition == "" {
|
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"
|
partition = "default"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ func ServiceSNI(service string, subset string, namespace string, partition strin
|
||||||
namespace = structs.IntentionDefaultNamespace
|
namespace = structs.IntentionDefaultNamespace
|
||||||
}
|
}
|
||||||
if partition == "" {
|
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"
|
partition = "default"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ func PeeredServiceSNI(service, namespace, partition, peerName, trustDomain strin
|
||||||
namespace = structs.IntentionDefaultNamespace
|
namespace = structs.IntentionDefaultNamespace
|
||||||
}
|
}
|
||||||
if partition == "" {
|
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"
|
partition = "default"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetEnterpriseMeta will synthesize an EnterpriseMeta struct from the SpiffeIDAgent.
|
// 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 {
|
func (id SpiffeIDAgent) GetEnterpriseMeta() *acl.EnterpriseMeta {
|
||||||
return &acl.EnterpriseMeta{}
|
return &acl.EnterpriseMeta{}
|
||||||
}
|
}
|
|
@ -13,7 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetEnterpriseMeta will synthesize an EnterpriseMeta struct from the SpiffeIDAgent.
|
// 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 {
|
func (id SpiffeIDMeshGateway) GetEnterpriseMeta() *acl.EnterpriseMeta {
|
||||||
return &acl.EnterpriseMeta{}
|
return &acl.EnterpriseMeta{}
|
||||||
}
|
}
|
|
@ -43,10 +43,10 @@ func (id SpiffeIDService) uriPath() string {
|
||||||
id.Service,
|
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
|
// handle exportedPartition from peered Consul Enterprise clusters in order
|
||||||
// to generate the correct SpiffeID.
|
// 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" {
|
if ap := id.PartitionOrDefault(); ap != "" && ap != "default" {
|
||||||
return "/ap/" + ap + path
|
return "/ap/" + ap + path
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,13 +13,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetEnterpriseMeta will synthesize an EnterpriseMeta struct from the SpiffeIDService.
|
// 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 {
|
func (id SpiffeIDService) GetEnterpriseMeta() *acl.EnterpriseMeta {
|
||||||
return &acl.EnterpriseMeta{}
|
return &acl.EnterpriseMeta{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PartitionOrDefault breaks from OSS's pattern of returning empty strings.
|
// PartitionOrDefault breaks from CE's pattern of returning empty strings.
|
||||||
// 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
|
// handle exportedPartition from peered Consul Enterprise clusters in order
|
||||||
// to generate the correct SpiffeID.
|
// to generate the correct SpiffeID.
|
||||||
func (id SpiffeIDService) PartitionOrDefault() string {
|
func (id SpiffeIDService) PartitionOrDefault() string {
|
|
@ -36,13 +36,13 @@ func (r *ACLResolver) resolveEnterpriseDefaultsForIdentity(identity structs.ACLI
|
||||||
|
|
||||||
// resolveEnterpriseIdentityAndRoles will resolve an enterprise identity to an additional set of roles
|
// resolveEnterpriseIdentityAndRoles will resolve an enterprise identity to an additional set of roles
|
||||||
func (_ *ACLResolver) resolveEnterpriseIdentityAndRoles(_ structs.ACLIdentity) (structs.ACLIdentity, structs.ACLRoles, error) {
|
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
|
return nil, nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolveEnterpriseIdentityAndPolicies will resolve an enterprise identity to an additional set of policies
|
// resolveEnterpriseIdentityAndPolicies will resolve an enterprise identity to an additional set of policies
|
||||||
func (_ *ACLResolver) resolveEnterpriseIdentityAndPolicies(_ structs.ACLIdentity) (structs.ACLIdentity, structs.ACLPolicies, error) {
|
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
|
return nil, nil, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -450,7 +450,7 @@ func vetDeregisterWithACL(
|
||||||
}
|
}
|
||||||
|
|
||||||
// This order must match the code in applyDeregister() in
|
// 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
|
// and will ignore fields based on this precedence. This lets us also
|
||||||
// ignore them from an ACL perspective.
|
// ignore them from an ACL perspective.
|
||||||
if subj.ServiceID != "" {
|
if subj.ServiceID != "" {
|
||||||
|
|
|
@ -77,7 +77,7 @@ func (s *Server) validateEnterpriseIntentionPartition(partition string) error {
|
||||||
return nil
|
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")
|
return errors.New("Partitions is a Consul Enterprise feature")
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ func (s *Server) validateEnterpriseIntentionNamespace(ns string, _ bool) error {
|
||||||
return nil
|
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")
|
return errors.New("Namespaces is a Consul Enterprise feature")
|
||||||
}
|
}
|
|
@ -264,7 +264,7 @@ func (c *FSM) Restore(old io.ReadCloser) error {
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if msg >= 64 {
|
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 {
|
} else {
|
||||||
return fmt.Errorf("Unrecognized msg type %d", msg)
|
return fmt.Errorf("Unrecognized msg type %d", msg)
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
registerPersister(persistOSS)
|
registerPersister(persistCE)
|
||||||
|
|
||||||
registerRestorer(structs.RegisterRequestType, restoreRegistration)
|
registerRestorer(structs.RegisterRequestType, restoreRegistration)
|
||||||
registerRestorer(structs.KVSRequestType, restoreKV)
|
registerRestorer(structs.KVSRequestType, restoreKV)
|
||||||
|
@ -47,7 +47,7 @@ func init() {
|
||||||
registerRestorer(structs.PeeringSecretsWriteType, restorePeeringSecrets)
|
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 {
|
if err := s.persistVirtualIPs(sink, encoder); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
|
@ -34,7 +34,7 @@ func TestRestoreFromEnterprise(t *testing.T) {
|
||||||
StorageBackend: storageBackend,
|
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.
|
// unsuccessfully restore entries from a Consul Ent snapshot.
|
||||||
buf := bytes.NewBuffer(nil)
|
buf := bytes.NewBuffer(nil)
|
||||||
sink := &MockSink{buf, false}
|
sink := &MockSink{buf, false}
|
||||||
|
@ -58,6 +58,6 @@ func TestRestoreFromEnterprise(t *testing.T) {
|
||||||
sink.Write([]byte{byte(structs.MessageType(entMockEntry.ID))})
|
sink.Write([]byte{byte(structs.MessageType(entMockEntry.ID))})
|
||||||
encoder.Encode(entMockEntry)
|
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()
|
sink.Cancel()
|
||||||
}
|
}
|
|
@ -27,7 +27,7 @@ import (
|
||||||
"github.com/hashicorp/consul/sdk/testutil"
|
"github.com/hashicorp/consul/sdk/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFSM_SnapshotRestore_OSS(t *testing.T) {
|
func TestFSM_SnapshotRestore_CE(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
logger := testutil.Logger(t)
|
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()
|
t.Parallel()
|
||||||
// Create an FSM with some state.
|
// Create an FSM with some state.
|
||||||
logger := testutil.Logger(t)
|
logger := testutil.Logger(t)
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func migrateIntentionsToConfigEntries(ixns structs.Intentions) []*structs.ServiceIntentionsConfigEntry {
|
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.
|
// namespace.
|
||||||
//
|
//
|
||||||
// The one exception is that if we find wildcards namespaces we "upgrade"
|
// 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{}{}
|
retained[name] = struct{}{}
|
||||||
output = append(output, ixn)
|
output = append(output, ixn)
|
||||||
continue // a-ok for OSS
|
continue // a-ok for CE
|
||||||
}
|
}
|
||||||
|
|
||||||
// If anything is wildcarded, attempt to reify it as "default".
|
// If anything is wildcarded, attempt to reify it as "default".
|
|
@ -16,7 +16,7 @@ import (
|
||||||
"github.com/hashicorp/consul/types"
|
"github.com/hashicorp/consul/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMerge_OSS_LAN(t *testing.T) {
|
func TestMerge_CE_LAN(t *testing.T) {
|
||||||
type testcase struct {
|
type testcase struct {
|
||||||
segment string
|
segment string
|
||||||
server bool
|
server bool
|
|
@ -17,7 +17,7 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPreparedQuery_OSS_Apply(t *testing.T) {
|
func TestPreparedQuery_CE_Apply(t *testing.T) {
|
||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip("too slow for testing.Short")
|
t.Skip("too slow for testing.Short")
|
||||||
}
|
}
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"github.com/hashicorp/consul/agent/structs"
|
"github.com/hashicorp/consul/agent/structs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var SegmentOSSSummaries = []prometheus.SummaryDefinition{
|
var SegmentCESummaries = []prometheus.SummaryDefinition{
|
||||||
{
|
{
|
||||||
Name: []string{"leader", "reconcile"},
|
Name: []string{"leader", "reconcile"},
|
||||||
Help: "Measures the time spent updating the raft store from the serf member information.",
|
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 ""
|
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.
|
// version of Consul doesn't support them.
|
||||||
func (s *Server) setupSegmentRPC() (map[string]net.Listener, error) {
|
func (s *Server) setupSegmentRPC() (map[string]net.Listener, error) {
|
||||||
if len(s.config.Segments) > 0 {
|
if len(s.config.Segments) > 0 {
|
||||||
|
@ -36,7 +36,7 @@ func (s *Server) setupSegmentRPC() (map[string]net.Listener, error) {
|
||||||
return nil, nil
|
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.
|
// version of Consul doesn't support them.
|
||||||
func (s *Server) setupSegments(config *Config, rpcListeners map[string]net.Listener) error {
|
func (s *Server) setupSegments(config *Config, rpcListeners map[string]net.Listener) error {
|
||||||
if len(config.Segments) > 0 {
|
if len(config.Segments) > 0 {
|
||||||
|
@ -46,6 +46,6 @@ func (s *Server) setupSegments(config *Config, rpcListeners map[string]net.Liste
|
||||||
return nil
|
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) {
|
func (s *Server) floodSegments(config *Config) {
|
||||||
}
|
}
|
|
@ -87,7 +87,7 @@ func (s *Server) removeFailedNode(
|
||||||
}
|
}
|
||||||
|
|
||||||
// lanPoolAllMembers only returns our own segment or partition's members, because
|
// 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) {
|
func (s *Server) lanPoolAllMembers() ([]serf.Member, error) {
|
||||||
return s.LANMembersInAgentPartition(), nil
|
return s.LANMembersInAgentPartition(), nil
|
||||||
}
|
}
|
|
@ -115,7 +115,7 @@ func catalogUpdateNodeExtinctionIndex(tx WriteTxn, idx uint64, _ *acl.Enterprise
|
||||||
}
|
}
|
||||||
|
|
||||||
func catalogInsertNode(tx WriteTxn, node *structs.Node) error {
|
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 = ""
|
node.Partition = ""
|
||||||
|
|
||||||
// Insert the node and update the index.
|
// Insert the node and update the index.
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"github.com/hashicorp/consul/agent/structs"
|
"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 {
|
for desc, tc := range map[string]struct {
|
||||||
evt EventPayloadCheckServiceNode
|
evt EventPayloadCheckServiceNode
|
||||||
sub string
|
sub string
|
|
@ -65,7 +65,7 @@ func configIntentionsConvertToList(iter memdb.ResultIterator, _ *acl.EnterpriseM
|
||||||
}
|
}
|
||||||
|
|
||||||
// getExportedServicesMatchServicesNames returns a list of service names that are considered matches when
|
// 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 matches
|
||||||
// - the service name is a wildcard
|
// - the service name is a wildcard
|
||||||
//
|
//
|
|
@ -83,7 +83,7 @@ type SamenessGroupMemberIndex struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compile-time assert that these interfaces hold to ensure that the
|
// 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.Indexer = (*SamenessGroupMemberIndex)(nil)
|
||||||
var _ memdb.MultiIndexer = (*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
|
// 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.Indexer = (*ServiceIntentionSourceSamenessGroupIndex)(nil)
|
||||||
var _ memdb.MultiIndexer = (*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
|
// 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.Indexer = (*ServiceIntentionSourceIndex)(nil)
|
||||||
var _ memdb.MultiIndexer = (*ServiceIntentionSourceIndex)(nil)
|
var _ memdb.MultiIndexer = (*ServiceIntentionSourceIndex)(nil)
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue