1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

feat(registry) EE-806 add support for AWS ECR (#6165)

* feat(ecr) EE-806 add support for aws ecr

* feat(ecr) EE-806 fix wrong doc for Ecr Region

Co-authored-by: Simon Meng <simon.meng@portainer.io>
This commit is contained in:
cong meng 2021-12-01 13:18:57 +13:00 committed by GitHub
parent ff6185cc81
commit a86c7046df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 694 additions and 51 deletions

View file

@ -155,8 +155,8 @@ type (
ImageCount int `json:"ImageCount"`
ServiceCount int `json:"ServiceCount"`
StackCount int `json:"StackCount"`
NodeCount int `json:"NodeCount"`
SnapshotRaw DockerSnapshotRaw `json:"DockerSnapshotRaw"`
NodeCount int `json:"NodeCount"`
}
// DockerSnapshotRaw represents all the information related to a snapshot as returned by the Docker API
@ -444,6 +444,11 @@ type (
OrganisationName string `json:"OrganisationName"`
}
// EcrData represents data required for ECR registry
EcrData struct {
Region string `json:"Region" example:"ap-southeast-2"`
}
// JobType represents a job type
JobType int
@ -589,8 +594,8 @@ type (
Registry struct {
// Registry Identifier
ID RegistryID `json:"Id" example:"1"`
// Registry Type (1 - Quay, 2 - Azure, 3 - Custom, 4 - Gitlab, 5 - ProGet, 6 - DockerHub)
Type RegistryType `json:"Type" enums:"1,2,3,4,5,6"`
// Registry Type (1 - Quay, 2 - Azure, 3 - Custom, 4 - Gitlab, 5 - ProGet, 6 - DockerHub, 7 - ECR)
Type RegistryType `json:"Type" enums:"1,2,3,4,5,6,7"`
// Registry Name
Name string `json:"Name" example:"my-registry"`
// URL or IP address of the Docker registry
@ -599,13 +604,14 @@ type (
BaseURL string `json:"BaseURL" example:"registry.mydomain.tld:2375"`
// Is authentication against this registry enabled
Authentication bool `json:"Authentication" example:"true"`
// Username used to authenticate against this registry
// Username or AccessKeyID used to authenticate against this registry
Username string `json:"Username" example:"registry user"`
// Password used to authenticate against this registry
// Password or SecretAccessKey used to authenticate against this registry
Password string `json:"Password,omitempty" example:"registry_password"`
ManagementConfiguration *RegistryManagementConfiguration `json:"ManagementConfiguration"`
Gitlab GitlabRegistryData `json:"Gitlab"`
Quay QuayRegistryData `json:"Quay"`
Ecr EcrData `json:"Ecr"`
RegistryAccesses RegistryAccesses `json:"RegistryAccesses"`
// Deprecated fields
@ -618,6 +624,10 @@ type (
AuthorizedUsers []UserID `json:"AuthorizedUsers"`
// Deprecated in DBVersion == 18
AuthorizedTeams []TeamID `json:"AuthorizedTeams"`
// Stores temporary access token
AccessToken string `json:"AccessToken,omitempty"`
AccessTokenExpiry int64 `json:"AccessTokenExpiry,omitempty"`
}
RegistryAccesses map[EndpointID]RegistryAccessPolicies
@ -634,11 +644,14 @@ type (
// RegistryManagementConfiguration represents a configuration that can be used to query
// the registry API via the registry management extension.
RegistryManagementConfiguration struct {
Type RegistryType `json:"Type"`
Authentication bool `json:"Authentication"`
Username string `json:"Username"`
Password string `json:"Password"`
TLSConfig TLSConfiguration `json:"TLSConfig"`
Type RegistryType `json:"Type"`
Authentication bool `json:"Authentication"`
Username string `json:"Username"`
Password string `json:"Password"`
TLSConfig TLSConfiguration `json:"TLSConfig"`
Ecr EcrData `json:"Ecr"`
AccessToken string `json:"AccessToken,omitempty"`
AccessTokenExpiry int64 `json:"AccessTokenExpiry,omitempty"`
}
// RegistryType represents a type of registry
@ -1714,6 +1727,8 @@ const (
ProGetRegistry
// DockerHubRegistry represents a dockerhub registry
DockerHubRegistry
// EcrRegistry represents an ECR registry
EcrRegistry
)
const (