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 ecsclient #27

Merged
merged 1 commit into from
Sep 29, 2024
Merged

Conversation

helen-frank
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Implement ecsclient

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Copy link

gitautomator bot commented Sep 27, 2024

Thanks to your contribution, the maintainers will review it as soon as they can!

@helen-frank
Copy link
Contributor Author

/cc @jwcesign @daimaxiaxie @IrisIris

Please take a look

pkg/operator/operator.go Outdated Show resolved Hide resolved
pkg/operator/operator.go Outdated Show resolved Hide resolved
pkg/utils/region/region.go Outdated Show resolved Hide resolved
@helen-frank
Copy link
Contributor Author

helen-frank commented Sep 27, 2024

After a phone call with @jwcesign, we decided to use aliyuncli to create RAM Sub-account, get its ak, sk, region profiles, and use secret to store them, which will be used by karpenter to create ecsclient.

/cc @daimaxiaxie @IrisIris

@helen-frank helen-frank changed the title feat: Implement ecsclient [WIP] feat: Implement ecsclient Sep 27, 2024
@helen-frank helen-frank self-assigned this Sep 27, 2024
@helen-frank
Copy link
Contributor Author

The current implementation provides access based on the currently provided authentication information, and subsequent implementations can be tracked: #29

/cc @jwcesign @daimaxiaxie @IrisIris
Please take a look

Test Step:

  • aliyun configure set --profile AkProfile --mode AK --access-key-id xxx --access-key-secret xxx --region xxx
  • add test code:
func TestNewECSClient(t *testing.T) {
    client, err := NewECSClient()
    if err != nil {
        t.Errorf("Failed to create ECS client: %v", err)
    }

    describeZonesRequest := &ecsclient.DescribeZonesRequest{
        RegionId: client.RegionId,
    }
    runtime := &util.RuntimeOptions{}

    if _, err := client.DescribeZonesWithOptions(describeZonesRequest, runtime); err != nil {
        t.Error(err)
    }
}

@helen-frank helen-frank changed the title [WIP] feat: Implement ecsclient feat: Implement ecsclient Sep 29, 2024
Copy link
Contributor

@jwcesign jwcesign left a comment

Choose a reason for hiding this comment

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

/lgtm

cc @daimaxiaxie @IrisIris for final check

@daimaxiaxie
Copy link
Contributor

/lgtm

@helen-frank helen-frank merged commit 0d7d12c into cloudpilot-ai:main Sep 29, 2024
1 check passed
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.

3 participants