Skip to content

Commit

Permalink
chore(eks): remove whitespace and stylistic updates (#22674)
Browse files Browse the repository at this point in the history
Somehow eks (and maybe more modules) was immune to my prior attack on unnecessary whitespace. Also some stylistic changes to readmes and some commas here and there. No actual code changes.

----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
kaizencc authored Oct 27, 2022
1 parent 4e858f2 commit 0cbdf58
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 236 deletions.
7 changes: 5 additions & 2 deletions packages/@aws-cdk/aws-eks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,11 @@ The kubectl handler uses `kubectl`, `helm` and the `aws` CLI in order to
interact with the cluster. These are bundled into AWS Lambda layers included in
the `@aws-cdk/lambda-layer-awscli` and `@aws-cdk/lambda-layer-kubectl` modules.

The version of kubectl used must be compatible wtih the Kubernetes version of the cluster. kubectl is supported within one minor version (older or newer) of Kubernetes (see [Kubernetes version skew policy](https://kubernetes.io/releases/version-skew-policy/#kubectl)). Only version 1.20 of kubectl is available in `aws-cdk-lib`. If you need a different version, you will need to use one of the `@aws-cdk/lambda-layer-kubectlvXY` packages.
The version of kubectl used must be compatible with the Kubernetes version of the
cluster. kubectl is supported within one minor version (older or newer) of Kubernetes
(see [Kubernetes version skew policy](https://kubernetes.io/releases/version-skew-policy/#kubectl)).
Only version 1.20 of kubectl is available in `aws-cdk-lib`. If you need a different
version, you will need to use one of the `@aws-cdk/lambda-layer-kubectlvXY` packages.

```ts
import { KubectlV22Layer } from '@aws-cdk/lambda-layer-kubectl-v22';
Expand All @@ -685,7 +689,6 @@ const cluster = new eks.Cluster(this, 'hello-eks', {
version: eks.KubernetesVersion.V1_22,
kubectlLayer: new KubectlV22Layer(this, 'kubectl'),
});

```

You can also specify a custom `lambda.LayerVersion` if you wish to use a
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-eks/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ export enum CoreDnsComputeType {
/**
* Deploy CoreDNS on Fargate-managed instances.
*/
FARGATE = 'fargate'
FARGATE = 'fargate',
}

/**
Expand All @@ -2325,7 +2325,7 @@ export enum DefaultCapacityType {
/**
* EC2 autoscaling group
*/
EC2
EC2,
}

/**
Expand All @@ -2339,7 +2339,7 @@ export enum MachineImageType {
/**
* Bottlerocket AMI
*/
BOTTLEROCKET
BOTTLEROCKET,
}

function nodeTypeForInstanceType(instanceType: ec2.InstanceType) {
Expand Down
6 changes: 0 additions & 6 deletions packages/@aws-cdk/aws-eks/test/alb-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Cluster, KubernetesVersion, AlbController, AlbControllerVersion, HelmCh
import { testFixture } from './util';

test('all vended policies are valid', () => {

const addOnsDir = path.join(__dirname, '..', 'lib', 'addons');

for (const addOn of fs.readdirSync(addOnsDir)) {
Expand All @@ -23,11 +22,9 @@ test('all vended policies are valid', () => {
}
}
}

});

test('can configure a custom repository', () => {

const { stack } = testFixture();

const cluster = new Cluster(stack, 'Cluster', {
Expand Down Expand Up @@ -58,11 +55,9 @@ test('can configure a custom repository', () => {
],
},
});

});

test('throws when a policy is not defined for a custom version', () => {

const { stack } = testFixture();

const cluster = new Cluster(stack, 'Cluster', {
Expand All @@ -73,5 +68,4 @@ test('throws when a policy is not defined for a custom version', () => {
cluster,
version: AlbControllerVersion.of('custom'),
})).toThrowError("'albControllerOptions.policy' is required when using a custom controller version");

});
15 changes: 1 addition & 14 deletions packages/@aws-cdk/aws-eks/test/awsauth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import { testFixtureNoVpc } from './util';
const CLUSTER_VERSION = KubernetesVersion.V1_16;

describe('aws auth', () => {

test('throws when adding a role from a different stack', () => {

const app = new cdk.App();
const clusterStack = new cdk.Stack(app, 'ClusterStack');
const roleStack = new cdk.Stack(app, 'RoleStack');
Expand All @@ -26,12 +24,9 @@ describe('aws auth', () => {
}).toThrow(
'RoleStack/Role should be defined in the scope of the ClusterStack stack to prevent circular dependencies',
);


});

test('throws when adding a user from a different stack', () => {

const app = new cdk.App();
const clusterStack = new cdk.Stack(app, 'ClusterStack');
const userStack = new cdk.Stack(app, 'UserStack');
Expand All @@ -45,8 +40,6 @@ describe('aws auth', () => {
}).toThrow(
'UserStack/User should be defined in the scope of the ClusterStack stack to prevent circular dependencies',
);


});

test('empty aws-auth', () => {
Expand All @@ -66,7 +59,6 @@ describe('aws auth', () => {
data: { mapRoles: '[]', mapUsers: '[]', mapAccounts: '[]' },
}]),
});

});

test('addRoleMapping and addUserMapping can be used to define the aws-auth ConfigMap', () => {
Expand Down Expand Up @@ -159,8 +151,6 @@ describe('aws auth', () => {
],
},
});


});

test('imported users and roles can be also be used', () => {
Expand Down Expand Up @@ -222,9 +212,8 @@ describe('aws auth', () => {
],
},
});


});

test('addMastersRole after addNodegroup correctly', () => {
// GIVEN
const { stack } = testFixtureNoVpc();
Expand Down Expand Up @@ -283,7 +272,5 @@ describe('aws auth', () => {
],
},
});


});
});
Loading

0 comments on commit 0cbdf58

Please sign in to comment.