-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This is nearly a direct copy from https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/lambda-layer-kubectl with some changes to make it v2-compatible and projen-compatible. Note: this exposes a `kubeCtlLayer` construct, not the final form `kubeCtlAsset`. I figure it is better to start here and then update this repo in subsequent PRs. However, that means there are some inconsistencies with what I say this library exposes -- since this is not meant for active use right now, I feel like that is ok and will be corrected in a future PR.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,39 @@ | ||
const { awscdk } = require('projen'); | ||
const { awscdk, JsonPatch } = require('projen'); | ||
const project = new awscdk.AwsCdkConstructLibrary({ | ||
author: 'Kaizen Conroy', | ||
authorAddress: 'zen.conroy@gmail.com', | ||
cdkVersion: '2.1.0', | ||
author: 'Amazon Web Services', | ||
cdkVersion: '2.0.0', | ||
defaultReleaseBranch: 'main', | ||
name: 'awscdk-asset-kubectl', | ||
name: '@aws-cdk/asset-kubectl-v20', | ||
description: 'An Asset construct that contains kubectl, for use in Lambda Layers', | ||
repositoryUrl: 'https://github.com/cdklabs/awscdk-asset-kubectl.git', | ||
|
||
homepage: 'https://github.com/cdklabs/aws-asset-awscli#readme', | ||
autoApproveOptions: { | ||
allowedUsernames: ['cdklabs-automation'], | ||
secret: 'GITHUB_TOKEN', | ||
}, | ||
autoApproveUpgrades: true, | ||
workflowBootstrapSteps: [ | ||
{ | ||
// This step is required to allow the build workflow to build docker images. | ||
name: 'Change permissions on /var/run/docker.sock', | ||
run: 'sudo chown superchain /var/run/docker.sock', | ||
}, | ||
], | ||
// deps: [], /* Runtime dependencies of this module. */ | ||
// description: undefined, /* The description is just a string that helps people understand the purpose of the package. */ | ||
// devDeps: [], /* Build dependencies for this module. */ | ||
// packageName: undefined, /* The "name" in package.json. */ | ||
}); | ||
|
||
// These patches are required to enable sudo commands in the workflows under `workflowBootstrapSteps`, | ||
// see `workflowBootstrapSteps` above for why a sudo command is needed. | ||
const buildWorkflow = project.tryFindObjectFile('.github/workflows/build.yml'); | ||
buildWorkflow.patch(JsonPatch.add('/jobs/build/container/options', '--group-add sudo')); | ||
const releaseWorkflow = project.tryFindObjectFile('.github/workflows/release.yml'); | ||
releaseWorkflow.patch(JsonPatch.add('/jobs/release/container/options', '--group-add sudo')); | ||
const upgradeWorkflow = project.tryFindObjectFile('.github/workflows/upgrade-main.yml'); | ||
upgradeWorkflow.patch(JsonPatch.add('/jobs/upgrade/container/options', '--group-add sudo')); | ||
|
||
project.preCompileTask.exec('layer/build.sh'); | ||
|
||
project.synth(); |