Skip to content

Commit

Permalink
Remove beta and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
keenangraham committed Dec 4, 2024
1 parent 579d2a7 commit c7f220d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 9 deletions.
16 changes: 16 additions & 0 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion .projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const project = new awscdk.AwsCdkConstructLibrary({
'@aws-cdk/lambda-layer-kubectl-v25',
'@aws-cdk/lambda-layer-kubectl-v26',
'@aws-cdk/lambda-layer-kubectl-v27',
'@aws-cdk/lambda-layer-kubectl-v28',
'@aws-cdk/lambda-layer-kubectl-v29',
'@aws-cdk/lambda-layer-kubectl-v30',
'@aws-cdk/lambda-layer-kubectl-v31',
],
bundledDeps: [
'semver',
Expand Down Expand Up @@ -59,4 +63,4 @@ project.addTask('test:synth', {
exec: 'npx cdk synth -a "npx ts-node -P tsconfig.dev.json --prefer-ts-exts test/integ.karpenter.ts"',
});

project.synth();
project.synth();
4 changes: 4 additions & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class Karpenter extends Construct {
]);

return this.addManifest(id, {
apiVersion: 'karpenter.k8s.aws/v1beta1',
apiVersion: 'karpenter.k8s.aws/v1',
kind: 'EC2NodeClass',
metadata: {
name: id,
Expand Down Expand Up @@ -258,7 +258,7 @@ export class Karpenter extends Construct {
Utils.hasRequiredKeys(nodePoolSpec.template.spec, ['nodeClassRef', 'requirements']);

return this.addManifest(id, {
apiVersion: 'karpenter.sh/v1beta1',
apiVersion: 'karpenter.sh/v1',
kind: 'NodePool',
metadata: {
name: id,
Expand Down Expand Up @@ -698,4 +698,4 @@ export class Karpenter extends Construct {
actions: ['eks:DescribeCluster'],
}));
}
}
}
10 changes: 5 additions & 5 deletions test/versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('Karpenter Versions', () => {
).toThrowError();
});

it('should allow for creation of v1beta1 APIs', () => {
it('should allow for creation of v1 APIs', () => {
const app = new cdk.App();
const stack = new cdk.Stack(app, 'test-stack');

Expand All @@ -139,7 +139,7 @@ describe('Karpenter Versions', () => {
template: {
spec: {
nodeClassRef: {
apiVersion: 'karpenter.k8s.aws/v1beta1',
apiVersion: 'karpenter.k8s.aws/v1',
kind: 'EC2NodeClass',
name: nodeClass.name,
},
Expand All @@ -162,15 +162,15 @@ describe('Karpenter Versions', () => {
'Fn::Join': [
'',
Match.arrayWith([
Match.stringLikeRegexp('\"apiVersion\":\"karpenter.k8s.aws\/v1beta1\",\"kind\":\"EC2NodeClass\",\"metadata\":{\"name\":\"ec2nodeclass\",\"namespace\":\"karpenter\"'),
Match.stringLikeRegexp('\"apiVersion\":\"karpenter.k8s.aws\/v1\",\"kind\":\"EC2NodeClass\",\"metadata\":{\"name\":\"ec2nodeclass\",\"namespace\":\"karpenter\"'),
]),
],
}),
}));

// NodePool manifest
t.hasResourceProperties('Custom::AWSCDK-EKS-KubernetesResource', Match.objectLike({
Manifest: Match.stringLikeRegexp('\"apiVersion\":\"karpenter.sh\/v1beta1\",\"kind\":\"NodePool\",\"metadata\":{\"name\":\"nodepool\",\"namespace\":\"karpenter\"'),
Manifest: Match.stringLikeRegexp('\"apiVersion\":\"karpenter.sh\/v1\",\"kind\":\"NodePool\",\"metadata\":{\"name\":\"nodepool\",\"namespace\":\"karpenter\"'),
}));
});

Expand Down Expand Up @@ -202,4 +202,4 @@ describe('Karpenter Versions', () => {
}),
);
});
});
});
20 changes: 20 additions & 0 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c7f220d

Please sign in to comment.