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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nmaas
nmaas Janitor
Commits
dde19b61
Commit
dde19b61
authored
Jan 2, 2019
by
Michał Bień
Browse files
Options
Downloads
Patches
Plain Diff
Improved logging
parent
cf1c76c5
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/proto/v1/config-service.proto
+4
-1
4 additions, 1 deletion
api/proto/v1/config-service.proto
pkg/service/v1/config-service.go
+6
-2
6 additions, 2 deletions
pkg/service/v1/config-service.go
with
10 additions
and
3 deletions
api/proto/v1/config-service.proto
+
4
−
1
View file @
dde19b61
syntax
=
"proto3"
;
package
v1
;
option
java_package
=
"net.geant.nmaas.externalservices.inventory.janitor"
;
option
java_outer_classname
=
"JanitorManager"
;
enum
Status
{
FAILED
=
0
;
OK
=
1
;
...
...
This diff is collapsed.
Click to expand it.
pkg/service/v1/config-service.go
+
6
−
2
View file @
dde19b61
...
...
@@ -3,10 +3,12 @@ package v1
import
(
"context"
"github.com/xanzy/go-gitlab"
apiv1
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
kube
"k8s.io/client-go/kubernetes/typed/core/v1"
apiv1
"k8s.io/api/core/v1"
"log"
"strconv"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
...
...
@@ -51,7 +53,9 @@ func (s *configServiceServer) FindGitlabProjectId(api *gitlab.Client, uid string
//Find exact group
groups
,
_
,
err
:=
s
.
gitAPI
.
Groups
.
SearchGroup
(
domain
)
if
len
(
groups
)
!=
1
||
err
!=
nil
{
return
-
1
,
status
.
Errorf
(
codes
.
NotFound
,
"Gitlab Group for given namespace does not exist"
)
log
.
Fatal
(
"Found "
+
strconv
.
Itoa
(
len
(
groups
))
+
"groups"
)
log
.
Fatal
(
err
)
return
-
1
,
status
.
Errorf
(
codes
.
NotFound
,
"Gitlab Group for given domain does not exist"
)
}
//List group projects
...
...
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
sign in
to comment