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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f0b71e13
Commit
f0b71e13
authored
Aug 03, 2021
by
Tiger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use http(s) for the agent CI tunnel address
parent
a3357f19
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
lib/gitlab/kas.rb
lib/gitlab/kas.rb
+3
-1
spec/lib/gitlab/kas_spec.rb
spec/lib/gitlab/kas_spec.rb
+28
-2
No files found.
lib/gitlab/kas.rb
View file @
f0b71e13
...
...
@@ -41,7 +41,9 @@ module Gitlab
end
def
tunnel_url
URI
.
join
(
external_url
,
K8S_PROXY_PATH
).
to_s
uri
=
URI
.
join
(
external_url
,
K8S_PROXY_PATH
)
uri
.
scheme
=
uri
.
scheme
.
in?
(
%w(grpcs wss)
)
?
'https'
:
'http'
uri
.
to_s
end
# Return GitLab KAS internal_url
...
...
spec/lib/gitlab/kas_spec.rb
View file @
f0b71e13
...
...
@@ -66,8 +66,34 @@ RSpec.describe Gitlab::Kas do
end
describe
'.tunnel_url'
do
it
'returns gitlab_kas external_url with proxy path appended'
do
expect
(
described_class
.
tunnel_url
).
to
eq
(
Gitlab
.
config
.
gitlab_kas
.
external_url
+
'/k8s-proxy'
)
before
do
stub_config
(
gitlab_kas:
{
external_url:
external_url
})
end
subject
{
described_class
.
tunnel_url
}
context
'external_url uses wss://'
do
let
(
:external_url
)
{
'wss://kas.gitlab.example.com'
}
it
{
is_expected
.
to
eq
(
'https://kas.gitlab.example.com/k8s-proxy'
)
}
end
context
'external_url uses ws://'
do
let
(
:external_url
)
{
'ws://kas.gitlab.example.com'
}
it
{
is_expected
.
to
eq
(
'http://kas.gitlab.example.com/k8s-proxy'
)
}
end
context
'external_url uses grpcs://'
do
let
(
:external_url
)
{
'grpcs://kas.gitlab.example.com'
}
it
{
is_expected
.
to
eq
(
'https://kas.gitlab.example.com/k8s-proxy'
)
}
end
context
'external_url uses grpc://'
do
let
(
:external_url
)
{
'grpc://kas.gitlab.example.com'
}
it
{
is_expected
.
to
eq
(
'http://kas.gitlab.example.com/k8s-proxy'
)
}
end
end
...
...
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