aws-samples / eks-cluster-upgrade

Automated Amazon EKS cluster upgrade
MIT No Attribution
154 stars 35 forks source link

Bug: Upgrade failing with Invalid format specifier on nodegroup updates #49

Closed quixoticmonk closed 1 year ago

quixoticmonk commented 1 year ago

Expected Behaviour

eksupgrade would complete the pre-flight checks and complete the upgrade. Currently running the eksupgrade from sitepackages to avoid my local issue#48

Current Behaviour

The upgrade path fails on

INFO:eksupgrade.starter:The Image Type Detected = Amazon Linux 2
ERROR:eksupgrade.starter:Exception encountered in main method - Error: Invalid format specifier

Code snippet

eksupgrade eksup-cluster 1.22 us-east-1

Possible Solution

No response

Steps to Reproduce

  1. Created a cluster using eksctl eksctl create cluster -f cluster.yaml. Config yaml below
    
    apiVersion: eksctl.io/v1alpha5
    kind: ClusterConfig

metadata: name: eksup-cluster region: us-east-1 version: "1.21" nodeGroups:

Amazon EKS upgrade version

0.4.0

Python runtime version

3.9

Packaging format used

PyPi

Debugging logs

DEBUG:botocore.hooks:Event needs-retry.ec2.DescribeImages: calling handler <botocore.retryhandler.RetryHandler object at 0x1051279d0>
DEBUG:botocore.retryhandler:No retry needed.
INFO:eksupgrade.starter:The Image Type Detected = Amazon Linux 2
DEBUG:botocore.hooks:Event choose-service-name: calling handler <function handle_service_name_alias at 0x102aee4c0>
DEBUG:botocore.loaders:Loading JSON file: /Users/***/.pyenv/versions/3.9.10/lib/python3.9/site-packages/botocore/data/ssm/2014-11-06/service-2.json.gz
DEBUG:botocore.loaders:Loading JSON file: /Users/***/.pyenv/versions/3.9.10/lib/python3.9/site-packages/botocore/data/ssm/2014-11-06/endpoint-rule-set-1.json.gz
DEBUG:botocore.hooks:Event creating-client-class.ssm: calling handler <function add_generate_presigned_url at 0x102a47550>
DEBUG:botocore.endpoint:Setting ssm timeout as (60, 60)
DEBUG:botocore.client:Registering retry handlers for service: ssm
DEBUG:botocore.hooks:Event choose-service-name: calling handler <function handle_service_name_alias at 0x102aee4c0>
DEBUG:botocore.hooks:Event creating-client-class.ec2: calling handler <function add_generate_presigned_url at 0x102a47550>
DEBUG:botocore.endpoint:Setting ec2 timeout as (60, 60)
DEBUG:botocore.client:Registering retry handlers for service: ec2
ERROR:eksupgrade.starter:Exception encountered in main method - Error: Invalid format specifier
quixoticmonk commented 1 year ago

The format issue is on latest_ami.py.

names = [f"/aws/service/eks/optimized-ami/{cluster_version: str}/amazon-linux-2/recommended/image_id"]