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

Add update_bundle script to get latest version and update input bundle for staging and prod #1175

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

jhaanvi5
Copy link
Member

@jhaanvi5 jhaanvi5 commented Nov 7, 2024

Description of changes:

This PR introduces a new update_bundles.sh script that automates the process of updating input bundle files for both staging and production bundles for packages release. The script fetches the latest versions of packages from ECR and updates the corresponding YAML files for Kubernetes versions. This addition will streamline our bundle update workflow during packages release and reduce manual errors.

Testing

Tested script for both staging and prod bundles.
sh update_bundles.sh -e staging

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot eks-distro-bot added approved size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 7, 2024
@jhaanvi5 jhaanvi5 changed the title Add update_bundle script to get latest version and update input bundle for staging and prod [WIP] Add update_bundle script to get latest version and update input bundle for staging and prod Nov 7, 2024
@jhaanvi5 jhaanvi5 changed the title [WIP] Add update_bundle script to get latest version and update input bundle for staging and prod Add update_bundle script to get latest version and update input bundle for staging and prod Nov 7, 2024
Copy link
Member

@vivek-koppuru vivek-koppuru left a comment

Choose a reason for hiding this comment

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

Could be worth thinking about writing this in Go

check_requirements

# Generate bundle files for Kubernetes versions 1.27 to 1.31 for given environment
for version in {27..31}; do
Copy link
Member

Choose a reason for hiding this comment

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

We should ideally get this from a config file or from folder structure instead of hardcoded

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated, getting latest supported release from here

Comment on lines 35 to 51
if [ "$repo" = "cluster-autoscaler/charts/cluster-autoscaler" ]; then
output=$(echo $json_output | jq -r --arg kv "1.$k8s_version" '
.imageDetails
| map(select(.imageTags | length > 0))
| map(select(.imageTags | map(test($kv)) | any))
| sort_by(.imagePushedAt)
| last
| .imageTags')
# For metrics-server filter tag based on k8s version (1-28,1-29,etc)
elif [ "$repo" = "metrics-server/charts/metrics-server" ]; then
output=$(echo $json_output | jq -r --arg kv "1-$k8s_version" '
.imageDetails
| map(select(.imageTags | length > 0))
| map(select(.imageTags | map(test($kv)) | any))
| sort_by(.imagePushedAt)
| last
| .imageTags')
Copy link
Member

Choose a reason for hiding this comment

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

We can optimize this to not have this repeated code right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

@jhaanvi5
Copy link
Member Author

Could be worth thinking about writing this in Go

yeah, in the next step - we can create the release PRs through bot, and can merge those during the release so that will be handled in Go.

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhaanvi5, vivek-koppuru

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vivek-koppuru
Copy link
Member

/lgtm

@eks-distro-bot eks-distro-bot merged commit 11a71d0 into aws:main Dec 4, 2024
6 checks passed
jhaanvi5 added a commit to jhaanvi5/eks-anywhere-packages that referenced this pull request Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants