Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Provider Test Snapshots #1083

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/examples_nodejs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ func TestAccAwsProfile(t *testing.T) {
With(integration.ProgramTestOptions{
Dir: path.Join(getCwd(t), "aws-profile"),
ExtraRuntimeValidation: func(t *testing.T, info integration.RuntimeValidationStackInfo) {
// Manually set `AWS_PROFILE` to be the name of the profile used in the test, otherwise
// the test is expected to fail since we did not use the default profile. This is required
// to ensure multiple users with different profiles can use the Kubeconfig.
utils.EnsureKubeconfigFails(t, info.Outputs["kubeconfig"])
t.Setenv("AWS_PROFILE", os.Getenv("ALT_AWS_PROFILE"))

utils.RunEKSSmokeTest(t,
info.Deployment.Resources,
info.Outputs["kubeconfig"],
Expand Down
7 changes: 7 additions & 0 deletions examples/examples_py_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package example

import (
"os"
"path/filepath"
"testing"

Expand All @@ -32,6 +33,12 @@ func TestAccAwsProfilePy(t *testing.T) {
NoParallel: true,
Dir: filepath.Join(getCwd(t), "aws-profile-py"),
ExtraRuntimeValidation: func(t *testing.T, info integration.RuntimeValidationStackInfo) {
// Manually set `AWS_PROFILE` to be the name of the profile used in the test, otherwise
// the test is expected to fail since we did not use the default profile. This is required
// to ensure multiple users with different profiles can use the Kubeconfig.
utils.EnsureKubeconfigFails(t, info.Outputs["kubeconfig"])
t.Setenv("AWS_PROFILE", os.Getenv("ALT_AWS_PROFILE"))

utils.RunEKSSmokeTest(t,
info.Deployment.Resources,
info.Outputs["kubeconfig"],
Expand Down
17 changes: 17 additions & 0 deletions examples/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,3 +652,20 @@ func clientSetFromKubeconfig(kubeconfig any) (*kubernetes.Clientset, error) {
}
return clientSet, nil
}

// EnsureKubeconfigFails ensures that the provided kubeconfig fails to authenticate.
func EnsureKubeconfigFails(t *testing.T, kubeconfig any) {
kc, err := json.Marshal(kubeconfig)
if err != nil {
t.Errorf("unable to marshal provided kubeconfig: %s", err)
}
kubeAccess, err := KubeconfigToKubeAccess(kc)
if err != nil {
t.Errorf("unable to create KubeAccess from kubeconfig: %s", err)
}

_, err = kubeAccess.Clientset.Discovery().ServerVersion()
if err == nil {
t.Errorf("expected kubeconfig to fail, but it succeeded to return the server version")
}
}
6 changes: 0 additions & 6 deletions nodejs/eks/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,6 @@ export function generateKubeconfig(
if (opts?.roleArn) {
args = [...args, "--role", opts.roleArn];
}
if (opts?.profileName) {
env.push({
name: "AWS_PROFILE",
value: opts.profileName,
});
}

return pulumi.all([args, env]).apply(([tokenArgs, envvars]) => {
return {
Expand Down
1,962 changes: 983 additions & 979 deletions provider/testdata/recorded/TestProviderUpgrade/aws-profile-role/2.2.1/grpc.json

Large diffs are not rendered by default.

2,929 changes: 1,454 additions & 1,475 deletions provider/testdata/recorded/TestProviderUpgrade/aws-profile-role/2.2.1/state.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3,928 changes: 1,966 additions & 1,962 deletions provider/testdata/recorded/TestProviderUpgrade/cluster/2.2.1/grpc.json

Large diffs are not rendered by default.

7,114 changes: 3,561 additions & 3,553 deletions provider/testdata/recorded/TestProviderUpgrade/cluster/2.2.1/state.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,186 changes: 595 additions & 591 deletions provider/testdata/recorded/TestProviderUpgrade/extra-sg/2.2.1/grpc.json

Large diffs are not rendered by default.

1,890 changes: 946 additions & 944 deletions provider/testdata/recorded/TestProviderUpgrade/extra-sg/2.2.1/state.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3,522 changes: 1,763 additions & 1,759 deletions provider/testdata/recorded/TestProviderUpgrade/nodegroup/2.2.1/grpc.json

Large diffs are not rendered by default.

5,524 changes: 2,764 additions & 2,760 deletions provider/testdata/recorded/TestProviderUpgrade/nodegroup/2.2.1/state.json

Large diffs are not rendered by default.

1,010 changes: 507 additions & 503 deletions provider/testdata/recorded/TestProviderUpgrade/oidc-iam-sa/2.2.1/grpc.json

Large diffs are not rendered by default.

1,549 changes: 752 additions & 797 deletions provider/testdata/recorded/TestProviderUpgrade/oidc-iam-sa/2.2.1/state.json

Large diffs are not rendered by default.

1,564 changes: 784 additions & 780 deletions provider/testdata/recorded/TestProviderUpgrade/storage-classes/2.2.1/grpc.json

Large diffs are not rendered by default.

2,356 changes: 1,180 additions & 1,176 deletions provider/testdata/recorded/TestProviderUpgrade/storage-classes/2.2.1/state.json

Large diffs are not rendered by default.

1,876 changes: 940 additions & 936 deletions provider/testdata/recorded/TestProviderUpgrade/subnet-tags/2.2.1/grpc.json

Large diffs are not rendered by default.

2,854 changes: 1,428 additions & 1,426 deletions provider/testdata/recorded/TestProviderUpgrade/subnet-tags/2.2.1/state.json

Large diffs are not rendered by default.

2,142 changes: 1,073 additions & 1,069 deletions provider/testdata/recorded/TestProviderUpgrade/tags/2.2.1/grpc.json

Large diffs are not rendered by default.

4,128 changes: 2,066 additions & 2,062 deletions provider/testdata/recorded/TestProviderUpgrade/tags/2.2.1/state.json

Large diffs are not rendered by default.

Loading