Skip to content

Commit

Permalink
feat: wip k8s integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoutsovasilis committed Jun 27, 2024
1 parent 4a78e5e commit cd52448
Show file tree
Hide file tree
Showing 23 changed files with 2,181 additions and 356 deletions.
22 changes: 22 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,28 @@ steps:
retry:
manual:
allowed: true
- label: "K8s integration tests: {{matrix.k8s_version}}"
key: "k8s-integration-tests"
env:
K8S_VERSION: "v{{matrix.k8s_version}}"
KIND_VERSION: "v0.20.0"
command: ".buildkite/scripts/steps/k8s-extended-tests.sh"
artifact_paths:
- "build/TEST-**"
- "build/diagnostics/*"
agents:
provider: "gcp"
image: "family/core-ubuntu-2204"
matrix:
setup:
k8s_version:
- "1.29.0"
- "1.28.0"
- "1.27.3"
- "1.26.6"
retry:
manual:
allowed: true

- label: ":sonarqube: Continuous Code Inspection"
env:
Expand Down
26 changes: 26 additions & 0 deletions .buildkite/scripts/steps/k8s-extended-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -euo pipefail

source .buildkite/scripts/common.sh

export PATH=$HOME/bin:${PATH}
source .buildkite/scripts/install-kubectl.sh
source .buildkite/scripts/install-kind.sh

# Run k8s integration tests
set +e
TEST_INTEG_CLEAN_ON_EXIT=true INSTANCE_PROVISIONER=kind STACK_PROVISIONER=stateful EXTERNAL=true mage integration:kubernetes
TESTS_EXIT_STATUS=$?
set -e

# HTML report
outputXML="build/TEST-go-integration.xml"

if [ -f "$outputXML" ]; then
go install github.com/alexec/junit2html@latest
junit2html < "$outputXML" > build/TEST-report.html
else
echo "Cannot generate HTML test report: $outputXML not found"
fi

exit $TESTS_EXIT_STATUS
1,717 changes: 1,436 additions & 281 deletions NOTICE.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ require (
k8s.io/apimachinery v0.29.5
k8s.io/client-go v0.29.5
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/e2e-framework v0.3.0
)

