Skip to content

Commit 41c8090

Browse files
committed
Update dependencies and Go version
1 parent 0d3e7e8 commit 41c8090

File tree

14 files changed

+658
-862
lines changed

14 files changed

+658
-862
lines changed

.github/workflows/golang.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ on:
2222

2323
env:
2424
GO_MODULE: github.com/finleap-connect/monoskope
25-
GO_VERSION: 1.19.x
25+
GO_VERSION: 1.24.x
2626
GINKGO_VERSION: v1.16.5
27-
GO_CI_LINT_VERSION: v1.48.0
27+
GO_CI_LINT_VERSION: v1.64.8
2828

2929
jobs:
3030
lint:

build/package/go.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.19-buster AS builder
15+
FROM golang:1.24-bullseye AS builder
1616

1717
ARG VERSION
1818
ARG GO_MODULE
@@ -22,7 +22,7 @@ ARG NAME
2222

2323
WORKDIR /workdir
2424

25-
ENV GRPC_HEALTH_PROBE_VERSION=v0.3.5
25+
ENV GRPC_HEALTH_PROBE_VERSION=v0.3.44
2626
ENV CGO_ENABLED=0
2727
ENV GOOS=linux
2828
ENV GOARCH=amd64

cmd/commandhandler/commands.go

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
es "github.com/finleap-connect/monoskope/pkg/eventsourcing"
2222
"github.com/google/uuid"
2323
"github.com/olekukonko/tablewriter"
24+
"github.com/olekukonko/tablewriter/renderer"
2425
"github.com/spf13/cobra"
2526
)
2627

@@ -49,31 +50,17 @@ func NewReportCommands() *cobra.Command {
4950
})
5051
}
5152

52-
table := tablewriter.NewWriter(os.Stdout)
53-
table.SetHeader([]string{"Command", "Aggregate"})
54-
53+
var opts []tablewriter.Option
5554
if formatMarkdown {
56-
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
57-
table.SetAutoMergeCellsByColumnIndex([]int{0})
58-
table.SetCenterSeparator("|")
59-
} else {
60-
table.SetAutoWrapText(false)
61-
table.SetAutoFormatHeaders(true)
62-
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
63-
table.SetAlignment(tablewriter.ALIGN_LEFT)
64-
table.SetCenterSeparator("")
65-
table.SetColumnSeparator("")
66-
table.SetRowSeparator("")
67-
table.SetHeaderLine(false)
68-
table.SetBorder(false)
69-
table.SetTablePadding("\t") // pad with tabs
70-
table.SetNoWhiteSpace(true)
55+
opts = append(opts, tablewriter.WithRenderer(renderer.NewMarkdown()))
7156
}
57+
table := tablewriter.NewTable(os.Stdout, opts...)
58+
table.Header([]string{"Command", "Aggregate"})
7259

73-
table.AppendBulk(data) // Add Bulk Data
74-
table.Render()
75-
76-
return nil
60+
if err := table.Bulk(data); err != nil {
61+
return err
62+
}
63+
return table.Render()
7764
},
7865
}
7966

cmd/scimserver/server.go

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,25 @@ var serveCmd = &cobra.Command{
6161

6262
// Create CommandHandler client
6363
log.Info("Connecting command handler...", "commandHandlerAddr", commandHandlerAddr)
64-
conn, commandHandlerClient, err := grpcUtil.NewClientWithAuthForward(ctx, commandHandlerAddr, false, commandHandlerApi.NewCommandHandlerClient)
64+
conn, commandHandlerClient, err := grpcUtil.NewClientWithAuthForward(
65+
ctx,
66+
commandHandlerAddr,
67+
false,
68+
commandHandlerApi.NewCommandHandlerClient,
69+
)
6570
if err != nil {
6671
return err
6772
}
6873
defer util.PanicOnErrorFunc(conn.Close)
6974

7075
// Create User client
7176
log.Info("Connecting queryhandler...", "queryHandlerAddr", queryHandlerAddr)
72-
conn, userClient, err := grpcUtil.NewClientWithAuthForward(ctx, queryHandlerAddr, false, domainApi.NewUserClient)
77+
conn, userClient, err := grpcUtil.NewClientWithAuthForward(
78+
ctx,
79+
queryHandlerAddr,
80+
false,
81+
domainApi.NewUserClient,
82+
)
7383
if err != nil {
7484
return err
7585
}
@@ -99,7 +109,10 @@ var serveCmd = &cobra.Command{
99109
providerConfig := scimserver.NewProvierConfig()
100110
userHandler := scimserver.NewUserHandler(commandHandlerClient, userClient)
101111
groupHandler := scimserver.NewGroupHandler(commandHandlerClient, userClient)
102-
scimServer := scimserver.NewServer(providerConfig, userHandler, groupHandler)
112+
scimServer, err := scimserver.NewServer(&providerConfig, userHandler, groupHandler)
113+
if err != nil {
114+
return err
115+
}
103116

104117
// Start routine waiting for signals
105118
shutdown.RegisterSignalHandler(func() {
@@ -139,6 +152,16 @@ func init() {
139152
flags := serveCmd.Flags()
140153
flags.StringVar(&httpApiAddr, "http-api-addr", ":8081", "Address the HTTP service will listen on")
141154
flags.StringVar(&healthApiAddr, "health-api-addr", ":8082", "Address the health check HTTP service will listen on")
142-
flags.StringVar(&commandHandlerAddr, "command-handler-api-addr", ":8081", "Address the command handler gRPC service is listening on")
143-
flags.StringVar(&queryHandlerAddr, "query-handler-api-addr", ":8082", "Address the query handler gRPC service is listening on")
155+
flags.StringVar(
156+
&commandHandlerAddr,
157+
"command-handler-api-addr",
158+
":8081",
159+
"Address the command handler gRPC service is listening on",
160+
)
161+
flags.StringVar(
162+
&queryHandlerAddr,
163+
"query-handler-api-addr",
164+
":8082",
165+
"Address the query handler gRPC service is listening on",
166+
)
144167
}

0 commit comments

Comments
 (0)