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

feat: implement aws-eks-addon datasource #29613

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jzhn
Copy link

@jzhn jzhn commented Jun 12, 2024

Changes

Add a new datasource, aws-eks-addon. It uses similar design as existing aws-machine-image and aws-rds to use AWS JavaScript SDK to call APIs to fetch AWS EKS addon versions.

Context

AWS EKS Addons are Kubernetes data-plane components under EKS's management, like kube-proxy and coredns. The addons are usually semver versioned, and released regularly for new features and security patches. AWS EKS provides API DescribeAddonVersions to allow users to query available addon versions per target Kubernetes version.

As platform engineer, I often need to ensure my EKS clusters are running with up-to-date addons. Before this PR, renovate is unable to fetch list of available EKS addon versions that's specific to my cluster version and region. This is a popular ask of renovate users.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository
    • 100% unit test coverage
    • tested end-to-end in my self-hosted setup with a terraform project
image image

@jzhn jzhn force-pushed the feat/23410_aws-eks-addon-support branch from 078e8b3 to 56f34f9 Compare June 12, 2024 04:38
@jzhn jzhn force-pushed the feat/23410_aws-eks-addon-support branch from 56f34f9 to c6a5e2d Compare June 12, 2024 05:54
@jzhn
Copy link
Author

jzhn commented Jun 13, 2024

@viceice : can you please take another look? I've addressed your comment and all checks are green. thank you :)

@rarkins rarkins requested a review from viceice June 14, 2024 05:42
lib/modules/datasource/aws-eks-addon/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.spec.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.ts Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.ts Outdated Show resolved Hide resolved
@jzhn jzhn requested a review from viceice June 16, 2024 01:23
lib/modules/datasource/aws-eks-addon/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.ts Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.ts Outdated Show resolved Hide resolved
@jzhn jzhn requested a review from viceice June 19, 2024 05:33
@jzhn
Copy link
Author

jzhn commented Jun 19, 2024

@viceice : apologies for the code smells and anti patterns as typescript isn't my daily language. I did try my best to understand and address your comments, hopefully the latest revision looks better to you. cheers.

@jzhn
Copy link
Author

jzhn commented Jun 27, 2024

Hi @viceice , it's been a week since I addressed your feedbacks. Can you please take another look or let me know what's preventing another review? Thanks.

cc @rarkins

@rarkins
Copy link
Collaborator

rarkins commented Aug 21, 2024

@jzhn please see the code review comment above when you get the time

@ahoehma

This comment has been minimized.

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

use the re-request review button when done

lib/modules/datasource/aws-eks-addon/schema.ts Outdated Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/schema.ts Outdated Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/aws-eks-addon/index.ts Outdated Show resolved Hide resolved
@lmayorga1980
Copy link

lmayorga1980 commented Oct 22, 2024

I am interested in using this datasource for eks but currently is not compiling. It seems like in this line export EksAddonsFilterJson = Json.pipe(EksAddonsFilterSchema); is breaking the build. Also is the EksAddonsFilterSchema should be used as the input for getEKSClient? Comparing to amazon-machine-image perhaps those should be 2 different schemas?

@jvdadda
Copy link

jvdadda commented Nov 27, 2024

Nice work @jzhn , do you think it is possible to update the PRs with last main ? And re-request a review ? Thanks a lot

});

export type EksAddonsFilter = z.infer<typeof EKSAddonsFilterSchema>;
export EksAddonsFilterJson = Json.pipe(EksAddonsFilterSchema);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export EksAddonsFilterJson = Json.pipe(EksAddonsFilterSchema);
export const EksAddonsFilter = Json.pipe(EksAddonsFilterSchema);

Json needs to be imported from our schema utils.

import { cache } from '../../../util/cache/package/decorator';
import { Datasource } from '../datasource';
import type { GetReleasesConfig, ReleaseResult } from '../types';
import { EksAddonsFilterJson } from './schema';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import { EksAddonsFilterJson } from './schema';
import { EksAddonsFilter } from './schema';

async getReleases({
packageName: serializedFilter,
}: GetReleasesConfig): Promise<ReleaseResult | null> {
const filter = EksAddonsFilterJson.safeParse(serializedFilter);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const filter = EksAddonsFilterJson.safeParse(serializedFilter);
const filter = EksAddonsFilter.safeParse(serializedFilter);

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.

6 participants