-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Improve our Instance Metadata coverage in Azure. #49237
Conversation
@@ -821,6 +821,13 @@ func TestSplitProviderID(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestMetadataURLGeneration(t *testing.T) { | |||
fullPath := MakeMetadataURL("some/path") | |||
if fullPath != "http://169.254.169.254/metadata/some/path" { |
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.
Can we use constant metaURL here to check the full path so that it will not break the test if the const is changed?
/lgtm but you're failing a go-lint test |
@@ -61,28 +54,43 @@ type Subnet struct { | |||
Prefix string `json:"prefix"` | |||
} | |||
|
|||
type InstanceMetadata struct { |
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: comment describing exportable struct
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.
done.
baseURL string | ||
} | ||
|
||
func NewInstanceMetadata() *InstanceMetadata { |
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.
ditto
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.
done.
if err != nil { | ||
return "", err | ||
} | ||
return string(data), err | ||
} | ||
|
||
func queryMetadataBytes(path, format string) ([]byte, error) { | ||
func (i *InstanceMetadata) queryMetadataBytes(path, format string) ([]byte, 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.
One more comment nit, just to be consistent (cf: the // makeMetadataURL
comment)
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.
Not sure what you are asking for here... Can you clarify? Thanks.
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.
Sorry, just requesting a simple method comment.
// QueryMetadataJSON queries the metadata server and populates the passed in object | ||
func QueryMetadataJSON(path string, obj interface{}) error { | ||
data, err := queryMetadataBytes(path, "json") | ||
func (i *InstanceMetadata) QueryMetadataJSON(path string, obj 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.
It'd be nice to incorporate into the name of this method the idea that it mutates the passed in object interface. QueryMetadataJSONUnmarshall
? (ugh)
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.
or UnmarshalMetadataJSON
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.
done.
recommend that we withdraw PR #49081 and use this one instead |
Comments mostly addressed, one that I'm not sure what the request is... |
/lgtm |
@jackfrancis: changing LGTM is restricted to assignees, and only kubernetes org members may be assigned issues. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: brendandburns, colemickens, jackfrancis No associated issue. Update pull-request body to add a reference to an issue, or get approval with The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@jdumars @jackfrancis can you propose membership for yourself in the kubernetes org? |
/test pull-kubernetes-e2e-gce-etcd3 |
(self lgtm/approve given lgtm from @jackfrancis above) |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
/sig azure |
@brendandburns can you take a look at this PR? |
@jdumars fixed, I don't know what happened there. |
/test pull-kubernetes-e2e-kops-aws |
/test pull-kubernetes-e2e-kops-aws |
2 similar comments
/test pull-kubernetes-e2e-kops-aws |
/test pull-kubernetes-e2e-kops-aws |
/test pull-kubernetes-e2e-kops-aws |
/test pull-kubernetes-e2e-kops-aws |
self lgtm since this was only a rebase. |
/test all [submit-queue is verifying that this PR is safe to merge] |
@brendandburns: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 49237, 49656, 49980, 49841, 49899) |
No description provided.