Skip to content

Commit 0c73e3f

Browse files
committed
chore: minor fixes
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
1 parent 563f827 commit 0c73e3f

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

protoc_plugins/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ RUN go build -trimpath -ldflags "-s -w" -o /out/protoc-gen-php-grpc-plugin ./pro
1717

1818
FROM scratch
1919

20-
ARG APP_VERSION=""
21-
ARG BUILD_TIME=""
20+
# Supply real metadata at build time, for example:
21+
# docker build --platform linux/amd64 --build-arg BUILD_TIME="$(date -u +%Y-%m-%dT%H:%M:%SZ)" --build-arg APP_VERSION="vX.Y.Z" -f protoc_plugins/Dockerfile .
22+
ARG APP_VERSION="unknown"
23+
ARG BUILD_TIME="unknown"
2224

2325
# Runtime dependencies
2426
LABEL org.opencontainers.image.title="protoc-gen-php-grpc"
@@ -30,6 +32,8 @@ LABEL org.opencontainers.image.version="${APP_VERSION}"
3032
LABEL org.opencontainers.image.created="${BUILD_TIME}"
3133
LABEL org.opencontainers.image.licenses="MIT"
3234

33-
COPY --from=builder /out/protoc-gen-php-grpc-plugin /protoc-gen-php-grpc-plugin
35+
COPY --from=builder --chown=65532:65532 /out/protoc-gen-php-grpc-plugin /protoc-gen-php-grpc-plugin
36+
37+
USER 65532:65532
3438

3539
ENTRYPOINT ["/protoc-gen-php-grpc-plugin"]

server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (p *Plugin) createGRPCserver(interceptors map[string]api.Interceptor) (*grp
3434
}
3535

3636
// if we have interceptors in the config, we need to chain them with our interceptor, and add them to the server options
37-
if len(p.config.Interceptors) > 0 && len(interceptors) > 0 {
37+
if len(p.config.Interceptors) > 0 {
3838
// apply interceptors in the same order as they are configured
3939
for i := 0; i < len(p.config.Interceptors); i++ {
4040
name := p.config.Interceptors[i]

tests/configs/.rr-grpc-rq-interceptors.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
version: '3'
2-
32
rpc:
43
listen: "tcp://127.0.0.1:6011"
5-
64
server:
75
command: "php php_test_files/worker-grpc.php"
86
relay: "pipes"
97
relay_timeout: "20s"
10-
118
logs:
129
mode: development
1310
level: error
14-
1511
grpc:
1612
listen: "tcp://127.0.0.1:9011"
17-
1813
proto:
1914
- "proto/service/service.proto"
20-
2115
interceptors:
2216
- "interceptor1"
2317
- "interceptor2"
24-
2518
max_send_msg_size: 50
2619
max_recv_msg_size: 50
2720
max_connection_idle: 0s
@@ -30,7 +23,6 @@ grpc:
3023
max_concurrent_streams: 10
3124
ping_time: 1s
3225
timeout: 200s
33-
3426
pool:
3527
num_workers: 2
3628
max_jobs: 0

0 commit comments

Comments
 (0)