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

Add checks to validate versions of kubectl and aws-cli installed #722

Merged
merged 6 commits into from
Jun 17, 2022

Conversation

viveklak
Copy link
Contributor

Proposed changes

With this change we validate a minimum version of kubectl and aws-cli. An error like this if an unsupported version of kubectl or aws-cli is installed is returned:

pulumi up                           
Previewing update (dev2)

View Live: https://app.pulumi.com/vivek/example-cluster/dev2/previews/21054be6-1c08-4214-9425-d9dda4447d52

     Type                  Name                  Plan       Info
 +   pulumi:pulumi:Stack   example-cluster-dev2  create     1 error
 +   └─ eks:index:Cluster  example-cluster-1     create     
 
Diagnostics:
  pulumi:pulumi:Stack (example-cluster-dev):
    error: Running program '/Users/vivek/code/pulumi-eks/examples/cluster' failed with an unhandled exception:
    Error: At least v1.24.0 of kubectl is required. Current version is: 1.23.0. See https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl for instructions on installing the latest.
        at Object.assertCompatibleKubectlVersionExists (/Users/vivek/code/pulumi-eks/nodejs/eks/dependencies.ts:48:15)
        ...
Diagnostics:
  pulumi:pulumi:Stack (example-cluster-dev):
    error: Running program '/Users/vivek/code/pulumi-eks/examples/cluster' failed with an unhandled exception:
    Error: At least v2.7.0 of aws-cli is required. Current version is: 2.6.8. See https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html for installation instructions.
        at Object.assertCompatibleAWSCLIExists (/Users/vivek/code/pulumi-eks/nodejs/eks/dependencies.ts:70:23)
        at createCore (/Users/vivek/code/pulumi-eks/nodejs/eks/cluster.ts:355:5)
...

Related issues (optional)

Fixes #721

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

1 similar comment
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link
Contributor

@stack72 stack72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a wonderful solution! Thank you :)

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@viveklak viveklak merged commit cc78896 into master Jun 17, 2022
@pulumi-bot pulumi-bot deleted the vl/Versions branch June 17, 2022 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail early on incompatible aws-cli and/or kubectl versions
2 participants