Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pulumi/pulumi-eks into blampe/ci-…
Browse files Browse the repository at this point in the history
…mgmt
  • Loading branch information
blampe committed Nov 15, 2024
2 parents d7e2c2c + b170816 commit dbec150
Show file tree
Hide file tree
Showing 257 changed files with 4,987 additions and 3,861 deletions.
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,36 +168,33 @@ dist:: dist/${GZIP_PREFIX}-darwin-amd64.tar.gz
dist:: dist/${GZIP_PREFIX}-darwin-arm64.tar.gz
dist:: dist/${GZIP_PREFIX}-windows-amd64.tar.gz

test_build::
cd examples/utils/testvpc && yarn install && yarn run tsc

test_nodejs:: PATH := $(WORKING_DIR)/bin:$(PATH)
test_nodejs:: provider install_nodejs_sdk
cd examples && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_nodejs_upgrade:: PATH := $(WORKING_DIR)/bin:$(PATH)
test_nodejs_upgrade:: provider install_nodejs_sdk
cd provider && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -v -run Upgrade -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_python:: install_provider test_build
cd examples && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_dotnet:: install_provider
cd examples && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_java:: install_provider
cd examples && go test -tags=java -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=java -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_unit_tests:
cd nodejs/eks && \
yarn install && \
yarn run test

specific_test:: install_nodejs_sdk test_build
cd examples && go test -tags=$(LanguageTags) -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . --run=TestAcc$(TestName) 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=$(LanguageTags) -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . --run=TestAcc$(TestName) 2>&1 | tee /tmp/gotest.log | gotestfmt

specific_test_local:: install_nodejs_sdk test_build
cd examples && go test -tags=$(LanguageTags) -v -count=1 -cover -timeout 3h . --run=TestAcc$(TestName)
cd tests && go test -tags=$(LanguageTags) -v -count=1 -cover -timeout 3h . --run=TestAcc$(TestName)

dev:: lint build_nodejs
test:: test_nodejs
Expand Down
11 changes: 4 additions & 7 deletions examples/aws-profile-py/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@

project_name = pulumi.get_project()

# For CI testing only: used to set profileName to alternate AWS_PROFILE envvar.
if not os.getenv("ALT_AWS_PROFILE"):
raise Exception("ALT_AWS_PROFILE must be set")

if not os.getenv("AWS_REGION"):
raise Exception("AWS_REGION must be set")

# AWS named profile to use.
profile_name = os.getenv("ALT_AWS_PROFILE")
profile_name = "aws-profile-py"

# Create an AWS provider instance using the named profile creds
# and current region.
Expand All @@ -28,8 +24,9 @@
# Create the cluster using the AWS provider and credential opts.
cluster = eks.Cluster(project_name,
provider_credential_opts=kubeconfig_opts,
authentication_mode=eks.AuthenticationMode.API,
# TODO(#1475): bootstrap_self_managed_addons=false, # To speed up the test.
coredns_addon_options=eks.CoreDnsAddonOptionsArgs(
enabled=False, # Speed up the test.
),
opts=pulumi.ResourceOptions(provider=aws_provider))

# Export the cluster kubeconfig.
Expand Down
45 changes: 30 additions & 15 deletions examples/aws-profile/index.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,59 @@
import * as aws from "@pulumi/aws";
import * as eks from "@pulumi/eks";
import * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";
import * as process from "process";

const projectName = pulumi.getProject();

// For CI testing only: used to set profileName to alternate AWS_PROFILE envvar.
if (!process.env.ALT_AWS_PROFILE) {
throw new Error("ALT_AWS_PROFILE must be set");
}

if (!process.env.AWS_REGION) {
throw new Error("AWS_REGION must be set");
throw new Error("AWS_REGION must be set");
}

// AWS named profile to use.
const profileName = process.env.ALT_AWS_PROFILE;
const profileName = "aws-profile-node";
// AWS region to use.
const region = pulumi.output(process.env.AWS_REGION as aws.types.enums.Region);

// Create an AWS provider instance using the named profile creds
// and current region.
const awsProvider = new aws.Provider("aws-provider", {
profile: profileName,
region: region,
profile: profileName,
region: region,
});

// Define the AWS provider credential opts to configure the cluster's
// kubeconfig auth.
const kubeconfigOpts: eks.KubeconfigOptions = {profileName: profileName};
const kubeconfigOpts: eks.KubeconfigOptions = { profileName: profileName };

