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
6a5201ed
Commit
6a5201ed
authored
Nov 08, 2021
by
Tiger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow non-group Agent projects to authorize themselves
Changelog: fixed
parent
2d81033a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
app/services/clusters/agents/refresh_authorization_service.rb
...services/clusters/agents/refresh_authorization_service.rb
+1
-1
spec/services/clusters/agents/refresh_authorization_service_spec.rb
...ces/clusters/agents/refresh_authorization_service_spec.rb
+10
-0
No files found.
app/services/clusters/agents/refresh_authorization_service.rb
View file @
6a5201ed
...
...
@@ -86,7 +86,7 @@ module Clusters
if
group_root_ancestor?
root_ancestor
.
all_projects
else
::
Project
.
none
::
Project
.
id_in
(
project
.
id
)
end
end
...
...
spec/services/clusters/agents/refresh_authorization_service_spec.rb
View file @
6a5201ed
...
...
@@ -113,6 +113,16 @@ RSpec.describe Clusters::Agents::RefreshAuthorizationService do
expect
(
modified_authorization
.
config
).
to
eq
({
'default_namespace'
=>
'new-namespace'
})
end
context
'project does not belong to a group, and is authorizing itself'
do
let
(
:root_ancestor
)
{
create
(
:namespace
)
}
let
(
:added_project
)
{
project
}
it
'creates an authorization record for the project'
do
expect
(
subject
).
to
be_truthy
expect
(
agent
.
authorized_projects
).
to
contain_exactly
(
added_project
)
end
end
context
'config contains too many projects'
do
before
do
stub_const
(
"
#{
described_class
}
::AUTHORIZED_ENTITY_LIMIT"
,
1
)
...
...
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