-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Add "kops get assets" command #11617
Conversation
6d66218
to
bd5a8c0
Compare
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.
Small suggestion, maybe skip the mirror
field when not needed.
Also, would be nice to move this to klog.V(1).Info()
:
I0529 08:59:26.979910 39040 dns.go:97] Private DNS: skipping DNS validation
cmd/kops/get_assets.go
Outdated
Mirror: containerAsset.DockerImage, | ||
} |
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.
Mirror: containerAsset.DockerImage, | |
} | |
} | |
if containerAsset.DockerImage != containerAsset.CanonicalLocation { | |
image.Mirror = containerAsset.DockerImage | |
} |
cmd/kops/get_assets.go
Outdated
Mirror: fileAsset.DownloadURL.String(), | ||
SHA: fileAsset.SHAValue, | ||
} |
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.
Mirror: fileAsset.DownloadURL.String(), | |
SHA: fileAsset.SHAValue, | |
} | |
SHA: fileAsset.SHAValue, | |
} | |
if fileAsset.DownloadURL.String() != fileAsset.CanonicalURL.String() { | |
file.Mirror = fileAsset.DownloadURL.String() | |
} |
cmd/kops/get_assets.go
Outdated
|
||
type Image struct { | ||
Image string `json:"image"` | ||
Mirror string `json:"mirror"` |
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.
Mirror string `json:"mirror"` | |
Mirror string `json:"mirror,omitempty"` |
cmd/kops/get_assets.go
Outdated
|
||
type File struct { | ||
File string `json:"file"` | ||
Mirror string `json:"mirror"` |
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.
Mirror string `json:"mirror"` | |
Mirror string `json:"mirror,omitempty"` |
I support suppressing chatter like that DNS log line, though I think that's perhaps a different PR. On the mirror field, I'm a little wary of requiring consumers of that data to implement special cases for edge cases like this. I could see a desire for less information when downloading from the canonical location, but then I don't see any use cases for this command in that situation. |
I understood perfectly the terminology, no worries. Though the name of the field "mirror" is misleading. This reminds me of the mirrored assets we already have. |
@hakman the concern wasn't about understanding, but with which terminology was appropriate for the feature. I've changed it to be more consistent and accurate about what the values are. |
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.
Agreed. Thanks!
Feel free to cherry-pick to any release.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hakman 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 |
It's a bit late to add features to 1.21. |
This is rough around the edges, but gives the idea.