jkube
jkube copied to clipboard
When k8s:push identifies a push to ECR, JKube should allow autocreating repo using aws-sdk if the repository does not exist
Component
Kubernetes Maven Plugin
Is your enhancement related to a problem? Please describe
ECR requires precreation of repositories in order for jkube being able to push images
Describe the solution you'd like
Since the repo information is configured at pom.xml/jkube level (with image name etc..), on a multi-project pipeline, and provided JKube can identify and connect to ECR repositories using aws-sdk specific code, I think there should be an optional flag to request auocreation of repository if the remote repo is not created
Describe alternatives you've considered
Having to parse project's pom.xml jkube metadata in order to infer the future repository name and later on attempt to create it from the pipeline script
Additional context
No response
I think there should be an optional flag to request autocreation of repository if the remote repo is not created
How is this flag supposed to work?
Is it performing some sort of HTTP request to ECR? Is there some client util that performs that for you?
Yes. in aws cli you can do something like "aws ecr create-repository --repository-name ${repositoryImage} --region ${awsRegion} --image-scanning-configuration scanOnPush=true" so I imagine aws-sdk will have some kind of equivalent.
I know JKube understands "aws sdk", indeed, I guess it uses aws ecr get-login-password somehow already, since even if I don't pass -Djkube.docker.password and i am not docker login'd on my local environment, JKube manages to perform the docker push on ECR