require (
Expand Down Expand Up @@ -152,6 +153,7 @@ require (
github.com/elastic/pkcs8 v1.0.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/expr-lang/expr v1.16.9 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
Expand All @@ -172,6 +174,7 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/licenseclassifier v0.0.0-20221004142553-c1ed8fcf4bab // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/hashicorp/consul/api v1.29.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand Down Expand Up @@ -309,6 +312,7 @@ require (
howett.net/plist v1.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/kubelet v0.29.3 // indirect
sigs.k8s.io/controller-runtime v0.15.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,7 @@ github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQL
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4=
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc=
Expand Down Expand Up @@ -956,6 +957,8 @@ github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jT
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4=
github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo=
github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
Expand Down Expand Up @@ -1172,6 +1175,8 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
Expand Down Expand Up @@ -1976,6 +1981,8 @@ github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmF
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vladimirvivien/gexe v0.2.0 h1:nbdAQ6vbZ+ZNsolCgSVb9Fno60kzSuvtzVh6Ytqi/xY=
github.com/vladimirvivien/gexe v0.2.0/go.mod h1:LHQL00w/7gDUKIak24n801ABp8C+ni6eBht9vGVst8w=
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI=
github.com/winlabs/gowin32 v0.0.0-20221003142512-0d265587d3c9 h1:U8aCPFEMnxAEyj9IonhMVV1gSL4nzelh8uvoXp0hrq0=
Expand Down Expand Up @@ -2792,6 +2799,8 @@ golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc=
gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ=
gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo=
google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
Expand Down Expand Up @@ -3134,6 +3143,8 @@ k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=
k8s.io/api v0.29.5 h1:levS+umUigHCfI3riD36pMY1vQEbrzh4r1ivVWAhHaI=
k8s.io/api v0.29.5/go.mod h1:7b18TtPcJzdjk7w5zWyIHgoAtpGeRvGGASxlS7UZXdQ=
k8s.io/apiextensions-apiserver v0.26.0/go.mod h1:7ez0LTiyW5nq3vADtK6C3kMESxadD51Bh6uz3JOlqWQ=
k8s.io/apiextensions-apiserver v0.27.2 h1:iwhyoeS4xj9Y7v8YExhUwbVuBhMr3Q4bd/laClBV6Bo=
k8s.io/apiextensions-apiserver v0.27.2/go.mod h1:Oz9UdvGguL3ULgRdY9QMUzL2RZImotgxvGjdWRq6ZXQ=
k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc=
Expand Down Expand Up @@ -3224,6 +3235,10 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyz
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33/go.mod h1:soWkSNf2tZC7aMibXEqVhCd73GOY5fJikn8qbdzemB0=
sigs.k8s.io/controller-runtime v0.15.1 h1:9UvgKD4ZJGcj24vefUFgZFP3xej/3igL9BsOUTb/+4c=
sigs.k8s.io/controller-runtime v0.15.1/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
sigs.k8s.io/e2e-framework v0.3.0 h1:eqQALBtPCth8+ulTs6lcPK7ytV5rZSSHJzQHZph4O7U=
sigs.k8s.io/e2e-framework v0.3.0/go.mod h1:C+ef37/D90Dc7Xq1jQnNbJYscrUGpxrWog9bx2KIa+c=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
Expand Down
154 changes: 94 additions & 60 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/elastic/elastic-agent/internal/pkg/agent/application/upgrade/artifact/download"
"github.com/elastic/elastic-agent/pkg/testing/define"
"github.com/elastic/elastic-agent/pkg/testing/ess"
"github.com/elastic/elastic-agent/pkg/testing/kubernetes/kind"
"github.com/elastic/elastic-agent/pkg/testing/multipass"
"github.com/elastic/elastic-agent/pkg/testing/ogc"
"github.com/elastic/elastic-agent/pkg/testing/runner"
Expand Down Expand Up @@ -1990,6 +1991,43 @@ func (Integration) Single(ctx context.Context, testName string) error {
return integRunner(ctx, false, testName)
}

// Kubernetes runs kubernetes integration tests
func (Integration) Kubernetes(ctx context.Context) error {

//build elastic-agent docker package
targetEnv := fmt.Sprintf("linux/%s", runtime.GOARCH)
if err := os.Setenv(platformsEnv, targetEnv); err != nil {
return err
}
if err := os.Setenv(packagesEnv, "docker"); err != nil {
return err
}
if err := os.Setenv(devEnv, "true"); err != nil {
return err
}
if err := os.Setenv(snapshotEnv, "true"); err != nil {
return err
}

devtools.DevBuild = true
devtools.Snapshot = true
devtools.Platforms = devtools.Platforms.Filter(targetEnv)
devtools.SelectedPackageTypes = []devtools.PackageType{devtools.Docker}

if _, hasExternal := os.LookupEnv(externalArtifacts); !hasExternal {
devtools.ExternalBuild = true
}

Package()

// invoke integration tests
if err := os.Setenv("TEST_GROUPS", "kubernetes"); err != nil {
return err
}

return integRunner(ctx, false, "")
}

// UpdateVersions runs an update on the `.agent-versions.json` fetching
// the latest version list from the artifact API.
func (Integration) UpdateVersions(ctx context.Context) error {
Expand Down Expand Up @@ -2646,6 +2684,14 @@ func createTestRunner(matrix bool, singleTest string, goTestFlags string, batche
if !ok {
return nil, fmt.Errorf("ESS api key missing; run 'mage integration:auth'")
}

// Possible to change the region for deployment, default is gcp-us-west2 which is
// the CFT region.
essRegion := os.Getenv("TEST_INTEG_AUTH_ESS_REGION")
if essRegion == "" {
essRegion = "gcp-us-west2"
}

serviceTokenPath, ok, err := getGCEServiceTokenPath()
if err != nil {
return nil, err
Expand All @@ -2660,27 +2706,58 @@ func createTestRunner(matrix bool, singleTest string, goTestFlags string, batche
datacenter = "us-central1-a"
}

// Possible to change the region for deployment, default is gcp-us-west2 which is
// the CFT region.
essRegion := os.Getenv("TEST_INTEG_AUTH_ESS_REGION")
if essRegion == "" {
essRegion = "gcp-us-west2"
ogcCfg := ogc.Config{
ServiceTokenPath: serviceTokenPath,
Datacenter: datacenter,
}

var instanceProvisioner runner.InstanceProvisioner
instanceProvisionerMode := os.Getenv("INSTANCE_PROVISIONER")
if instanceProvisionerMode == "" {
instanceProvisionerMode = "ogc"
}
if instanceProvisionerMode != "ogc" && instanceProvisionerMode != "multipass" {
switch instanceProvisionerMode {
case "", ogc.Name:
instanceProvisionerMode = ogc.Name
instanceProvisioner, err = ogc.NewProvisioner(ogcCfg)
case multipass.Name:
instanceProvisioner = multipass.NewProvisioner()
case kind.Name:
k8sVersion := os.Getenv("K8S_VERSION")
if k8sVersion == "" {
return nil, errors.New("K8S_VERSION must be set to use kind instance provisioner")
}
instanceProvisioner = kind.NewProvisioner(k8sVersion)
default:
return nil, fmt.Errorf("INSTANCE_PROVISIONER environment variable must be one of 'ogc' or 'multipass', not %s", instanceProvisionerMode)
}
fmt.Printf(">>>> Using %s instance provisioner\n", instanceProvisionerMode)

email, err := ogcCfg.ClientEmail()
if err != nil {
return nil, err
}

provisionCfg := ess.ProvisionerConfig{
Identifier: fmt.Sprintf("at-%s", strings.Replace(strings.Split(email, "@")[0], ".", "-", -1)),
APIKey: essToken,
Region: essRegion,
}

var stackProvisioner runner.StackProvisioner
stackProvisionerMode := os.Getenv("STACK_PROVISIONER")
if stackProvisionerMode == "" {
switch stackProvisionerMode {
case "", ess.ProvisionerStateful:
stackProvisionerMode = ess.ProvisionerStateful
}
if stackProvisionerMode != ess.ProvisionerStateful &&
stackProvisionerMode != ess.ProvisionerServerless {
stackProvisioner, err = ess.NewProvisioner(provisionCfg)
if err != nil {
return nil, err
}
case ess.ProvisionerServerless:
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
stackProvisioner, err = ess.NewServerlessProvisioner(ctx, provisionCfg)
if err != nil {
return nil, err
}
default:
return nil, fmt.Errorf("STACK_PROVISIONER environment variable must be one of %q or %q, not %s",
ess.ProvisionerStateful,
ess.ProvisionerServerless,
Expand All @@ -2691,11 +2768,11 @@ func createTestRunner(matrix bool, singleTest string, goTestFlags string, batche
timestamp := timestampEnabled()

extraEnv := map[string]string{}
if os.Getenv("AGENT_COLLECT_DIAG") != "" {
extraEnv["AGENT_COLLECT_DIAG"] = os.Getenv("AGENT_COLLECT_DIAG")
if agentCollectDiag := os.Getenv("AGENT_COLLECT_DIAG"); agentCollectDiag != "" {
extraEnv["AGENT_COLLECT_DIAG"] = agentCollectDiag
}
if os.Getenv("AGENT_KEEP_INSTALLED") != "" {
extraEnv["AGENT_KEEP_INSTALLED"] = os.Getenv("AGENT_KEEP_INSTALLED")
if agentKeepInstalled := os.Getenv("AGENT_KEEP_INSTALLED"); agentKeepInstalled != "" {
extraEnv["AGENT_KEEP_INSTALLED"] = agentKeepInstalled
}

extraEnv["TEST_LONG_RUNNING"] = os.Getenv("TEST_LONG_RUNNING")
Expand Down Expand Up @@ -2735,49 +2812,6 @@ func createTestRunner(matrix bool, singleTest string, goTestFlags string, batche
ExtraEnv: extraEnv,
BinaryName: binaryName,
}
ogcCfg := ogc.Config{
ServiceTokenPath: serviceTokenPath,
Datacenter: datacenter,
}
email, err := ogcCfg.ClientEmail()
if err != nil {
return nil, err
}

var instanceProvisioner runner.InstanceProvisioner
if instanceProvisionerMode == multipass.Name {
instanceProvisioner = multipass.NewProvisioner()
} else if instanceProvisionerMode == ogc.Name {
instanceProvisioner, err = ogc.NewProvisioner(ogcCfg)
if err != nil {
return nil, err
}
} else {
return nil, fmt.Errorf("unknown instance provisioner: %s", instanceProvisionerMode)
}

provisionCfg := ess.ProvisionerConfig{
Identifier: fmt.Sprintf("at-%s", strings.Replace(strings.Split(email, "@")[0], ".", "-", -1)),
APIKey: essToken,
Region: essRegion,
}
var stackProvisioner runner.StackProvisioner
if stackProvisionerMode == ess.ProvisionerStateful {
stackProvisioner, err = ess.NewProvisioner(provisionCfg)
if err != nil {
return nil, err
}

} else if stackProvisionerMode == ess.ProvisionerServerless {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
stackProvisioner, err = ess.NewServerlessProvisioner(ctx, provisionCfg)
if err != nil {
return nil, err
}
} else {
return nil, fmt.Errorf("unknown stack provisioner: %s", stackProvisionerMode)
}

r, err := runner.NewRunner(cfg, instanceProvisioner, stackProvisioner, batches...)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions pkg/component/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (

func TestLoadRuntimeSpecs(t *testing.T) {
for _, platform := range GlobalPlatforms {
if platform.OS == Kubernetes {
// kubernetes platform is only supported in integration tests
continue
}
t.Run(platform.String(), func(t *testing.T) {
detail := PlatformDetail{
Platform: platform,
Expand Down
12 changes: 12 additions & 0 deletions pkg/component/platforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const (
Linux = "linux"
// Windows represents running on Windows
Windows = "windows"
// Kubernetes represents running on Kubernetes
Kubernetes = "kubernetes"
)

const (
Expand Down Expand Up @@ -54,6 +56,16 @@ var GlobalPlatforms = Platforms{
Arch: ARM64,
GOOS: Linux,
},
{
OS: Kubernetes,
Arch: ARM64,
GOOS: Linux,
},
{
OS: Kubernetes,
Arch: AMD64,
GOOS: Linux,
},
{
OS: Darwin,
Arch: AMD64,
Expand Down
Loading

0 comments on commit cd52448

Please sign in to comment.