Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
2f1cb7ce
Commit
2f1cb7ce
authored
May 18, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve code design
parent
24145592
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
app/controllers/projects/container_registry_controller.rb
app/controllers/projects/container_registry_controller.rb
+4
-2
app/models/project.rb
app/models/project.rb
+5
-3
No files found.
app/controllers/projects/container_registry_controller.rb
View file @
2f1cb7ce
...
@@ -8,10 +8,12 @@ class Projects::ContainerRegistryController < Projects::ApplicationController
...
@@ -8,10 +8,12 @@ class Projects::ContainerRegistryController < Projects::ApplicationController
end
end
def
destroy
def
destroy
url
=
namespace_project_container_registry_index_path
(
project
.
namespace
,
project
)
if
tag
.
delete
if
tag
.
delete
redirect_to
namespace_project_container_registry_index_path
(
project
.
namespace
,
project
)
redirect_to
url
else
else
redirect_to
namespace_project_container_registry_index_path
(
project
.
namespace
,
project
)
,
alert:
'Failed to remove tag'
redirect_to
url
,
alert:
'Failed to remove tag'
end
end
end
end
...
...
app/models/project.rb
View file @
2f1cb7ce
...
@@ -331,6 +331,8 @@ class Project < ActiveRecord::Base
...
@@ -331,6 +331,8 @@ class Project < ActiveRecord::Base
end
end
def
container_registry_repository
def
container_registry_repository
return
unless
Gitlab
.
config
.
registry
.
enabled
@container_registry_repository
||=
begin
@container_registry_repository
||=
begin
token
=
Auth
::
ContainerRegistryAuthenticationService
.
full_access_token
(
path_with_namespace
)
token
=
Auth
::
ContainerRegistryAuthenticationService
.
full_access_token
(
path_with_namespace
)
url
=
Gitlab
.
config
.
registry
.
api_url
url
=
Gitlab
.
config
.
registry
.
api_url
...
@@ -347,10 +349,10 @@ class Project < ActiveRecord::Base
...
@@ -347,10 +349,10 @@ class Project < ActiveRecord::Base
end
end
def
has_container_registry_tags?
def
has_container_registry_tags?
if
Gitlab
.
config
.
registry
.
enabled
return
unless
container_registry_repository
container_registry_repository
.
tags
.
any?
container_registry_repository
.
tags
.
any?
end
end
end
def
commit
(
id
=
'HEAD'
)
def
commit
(
id
=
'HEAD'
)
repository
.
commit
(
id
)
repository
.
commit
(
id
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment