Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates tool dependencies #109

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ linters:
- bodyclose
- depguard
- errorlint
- exportloopref
- copyloopvar
- importas
- gci
- gofumpt
Expand Down
8 changes: 4 additions & 4 deletions Makefile.tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ CODESPELL = $(LOCALBIN)/.venv/[email protected]/bin/codespell
KIND ?= $(LOCALBIN)/kind

## Tool versions.
CONTROLLER_TOOLS_VERSION ?= v0.16.2
CONTROLLER_TOOLS_VERSION ?= v0.17.1
ENVTEST_VERSION ?= release-0.19
GOLANGCI_LINT_VERSION ?= v1.60.1
GO_FUMPT_VERSION ?= v0.6.0
GOLANGCI_LINT_VERSION ?= v1.63.4
GO_FUMPT_VERSION ?= v0.7.0
GCI_VERSION ?= v0.13.5
EDITORCONFIG_CHECKER_VERSION ?= v3.0.3
EDITORCONFIG_CHECKER_VERSION ?= v3.1.2
KIND_VERSION ?= v0.26.0

.PHONY: golangci-lint
Expand Down
2 changes: 1 addition & 1 deletion internal/extproc/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type router struct {

// NewRouter creates a new [extprocapi.Router] implementation for the given config.
func NewRouter(config *filterconfig.Config, newCustomFn extprocapi.NewCustomRouterFn) (extprocapi.Router, error) {
r := &router{rules: config.Rules, rng: rand.New(rand.NewSource(uint64(time.Now().UnixNano())))}
r := &router{rules: config.Rules, rng: rand.New(rand.NewSource(uint64(time.Now().UnixNano())))} //nolint:gosec
if newCustomFn != nil {
customRouter := newCustomFn(r, config)
return customRouter, nil
Expand Down
6 changes: 3 additions & 3 deletions internal/extproc/translator/openai_awsbedrock.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (o *openAIToAWSBedrockTranslatorV1ChatCompletion) ResponseBody(body io.Read
for i := range o.events {
event := &o.events[i]
if usage := event.Usage; usage != nil {
usedToken = uint32(usage.TotalTokens)
usedToken = uint32(usage.TotalTokens) //nolint:gosec
}

oaiEvent, ok := o.convertEvent(event)
Expand All @@ -329,7 +329,7 @@ func (o *openAIToAWSBedrockTranslatorV1ChatCompletion) ResponseBody(body io.Read
return nil, nil, 0, fmt.Errorf("failed to unmarshal body: %w", err)
}

usedToken = uint32(bedrockResp.Usage.TotalTokens)
usedToken = uint32(bedrockResp.Usage.TotalTokens) //nolint:gosec

openAIResp := openai.ChatCompletionResponse{
Object: "chat.completion",
Expand All @@ -341,7 +341,7 @@ func (o *openAIToAWSBedrockTranslatorV1ChatCompletion) ResponseBody(body io.Read
PromptTokens: bedrockResp.Usage.InputTokens,
CompletionTokens: bedrockResp.Usage.OutputTokens,
}
usedToken = uint32(bedrockResp.Usage.TotalTokens)
usedToken = uint32(bedrockResp.Usage.TotalTokens) //nolint:gosec
}
for i, output := range bedrockResp.Output.Message.Content {
choice := openai.ChatCompletionResponseChoice{
Expand Down
4 changes: 2 additions & 2 deletions internal/extproc/translator/openai_openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (o *openAIToOpenAITranslatorV1ChatCompletion) ResponseBody(body io.Reader,
if err := json.NewDecoder(body).Decode(&resp); err != nil {
return nil, nil, 0, fmt.Errorf("failed to unmarshal body: %w", err)
}
usedToken = uint32(resp.Usage.TotalTokens)
usedToken = uint32(resp.Usage.TotalTokens) //nolint:gosec
return
}

Expand All @@ -91,7 +91,7 @@ func (o *openAIToOpenAITranslatorV1ChatCompletion) extractUsageFromBufferEvent()
continue
}
if usage := event.Usage; usage != nil {
usedToken = uint32(usage.TotalTokens)
usedToken = uint32(usage.TotalTokens) //nolint:gosec
o.bufferingDone = true
o.buffered = nil
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.2
controller-gen.kubebuilder.io/version: v0.17.1
name: aigatewayroutes.aigateway.envoyproxy.io
spec:
group: aigateway.envoyproxy.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.2
controller-gen.kubebuilder.io/version: v0.17.1
name: aiservicebackends.aigateway.envoyproxy.io
spec:
group: aigateway.envoyproxy.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.2
controller-gen.kubebuilder.io/version: v0.17.1
name: backendsecuritypolicies.aigateway.envoyproxy.io
spec:
group: aigateway.envoyproxy.io
Expand Down
Loading