// Create the cluster using the AWS provider and credential opts.
const cluster = new eks.Cluster(`${projectName}`, {
const cluster = new eks.Cluster(
`${projectName}`,
{
providerCredentialOpts: kubeconfigOpts,
authenticationMode: eks.AuthenticationMode.Api,
// TODO(#1475): bootstrapSelfManagedAddons: false, // To speed up the test.
}, {provider: awsProvider});
corednsAddonOptions: { enabled: false }, // Speed up the test.
},
{ provider: awsProvider }
);

// Export the cluster kubeconfig.
export const kubeconfig = cluster.kubeconfig;

// Export the cluster kubeconfig with the AWS_PROFILE set.
export const kubeconfigWithProfile = cluster.getKubeconfig({profileName: profileName}).result;
export const kubeconfigWithProfile = cluster.getKubeconfig({
profileName: profileName,
}).result;

const k8sProvider = new k8s.Provider("with-kubeconfig", {
kubeconfig: kubeconfigWithProfile,
});

// Deploy something into the cluster so upgrade tests can check for unexpected
// replacements.
new k8s.core.v1.ConfigMap(
"cm",
{
data: { foo: "bar" },
},
{ provider: k8sProvider }
);
73 changes: 37 additions & 36 deletions examples/go.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
module github.com/pulumi/pulumi-eks/examples
module github.com/pulumi/pulumi-eks

go 1.21
go 1.21.0

replace github.com/pulumi/pulumi-eks/sdk/v3 => ./sdk

require (
github.com/aws/aws-sdk-go-v2 v1.30.5
github.com/aws/aws-sdk-go-v2/config v1.27.33
github.com/aws/aws-sdk-go-v2/service/eks v1.48.4
github.com/pulumi/providertest v0.0.11
github.com/blang/semver v3.5.1+incompatible
github.com/pkg/errors v0.9.1
github.com/pulumi/providertest v0.0.15
github.com/pulumi/pulumi-aws/sdk/v6 v6.41.0
github.com/pulumi/pulumi-eks/sdk/v3 v3.0.0-alpha.6
github.com/pulumi/pulumi/pkg/v3 v3.129.0
github.com/pulumi/pulumi/sdk/v3 v3.129.0
github.com/pulumi/pulumi/pkg/v3 v3.138.0
github.com/pulumi/pulumi/sdk/v3 v3.138.0
github.com/stretchr/testify v1.9.0
golang.org/x/mod v0.20.0
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -20,12 +24,9 @@ require (
k8s.io/utils v0.0.0-20240310230437-4693a0247e57
)

replace github.com/pulumi/pulumi-eks/sdk/v3 => ../sdk

require (
cloud.google.com/go v0.112.2 // indirect
cloud.google.com/go/compute v1.25.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.7 // indirect
cloud.google.com/go/kms v1.15.8 // indirect
cloud.google.com/go/logging v1.9.0 // indirect
Expand All @@ -38,7 +39,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
Expand All @@ -59,7 +60,6 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 // indirect
github.com/aws/smithy-go v1.20.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
github.com/charmbracelet/bubbles v0.18.0 // indirect
github.com/charmbracelet/bubbletea v0.25.0 // indirect
Expand All @@ -72,7 +72,7 @@ require (
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/djherbis/times v1.6.0 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
Expand All @@ -82,17 +82,17 @@ require (
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-test/deep v1.1.0 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/glog v1.2.1 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
Expand All @@ -111,9 +111,10 @@ require (
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.6 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/hashicorp/hcl/v2 v2.20.1 // indirect
github.com/hashicorp/hcl/v2 v2.22.0 // indirect
github.com/hashicorp/vault/api v1.12.2 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand Down Expand Up @@ -147,11 +148,11 @@ require (
github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
github.com/pulumi/esc v0.9.1 // indirect
github.com/pulumi/esc v0.10.0 // indirect
github.com/pulumi/inflector v0.1.1 // indirect
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.9.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
Expand All @@ -162,10 +163,10 @@ require (
github.com/segmentio/encoding v0.4.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
Expand All @@ -182,31 +183,31 @@ require (
go.uber.org/atomic v1.11.0 // indirect
gocloud.dev v0.37.0 // indirect
gocloud.dev/secrets/hashivault v0.37.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/oauth2 v0.19.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.22.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/api v0.172.0 // indirect
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.34.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240403164606-bc84c2ddaf99 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
lukechampine.com/frand v1.4.2 // 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.4.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit dbec150

Please sign in to comment.