mirror of
https://github.com/status-im/consul.git
synced 2025-01-18 17:52:17 +00:00
a72f868218
This updates the testing/deployer (aka "topology test") framework to conditionally configure and launch catalog constructs using v2 resources. This is controlled via a Version field on the Node construct in a topology.Config. This only functions for a dataplane type and has other restrictions that match the rest of v2 (no peering, no wanfed, no mesh gateways). Like config entries, you can statically provide a set of initial resources to be synced when bringing up the cluster (beyond those that are generated for you such as workloads, services, etc). If you want to author a test that can be freely converted between v1 and v2 then that is possible. If you switch to the multi-port definition on a topology.Service (aka "workload/instance") then that makes v1 ineligible. This also adds a starter set of "on every PR" integration tests for single and multiport under test-integ/catalogv2
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package topoutil
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/hashicorp/consul/test/integration/consul-container/libs/utils"
|
|
"github.com/hashicorp/consul/testing/deployer/topology"
|
|
)
|
|
|
|
func TargetImages() topology.Images {
|
|
// Start with no preferences.
|
|
var images topology.Images
|
|
if !runningInCI() {
|
|
// Until 1.17 GAs, we want the pre-release versions for these tests,
|
|
// run outside of CI for convenience.
|
|
images = topology.Images{
|
|
ConsulCE: HashicorpDockerProxy + "/hashicorppreview/consul:1.17-dev",
|
|
ConsulEnterprise: HashicorpDockerProxy + "/hashicorppreview/consul-enterprise:1.17-dev",
|
|
Dataplane: HashicorpDockerProxy + "/hashicorppreview/consul-dataplane:1.3-dev",
|
|
}
|
|
}
|
|
|
|
// We want the image overridden by the local build produced by
|
|
// 'make test-compat-integ-setup' or 'make dev-docker'.
|
|
testImages := utils.TargetImages()
|
|
images = images.OverrideWith(testImages)
|
|
|
|
return images
|
|
}
|
|
|
|
func runningInCI() bool {
|
|
return os.Getenv("GITHUB_ACTIONS") != "" || os.Getenv("CI") != ""
|
|
}
|