Skip to content
Snippets Groups Projects
Commit dce706bf authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Do not require a manifest for container repository

Container repository can be empty - no tags or blogs is OK.
parent d6f37a34
No related branches found
No related tags found
1 merge request!10109Multi-level container registry images
Pipeline #
class ContainerRepository < ActiveRecord::Base class ContainerRepository < ActiveRecord::Base
belongs_to :project belongs_to :project
   
validates :manifest, presence: true
validates :name, length: { minimum: 0, allow_nil: false } validates :name, length: { minimum: 0, allow_nil: false }
   
delegate :client, to: :registry delegate :client, to: :registry
Loading
@@ -43,6 +42,8 @@ class ContainerRepository < ActiveRecord::Base
Loading
@@ -43,6 +42,8 @@ class ContainerRepository < ActiveRecord::Base
ContainerRegistry::Blob.new(self, config) ContainerRegistry::Blob.new(self, config)
end end
   
# TODO, add bang to this method
#
def delete_tags def delete_tags
return unless tags return unless tags
   
Loading
@@ -52,6 +53,14 @@ class ContainerRepository < ActiveRecord::Base
Loading
@@ -52,6 +53,14 @@ class ContainerRepository < ActiveRecord::Base
end end
end end
   
# TODO, specs needed
#
def empty?
tags.none?
end
# TODO, we will return a new ContainerRepository object here
#
def self.project_from_path(repository_path) def self.project_from_path(repository_path)
return unless repository_path.include?('/') return unless repository_path.include?('/')
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment