summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-11 09:06:38 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-11 09:06:38 +0000
commit4a45f0eff2a25c64bdd83926e35a8894a4f0469f (patch)
tree8068fff1731ccf4182605c2661c25f0a1c936866 /app
parentd9c3a63a4394990bcdccbaca73c58278469236b4 (diff)
downloadgitlab-ce-4a45f0eff2a25c64bdd83926e35a8894a4f0469f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/blob/blob_utils.js4
-rw-r--r--app/services/projects/container_repository/delete_tags_service.rb16
-rw-r--r--app/views/clusters/clusters/user/_header.html.haml2
3 files changed, 15 insertions, 7 deletions
diff --git a/app/assets/javascripts/blob/blob_utils.js b/app/assets/javascripts/blob/blob_utils.js
index cc9c621c679..27fcc7f7b79 100644
--- a/app/assets/javascripts/blob/blob_utils.js
+++ b/app/assets/javascripts/blob/blob_utils.js
@@ -1,5 +1,5 @@
-// capture anything starting with http:// or https:// which is not already part of a html link
+// capture anything starting with http:// or https://
// up until a disallowed character or whitespace
-export const blobLinkRegex = /(?<!<a href=")https?:\/\/[^"<>\\^`{|}\s]+/g;
+export const blobLinkRegex = /https?:\/\/[^"<>\\^`{|}\s]+/g;
export default { blobLinkRegex };
diff --git a/app/services/projects/container_repository/delete_tags_service.rb b/app/services/projects/container_repository/delete_tags_service.rb
index 6a8b68d8ae3..48bd9394dc5 100644
--- a/app/services/projects/container_repository/delete_tags_service.rb
+++ b/app/services/projects/container_repository/delete_tags_service.rb
@@ -22,10 +22,18 @@ module Projects
def smart_delete(container_repository, tag_names)
# generates the blobs for the dummy image
dummy_manifest = container_repository.client.generate_empty_manifest(container_repository.path)
+ return error('could not generate manifest') if dummy_manifest.nil?
# update the manifests of the tags with the new dummy image
- tag_digests = tag_names.map do |name|
- container_repository.client.put_tag(container_repository.path, name, dummy_manifest)
+ deleted_tags = []
+ tag_digests = []
+
+ tag_names.each do |name|
+ digest = container_repository.client.put_tag(container_repository.path, name, dummy_manifest)
+ next unless digest
+
+ deleted_tags << name
+ tag_digests << digest
end
# make sure the digests are the same (it should always be)
@@ -37,8 +45,8 @@ module Projects
# Deletes the dummy image
# All created tag digests are the same since they all have the same dummy image.
# a single delete is sufficient to remove all tags with it
- if container_repository.delete_tag_by_digest(tag_digests.first)
- success(deleted: tag_names)
+ if tag_digests.any? && container_repository.delete_tag_by_digest(tag_digests.first)
+ success(deleted: deleted_tags)
else
error('could not delete tags')
end
diff --git a/app/views/clusters/clusters/user/_header.html.haml b/app/views/clusters/clusters/user/_header.html.haml
index 7067c892af3..b0a24ee464f 100644
--- a/app/views/clusters/clusters/user/_header.html.haml
+++ b/app/views/clusters/clusters/user/_header.html.haml
@@ -1,5 +1,5 @@
%h4
= s_('ClusterIntegration|Enter the details for your Kubernetes cluster')
%p
- - link_to_help_page = link_to(s_('ClusterIntegration|documentation'), help_page_path('user/project/clusters/add_remove_cluster', anchor: 'add-existing-cluster'), target: '_blank', rel: 'noopener noreferrer')
+ - link_to_help_page = link_to(s_('ClusterIntegration|documentation'), help_page_path('user/project/clusters/add_remove_clusters', anchor: 'add-existing-cluster'), target: '_blank', rel: 'noopener noreferrer')
= s_('ClusterIntegration|Please enter access information for your Kubernetes cluster. If you need help, you can read our %{link_to_help_page} on Kubernetes').html_safe % { link_to_help_page: link_to_help_page }