mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
feat(registry): Add ProGet registry type EE-703 (#5196)
* intermediate commit * feat(registry): backport ProGet registry to CE (#954) * backport EE changes * label updates and remove auth-toggle Co-authored-by: Dennis Buduev <dennis.buduev@portainer.io>
This commit is contained in:
parent
8b80eb1731
commit
90a472c08b
14 changed files with 405 additions and 36 deletions
|
@ -12,18 +12,14 @@ import (
|
|||
)
|
||||
|
||||
type registryUpdatePayload struct {
|
||||
// Name that will be used to identify this registry
|
||||
Name *string `validate:"required" example:"my-registry"`
|
||||
// URL or IP address of the Docker registry
|
||||
URL *string `validate:"required" example:"registry.mydomain.tld:2375"`
|
||||
// Is authentication against this registry enabled
|
||||
Authentication *bool `example:"false" validate:"required"`
|
||||
// Username used to authenticate against this registry. Required when Authentication is true
|
||||
Username *string `example:"registry_user"`
|
||||
// Password used to authenticate against this registry. required when Authentication is true
|
||||
Password *string `example:"registry_password"`
|
||||
UserAccessPolicies portainer.UserAccessPolicies
|
||||
TeamAccessPolicies portainer.TeamAccessPolicies
|
||||
Name *string `json:",omitempty" example:"my-registry" validate:"required"`
|
||||
URL *string `json:",omitempty" example:"registry.mydomain.tld:2375/feed" validate:"required"`
|
||||
BaseURL *string `json:",omitempty" example:"registry.mydomain.tld:2375"`
|
||||
Authentication *bool `json:",omitempty" example:"false" validate:"required"`
|
||||
Username *string `json:",omitempty" example:"registry_user"`
|
||||
Password *string `json:",omitempty" example:"registry_password"`
|
||||
UserAccessPolicies portainer.UserAccessPolicies `json:",omitempty"`
|
||||
TeamAccessPolicies portainer.TeamAccessPolicies `json:",omitempty"`
|
||||
Quay *portainer.QuayRegistryData
|
||||
}
|
||||
|
||||
|
@ -84,6 +80,10 @@ func (handler *Handler) registryUpdate(w http.ResponseWriter, r *http.Request) *
|
|||
registry.URL = *payload.URL
|
||||
}
|
||||
|
||||
if registry.Type == portainer.ProGetRegistry && payload.BaseURL != nil {
|
||||
registry.BaseURL = *payload.BaseURL
|
||||
}
|
||||
|
||||
if payload.Authentication != nil {
|
||||
if *payload.Authentication {
|
||||
registry.Authentication = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue