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

Refactor pkg/cloud/metadata.go into pkg/cloud/metadata_*.go files #1074

Merged
merged 2 commits into from
Sep 30, 2021

Conversation

wongma7
Copy link
Contributor

@wongma7 wongma7 commented Sep 29, 2021

Is this a bug fix or adding new feature? refactor

What is this PR about? / Why do we need it? I am planning to consume or copy pkg/cloud/metadata_* code from here to the EFS repo so I wanted to split up metadata.go and cloud_interface.go to make it easier. this is justa refactor for readability and easier consumption it should have no consequences on functionality

What testing is done? make mockgen succeeded, will let CI test the rest

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 29, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wongma7

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 29, 2021
@wongma7 wongma7 force-pushed the metadatarefactorround2 branch from 78721e3 to 1d5b5f1 Compare September 29, 2021 20:45
"k8s.io/client-go/rest"
)

type KubernetesAPIClient func() (kubernetes.Interface, error)
Copy link

@nckturner nckturner Sep 30, 2021

Choose a reason for hiding this comment

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

nit: What's the reason for the metadata_ prefix for all files? This seems to just be a Kubernetes client wrapper, maybe client.go or kubernetes.go makes more sense.

Choose a reason for hiding this comment

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

Otherwise lgtm, will merge if you prefer that name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the main purpose is for KubernetesAPIInstanceInfo to return a Metadata, i.e. how to retrieve Metadata/InstanceInfo from k8s versus from ec2. (and later, one to retieve from ECS for fargate environment). the function you are looking at is just wrapper stuff for testing, KubernetesAPIInstanceInfo is the important one.

Choose a reason for hiding this comment

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

Yeah that makes sense and I see the reasoning for the similar file names, especially given they all are different mechanisms for finding the same information.

@nckturner
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 30, 2021
@k8s-ci-robot k8s-ci-robot merged commit aefaa90 into kubernetes-sigs:master Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants