-
Notifications
You must be signed in to change notification settings - Fork 808
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
Refactor pkg/cloud/metadata.go into pkg/cloud/metadata_*.go files #1074
Conversation
[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 |
78721e3
to
1d5b5f1
Compare
"k8s.io/client-go/rest" | ||
) | ||
|
||
type KubernetesAPIClient func() (kubernetes.Interface, error) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
/lgtm |
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