From 068ec7da72bf8fe5409703349e162cbb367537b5 Mon Sep 17 00:00:00 2001 From: Heidi Berry Date: Sat, 4 May 2024 18:03:24 +0100 Subject: [PATCH 1/2] Add container registry status to response body --- container_registry.go | 1 + types.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/container_registry.go b/container_registry.go index eaf0e3462..bec477df6 100644 --- a/container_registry.go +++ b/container_registry.go @@ -41,6 +41,7 @@ type RegistryRepository struct { Location string `json:"location"` CreatedAt *time.Time `json:"created_at"` CleanupPolicyStartedAt *time.Time `json:"cleanup_policy_started_at"` + Status *ContainerRegistryStatus `json:"status"` TagsCount int `json:"tags_count"` Tags []*RegistryRepositoryTag `json:"tags"` } diff --git a/types.go b/types.go index 50e03ed5d..0ebc14401 100644 --- a/types.go +++ b/types.go @@ -256,6 +256,22 @@ func BuildState(v BuildStateValue) *BuildStateValue { return Ptr(v) } +// ContainerRegistryStatus represents the status of a Container Registry +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/container_registry.html#list-registry-repositories +type ContainerRegistryStatus string + +// ContainerRegistryStatus represents all valid statuses of a Container Registry +// +// Undocumented, see code at: +// https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/container_repository.rb?ref_type=heads#L35 +const ( + ContainerRegistryStatusDeleteScheduled ContainerRegistryStatus = "delete_scheduled" + ContainerRegistryStatusDeleteFailed ContainerRegistryStatus = "delete_failed" + ContainerRegistryStatusDeleteOngoing ContainerRegistryStatus = "delete_ongoing" +) + // DeploymentApprovalStatus represents a Gitlab deployment approval status. type DeploymentApprovalStatus string From ffe1971e69bc7c426691783015d1e32a448a290b Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Sun, 5 May 2024 11:42:58 +0200 Subject: [PATCH 2/2] Minor tweaks --- types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types.go b/types.go index 0ebc14401..69b8e8ee5 100644 --- a/types.go +++ b/types.go @@ -256,13 +256,13 @@ func BuildState(v BuildStateValue) *BuildStateValue { return Ptr(v) } -// ContainerRegistryStatus represents the status of a Container Registry +// ContainerRegistryStatus represents the status of a Container Registry. // // GitLab API docs: // https://docs.gitlab.com/ee/api/container_registry.html#list-registry-repositories type ContainerRegistryStatus string -// ContainerRegistryStatus represents all valid statuses of a Container Registry +// ContainerRegistryStatus represents all valid statuses of a Container Registry. // // Undocumented, see code at: // https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/container_repository.rb?ref_type=heads#L35