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

Generated ECR Repository API & Controller #409

Closed
wants to merge 4 commits into from

Conversation

muvaf
Copy link
Member

@muvaf muvaf commented Oct 30, 2020

Description of your changes

This PR serves as demonstration of how much code we are able to generate using ACK currently.

Generated by aws-controllers-k8s/community#449
Depends on #401

Fixes #448

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Tested creation and deletion manually.

…es necessary authorization methods that use v1 SDK.

Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
…splane command

Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
@AaronME
Copy link
Collaborator

AaronME commented May 26, 2021

@muvaf taking a look at this

Comment on lines +56 to +61
cfg, err := awsclient.GetConfigV1(ctx, c.kube, mg, cr.Spec.ForProvider.Region)
if err != nil {
return nil, err
}
sess, err := session.NewSession(cfg)
return &external{client: svcapi.New(sess), kube: c.kube}, errors.Wrap(err, errCreateSession)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Based on https://aws.github.io/aws-sdk-go-v2/docs/migrating/ we can replace v1 session.NewSession with v2 NewFromConfig

Suggested change
cfg, err := awsclient.GetConfigV1(ctx, c.kube, mg, cr.Spec.ForProvider.Region)
if err != nil {
return nil, err
}
sess, err := session.NewSession(cfg)
return &external{client: svcapi.New(sess), kube: c.kube}, errors.Wrap(err, errCreateSession)
cfg, err := awsclient.GetConfig(ctx, c.kube, mg, cr.Spec.ForProvider.Region)
if err != nil {
return nil, err
}
return &external{client: svcapi.NewFromConfig(cfg), kube: c.kube}, errors.Wrap(err, errCreateSession)

@muvaf muvaf closed this Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate ECR services using ACK
2 participants