Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nmaas Janitor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nmaas
nmaas Janitor
Commits
0de19e49
Commit
0de19e49
authored
2 years ago
by
Łukasz Łopatowski
Browse files
Options
Downloads
Patches
Plain Diff
Added additional debug logs for GitLab related operations
parent
1d2c21b4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/service/v1/config-service.go
+4
-1
4 additions, 1 deletion
pkg/service/v1/config-service.go
with
4 additions
and
1 deletion
pkg/service/v1/config-service.go
+
4
−
1
View file @
0de19e49
...
...
@@ -94,6 +94,7 @@ func prepareInfoResponse(status v1.Status, message string, info string) *v1.Info
//Find proper project, given user namespace and instance uid
func
(
s
*
configServiceServer
)
FindGitlabProjectId
(
api
*
gitlab
.
Client
,
uid
string
,
domain
string
)
(
int
,
error
)
{
//Find exact group
log
.
Printf
(
"Searching for GitLab Group by domain %s"
,
domain
)
groups
,
_
,
err
:=
api
.
Groups
.
SearchGroup
(
domain
)
if
len
(
groups
)
!=
1
||
err
!=
nil
{
log
.
Printf
(
"Found %d groups in domain %s"
,
len
(
groups
),
domain
)
...
...
@@ -102,6 +103,7 @@ func (s *configServiceServer) FindGitlabProjectId(api *gitlab.Client, uid string
}
//List group projects
log
.
Printf
(
"Searching for GitLab Projects within Group %d / %s"
,
groups
[
0
]
.
ID
,
groups
[
0
]
.
Name
)
projs
,
_
,
err
:=
api
.
Groups
.
ListGroupProjects
(
groups
[
0
]
.
ID
,
nil
)
if
err
!=
nil
||
len
(
projs
)
==
0
{
log
.
Printf
(
"Group %s is empty or unaccessible"
,
groups
[
0
]
.
Name
)
...
...
@@ -109,6 +111,7 @@ func (s *configServiceServer) FindGitlabProjectId(api *gitlab.Client, uid string
}
//Find our project in group projects list
log
.
Printf
(
"Found %d Projects and looking for %s"
,
len
(
groups
),
uid
)
for
_
,
proj
:=
range
projs
{
if
proj
.
Name
==
uid
{
return
proj
.
ID
,
nil
...
...
@@ -229,7 +232,7 @@ func (s *configServiceServer) CreateOrReplace(ctx context.Context, req *v1.Insta
repo
,
err
=
s
.
PrepareDataMapFromRepository
(
s
.
gitAPI
,
proj
)
if
err
!=
nil
{
log
.
Print
(
"Error occured while retriving content of the Git repository. Will not create any ConfigMap"
)
log
.
Print
(
"Error occur
r
ed while retriving content of the Git repository. Will not create any ConfigMap"
)
return
prepareResponse
(
v1
.
Status_FAILED
,
"Failed to create ConfigMap"
),
err
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment