Skip to content

Commit

Permalink
style: format code with Gofumpt and Prettier
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 8bb0c2f according to the output
from Gofumpt and Prettier.

Details: #2769
Signed-off-by: kpango <[email protected]>
  • Loading branch information
deepsource-autofix[bot] authored and kpango committed Dec 10, 2024
1 parent 8bb0c2f commit 7e0f9f4
Show file tree
Hide file tree
Showing 28 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Makefile.d/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ ifeq ($(REMOTE),true)
-t $(CRORG)/$(IMAGE):$(TAG) \
-t $(GHCRORG)/$(IMAGE):$(TAG) \
$(EXTRA_ARGS) \
--output type=registry,oci-mediatypes=true,compression=zstd,compression-level=5,force-compression=true,push=true \
--output type=registry,oci-mediatypes=true,compression=zstd:chunked,compression-level=5,force-compression=true,push=true \
-f $(DOCKERFILE) $(ROOTDIR)
else
@echo "starting local build for $(IMAGE):$(TAG)"
Expand Down
2 changes: 1 addition & 1 deletion dockers/agent/core/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ LABEL maintainer="vdaas.org vald team <[email protected]>"
COPY --from=builder /usr/bin/agent /usr/bin/agent
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/agent"]
ENTRYPOINT ["/usr/bin/agent"]
2 changes: 1 addition & 1 deletion dockers/agent/core/faiss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ COPY --from=builder /usr/bin/faiss /usr/bin/faiss
COPY cmd/agent/core/faiss/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/faiss"]
ENTRYPOINT ["/usr/bin/faiss"]
2 changes: 1 addition & 1 deletion dockers/agent/core/ngt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ COPY --from=builder /usr/bin/ngt /usr/bin/ngt
COPY cmd/agent/core/ngt/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/ngt"]
ENTRYPOINT ["/usr/bin/ngt"]
2 changes: 1 addition & 1 deletion dockers/agent/sidecar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ LABEL maintainer="vdaas.org vald team <[email protected]>"
COPY --from=builder /usr/bin/sidecar /usr/bin/sidecar
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/sidecar"]
ENTRYPOINT ["/usr/bin/sidecar"]
2 changes: 1 addition & 1 deletion dockers/binfmt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
#

# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go
FROM tonistiigi/binfmt:master AS builder
FROM tonistiigi/binfmt:master AS builder
2 changes: 1 addition & 1 deletion dockers/buildbase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
#

# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go
FROM ubuntu:devel AS builder
FROM ubuntu:devel AS builder
2 changes: 1 addition & 1 deletion dockers/buildkit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
#

# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go
FROM moby/buildkit:master AS builder
FROM moby/buildkit:master AS builder
2 changes: 1 addition & 1 deletion dockers/buildkit/syft/scanner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
#

# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go
FROM docker/buildkit-syft-scanner:edge AS scanner
FROM docker/buildkit-syft-scanner:edge AS scanner
2 changes: 1 addition & 1 deletion dockers/ci/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ RUN --mount=type=bind,target=.,rw \
&& rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/*
# skipcq: DOK-DL3002
USER root:root
ENTRYPOINT ["/bin/bash"]
ENTRYPOINT ["/bin/bash"]
2 changes: 1 addition & 1 deletion dockers/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ RUN --mount=type=bind,target=.,rw \
&& make faiss/install \
&& rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/*
# skipcq: DOK-DL3002
USER root:root
USER root:root
2 changes: 1 addition & 1 deletion dockers/discoverer/k8s/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/discoverer /usr/bin/discoverer
COPY cmd/discoverer/k8s/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/discoverer"]
ENTRYPOINT ["/usr/bin/discoverer"]
2 changes: 1 addition & 1 deletion dockers/example/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ LABEL maintainer="vdaas.org vald team <[email protected]>"
COPY --from=builder /usr/bin/client /usr/bin/client
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/client"]
ENTRYPOINT ["/usr/bin/client"]
2 changes: 1 addition & 1 deletion dockers/gateway/filter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/filter /usr/bin/filter
COPY cmd/gateway/filter/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/filter"]
ENTRYPOINT ["/usr/bin/filter"]
2 changes: 1 addition & 1 deletion dockers/gateway/lb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/lb /usr/bin/lb
COPY cmd/gateway/lb/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/lb"]
ENTRYPOINT ["/usr/bin/lb"]
2 changes: 1 addition & 1 deletion dockers/gateway/mirror/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/mirror /usr/bin/mirror
COPY cmd/gateway/mirror/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/mirror"]
ENTRYPOINT ["/usr/bin/mirror"]
2 changes: 1 addition & 1 deletion dockers/index/job/correction/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-correction /usr/bin/index-correction
COPY cmd/index/job/correction/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-correction"]
ENTRYPOINT ["/usr/bin/index-correction"]
2 changes: 1 addition & 1 deletion dockers/index/job/creation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-creation /usr/bin/index-creation
COPY cmd/index/job/creation/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-creation"]
ENTRYPOINT ["/usr/bin/index-creation"]
2 changes: 1 addition & 1 deletion dockers/index/job/deletion/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-deletion /usr/bin/index-deletion
COPY cmd/index/job/deletion/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-deletion"]
ENTRYPOINT ["/usr/bin/index-deletion"]
2 changes: 1 addition & 1 deletion dockers/index/job/readreplica/rotate/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/readreplica-rotate /usr/bin/readreplica-rotate
COPY cmd/index/job/readreplica/rotate/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/readreplica-rotate"]
ENTRYPOINT ["/usr/bin/readreplica-rotate"]
2 changes: 1 addition & 1 deletion dockers/index/job/save/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-save /usr/bin/index-save
COPY cmd/index/job/save/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-save"]
ENTRYPOINT ["/usr/bin/index-save"]
2 changes: 1 addition & 1 deletion dockers/index/operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-operator /usr/bin/index-operator
COPY cmd/index/operator/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-operator"]
ENTRYPOINT ["/usr/bin/index-operator"]
2 changes: 1 addition & 1 deletion dockers/manager/index/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index /usr/bin/index
COPY cmd/manager/index/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index"]
ENTRYPOINT ["/usr/bin/index"]
2 changes: 1 addition & 1 deletion dockers/operator/helm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ COPY --from=builder /opt/helm/charts/vald /opt/helm/charts/vald
COPY --from=builder /opt/helm/charts/vald-helm-operator /opt/helm/charts/vald-helm-operator
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=/opt/helm/watches.yaml"]
ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=/opt/helm/watches.yaml"]
2 changes: 1 addition & 1 deletion dockers/tools/benchmark/job/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ COPY --from=builder /usr/bin/job /usr/bin/job
COPY cmd/tools/benchmark/job/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/job"]
ENTRYPOINT ["/usr/bin/job"]
2 changes: 1 addition & 1 deletion dockers/tools/benchmark/operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/operator /usr/bin/operator
COPY cmd/tools/benchmark/operator/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/operator"]
ENTRYPOINT ["/usr/bin/operator"]
2 changes: 1 addition & 1 deletion dockers/tools/cli/loadtest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ COPY --from=builder /usr/bin/loadtest /usr/bin/loadtest
COPY cmd/tools/cli/loadtest/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/loadtest"]
ENTRYPOINT ["/usr/bin/loadtest"]
9 changes: 5 additions & 4 deletions hack/docker/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,11 @@ func main() {
slices.Sort(pkgs)
pkgs = slices.Compact(pkgs)
for i, pkg := range pkgs {
const splitWord = "/vdaas/vald/"
pkg += "/*.go"
_, right, ok := strings.Cut(pkg, "/vdaas/vald/")
if ok && right != "" {
pkg = right
index := strings.LastIndex(pkg, splitWord)
if index != -1 {
pkg = pkg[index+len(splitWord):]
}
pkgs[i] = pkg
}
Expand Down Expand Up @@ -1023,7 +1024,7 @@ jobs:
// remove the double quotation marks from the generated key "on": (note that the word "on" is a reserved word in sigs.k8s.io/yaml)
workflowYaml := strings.Replace(string(workflowYamlTmp), "\"on\":", "on:", 1)

if len(header) > (int(^uint(0) >> 1) - len(workflowYaml)) {
if len(header) > (int(^uint(0)>>1) - len(workflowYaml)) {
return fmt.Errorf("size computation for allocation may overflow")
}
totalLen := len(header) + len(workflowYaml)
Expand Down

0 comments on commit 7e0f9f4

Please sign in to comment.