From 8968e82675b661ee186a2b25e7f669624214e8d8 Mon Sep 17 00:00:00 2001 From: cd1989 Date: Wed, 3 Apr 2019 19:47:14 +0800 Subject: [PATCH] Allow edit registry description Signed-off-by: cd1989 --- docs/swagger.yaml | 3 +++ src/core/api/models/registry.go | 1 + src/core/api/registry.go | 3 +++ 3 files changed, 7 insertions(+) diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 907164078..8f7503ebb 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -4272,6 +4272,9 @@ definitions: name: type: string description: The registry name. + description: + type: string + description: Description of the registry. url: type: string description: The registry address URL string. diff --git a/src/core/api/models/registry.go b/src/core/api/models/registry.go index 4ee4e851a..09b12eb08 100644 --- a/src/core/api/models/registry.go +++ b/src/core/api/models/registry.go @@ -3,6 +3,7 @@ package models // RegistryUpdateRequest is request used to update a registry. type RegistryUpdateRequest struct { Name *string `json:"name"` + Description *string `json:"description"` URL *string `json:"url"` CredentialType *string `json:"credential_type"` AccessKey *string `json:"access_key"` diff --git a/src/core/api/registry.go b/src/core/api/registry.go index 5def7fa92..f221ccb7f 100644 --- a/src/core/api/registry.go +++ b/src/core/api/registry.go @@ -135,6 +135,9 @@ func (t *RegistryAPI) Put() { if req.Name != nil { registry.Name = *req.Name } + if req.Description != nil { + registry.Description = *req.Description + } if req.URL != nil { registry.URL = *req.URL }