Skip to content

Commit

Permalink
đźš‘ Fix Wrong repository name
Browse files Browse the repository at this point in the history
---
En raison de l'erreur de nommage laissée, le build n'était pas réalisé sur la bonne image, et a provoqué l'absence de remontée des membres des projets.
  • Loading branch information
KĂ©vin PEREZ committed Jan 19, 2024
1 parent 2159153 commit 8cef9dd
Show file tree
Hide file tree
Showing 27 changed files with 55 additions and 54 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM golang:latest as build
WORKDIR $GOPATH/src/github.com/ca-gip/kubi-members
COPY . $GOPATH/src/github.com/ca-gip/kubi-members
WORKDIR $GOPATH/src/github.com/ca-gip/kubi-members-v2
COPY . $GOPATH/src/github.com/ca-gip/kubi-members-v2
RUN make build

FROM scratch
WORKDIR /root/
COPY --from=build /go/src/github.com/ca-gip/kubi-members/build/kubi-members .
COPY --from=build /go/src/github.com/ca-gip/kubi-members-v2/build/kubi-members-v2 .
EXPOSE 8000
CMD ["./kubi-members"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: dependency codegen test build

REPO= github.com/ca-gip/kubi-members
IMAGE= kubi-members
REPO= github.com/ca-gip/kubi-members-v2
IMAGE= kubi-members-v2
DOCKER_REPO= cagip

dependency:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ca-gip/kubi-members
module github.com/ca-gip/kubi-members-v2

go 1.19

Expand Down
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
bash "${CODEGEN_PKG}"/generate-groups.sh all \
github.com/ca-gip/kubi-members/pkg/generated github.com/ca-gip/kubi-members/pkg/apis \
github.com/ca-gip/kubi-members-v2/pkg/generated github.com/ca-gip/kubi-members-v2/pkg/apis \
cagip:v1 --go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt
8 changes: 4 additions & 4 deletions internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"crypto/md5"
"fmt"

"github.com/ca-gip/kubi-members/internal/ldap"
"github.com/ca-gip/kubi-members/internal/utils"
v1 "github.com/ca-gip/kubi-members/pkg/apis/cagip/v1"
membersclientset "github.com/ca-gip/kubi-members/pkg/generated/clientset/versioned"
"github.com/ca-gip/kubi-members-v2/internal/ldap"
"github.com/ca-gip/kubi-members-v2/internal/utils"
v1 "github.com/ca-gip/kubi-members-v2/pkg/apis/cagip/v1"
membersclientset "github.com/ca-gip/kubi-members-v2/pkg/generated/clientset/versioned"
kubiv1 "github.com/ca-gip/kubi/pkg/apis/cagip/v1"
projectclientset "github.com/ca-gip/kubi/pkg/generated/clientset/versioned"
errors "k8s.io/apimachinery/pkg/api/errors"
Expand Down
13 changes: 7 additions & 6 deletions internal/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package ldap
import (
"crypto/tls"
"fmt"
"github.com/ca-gip/kubi-members/internal/utils"
"syscall"

"github.com/ca-gip/kubi-members-v2/internal/utils"
ldap "github.com/go-ldap/ldap/v3"
"k8s.io/klog/v2"
"syscall"
)

type User struct {
ID string `ldap:"id"`
ID string `ldap:"id"`
Dn string `ldap:"dn"`
Username string `ldap:"displayName"`
Mail string `ldap:"mail"`
Expand Down Expand Up @@ -47,7 +48,7 @@ func NewLdap() *Ldap {
"UserFilter", config.UserFilter,
"OpsGroupBase", config.OpsGroupBase,
"AppGroupBase", config.AppGroupBase,
"AdminGroupBase",config.AdminGroupBase,
"AdminGroupBase", config.AdminGroupBase,
"CustomerGroupBase", config.CustomerGroupBase,
"UserKey", config.UserKey)
tlsConfig := &tls.Config{
Expand Down Expand Up @@ -130,7 +131,7 @@ func (l *Ldap) searchUser(userDN string) (user *User, err error) {
TimeLimit: 10,
TypesOnly: false,
Filter: "(|(objectClass=person)(objectClass=organizationalPerson))",
Attributes: []string{"cn","mail",l.UserKey},
Attributes: []string{"cn", "mail", l.UserKey},
})

if err != nil || res == nil || len(res.Entries) == 0 {
Expand All @@ -140,7 +141,7 @@ func (l *Ldap) searchUser(userDN string) (user *User, err error) {
Dn: userDN,
Username: res.Entries[0].GetAttributeValue("cn"),
Mail: res.Entries[0].GetAttributeValue("mail"),
ID: res.Entries[0].GetAttributeValue(l.UserKey),
ID: res.Entries[0].GetAttributeValue(l.UserKey),
}
return
}
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"path/filepath"

"github.com/ca-gip/kubi-members/internal/controller"
"github.com/ca-gip/kubi-members/internal/ldap"
membersclientset "github.com/ca-gip/kubi-members/pkg/generated/clientset/versioned"
"github.com/ca-gip/kubi-members-v2/internal/controller"
"github.com/ca-gip/kubi-members-v2/internal/ldap"
membersclientset "github.com/ca-gip/kubi-members-v2/pkg/generated/clientset/versioned"
projectclientset "github.com/ca-gip/kubi/pkg/generated/clientset/versioned"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/cagip/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"

cagip "github.com/ca-gip/kubi-members/pkg/apis/cagip"
cagip "github.com/ca-gip/kubi-members-v2/pkg/apis/cagip"
)

// SchemeGroupVersion is group version used to register these objects
Expand Down
2 changes: 1 addition & 1 deletion pkg/generated/clientset/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/generated/clientset/versioned/fake/clientset_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/generated/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/generated/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/generated/informers/externalversions/cagip/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/generated/informers/externalversions/factory.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/generated/informers/externalversions/generic.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/generated/listers/cagip/v1/clustermember.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/generated/listers/cagip/v1/projectmember.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8cef9dd

Please sign in to comment.