mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
feat(climc): add public/private command for k8s-container-registry (#21228)
This commit is contained in:
@@ -37,6 +37,8 @@ func initContainerRegistry() {
|
||||
cmd.Create(new(o.RegistryCreateOptions))
|
||||
cmd.Get("images", new(o.RegistryGetImagesOptions))
|
||||
cmd.Get("image-tags", new(o.RegistryGetImageTagsOptions))
|
||||
cmd.BatchPerform("public", new(o.RegistryPublicOptions))
|
||||
cmd.Perform("private", new(o.RegistryGetOptions))
|
||||
|
||||
type UploadOptions struct {
|
||||
REGISTRY string `help:"The name or id of registry" json:"-"`
|
||||
|
||||
@@ -91,3 +91,18 @@ func (o RegistryGetImageTagsOptions) Params() (jsonutils.JSONObject, error) {
|
||||
"repository": o.REPOSITORY,
|
||||
}), nil
|
||||
}
|
||||
|
||||
type RegistryPublicOptions struct {
|
||||
ID []string `help:"ID or name of image" json:"-"`
|
||||
Scope string `help:"sharing scope" choices:"system|domain|project" json:"scope"`
|
||||
SharedProjects []string `help:"Share to projects" json:"shared_projects"`
|
||||
SharedDomains []string `help:"Share to domains" json:"shared_domains"`
|
||||
}
|
||||
|
||||
func (o RegistryPublicOptions) Params() (jsonutils.JSONObject, error) {
|
||||
return jsonutils.Marshal(o), nil
|
||||
}
|
||||
|
||||
func (o RegistryPublicOptions) GetIds() []string {
|
||||
return o.ID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user