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

aws-cdk/lambda-layer-kubectl-v27: Found CDK v1 deps in your project, even though your "cdkVersion" is 2.x. #28628

Open
lmouhib opened this issue Jan 9, 2024 · 3 comments
Labels
@aws-cdk/aws-lambda Related to AWS Lambda @aws-cdk/aws-lambda-layer-kubectl bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@lmouhib
Copy link

lmouhib commented Jan 9, 2024

Describe the bug

When using kubectl layers for newer version, CDK complain that the layer still uses CDK V1.

Expected Behavior

CDk should not complain and the lambda layer library should use CDK v2

Current Behavior

CDk should not complain and the lambda layer library seems to use CDK v1.

👾 default | ts-node --skip-project .projenrc.ts
👾 WARNING: Found CDK v1 deps in your project, even though your "cdkVersion" is 2.x: [@aws-cdk/lambda-layer-kubectl-v27]. Check out https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html for more information about using CDK v2 dependencies.
👾 Installing dependencies...
👾 install | yarn install --check-files

Reproduction Steps

Create an EKS cluster with L2 module and pass the lambda layer of any EKS after 1.21.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.118.0

Framework Version

No response

Node.js Version

v18.18.0

OS

macOS

Language

TypeScript

Language Version

4.9.4

Other information

No response

@lmouhib lmouhib added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 9, 2024
@lmouhib lmouhib changed the title aws-cdk/lambda-layer-kubectl-v27: Found CDK v1 deps in your project, even though your "cdkVersion" is 2.x: [@aws-cdk/lambda-layer-kubectl-v27]. Check out https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html for more information about using CDK v2 dependencies. aws-cdk/lambda-layer-kubectl-v27: Found CDK v1 deps in your project, even though your "cdkVersion" is 2.x. Jan 9, 2024
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Jan 9, 2024
@pahud
Copy link
Contributor

pahud commented Jan 9, 2024

According to this the v27 module should depends on cdkVersion 2.28.0

https://github.com/cdklabs/awscdk-asset-kubectl/blob/193965eb3a3cd604ad27c79b159a9b4d5b87213b/.projenrc.ts#L14

Are you running projen in your current project with your own .projenrc.ts? I am not sure if this warning is coming from the layer. What is the cdkVersion in your .projenrc.ts ?

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jan 9, 2024
@lmouhib
Copy link
Author

lmouhib commented Jan 10, 2024

@pahud here is the .projenrc.ts link.

We also get the warning if we run a cdk deploy, without using any projen helpers.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jan 11, 2024
@kaprah
Copy link

kaprah commented Mar 4, 2024

We have this same issue within our internal CDK library as well whenever we are compiling the project, an older version of kubectl layer, but we also did run into the same issue of it complaining about v27, and v28 if those are added as well.

👾 build » default | node .projenrc.js
👾 WARNING: Found CDK v1 deps in your project, even though your "cdkVersion" is 2.x: [@aws-cdk/lambda-layer-kubectl-v26]. Check out https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html for more information about using CDK v2 dependencies.
👾 build » compile | jsii --silence-warnings=reserved-word

Snippet of our projenrc file with its CDK dependencies:

    cdkVersion: '2.113.0',
    version: '0.1.0',
    gitignore: [
        'test-reports/*',
    ],
    prettier: false,

    /* JsiiProjectOptions */
    authorOrganization: true, /* undefined */
    compat: true, /* Automatically run API compatibility test against the latest version published to npm after compilation. */
    docgen: false, /* Automatically generate API.md from jsii. */
    docsDirectory: 'docs',
    compileBeforeTest: true,
    eslint: true, /* Install eslint. */
    eslintOptions: {
        dirs: ['src', 'test'],
        fileExtensions: ['.ts'],
        tsconfigPath: './tsconfig.dev.json',
        noUnusedLocals: false,
        ignorePatterns: ['.js', '.d.ts', 'node_modules/', '*.generated.ts', 'coverage', '.json', 'src/*/tsconfig.json'],
    },
    jest: true, /* Use jest for unit tests. */

    /* NodeProjectCommonOptions */
    antitamper: false, /* Checks that after build there are no modified files on git. */
    buildWorkflow: true, /* Define a GitHub workflow for building PRs. */
    defaultReleaseBranch: 'main', /* The name of the main release branch. */
    majorVersion: 4,
    // cdkDependenciesAsDeps: false, not used with cdk 2.x
    peerDeps: [
        'aws-cdk-lib@^2.113.0',
        'constructs@^10.0.0',
        '@aws-cdk/lambda-layer-kubectl-v26@^2.0.1',
    ],
    devDeps: [
        '@types/jest',
        'aws-cdk-lib@^2.113.0',
        'constructs@^10.0.0',
        'typescript@~3.9.0',
        'cdk@^2.113.0',
        'typedoc@^0.23',
    ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda @aws-cdk/aws-lambda-layer-kubectl bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

3 participants