Skip to content
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 .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.5"
go-version: "1.26.1"
- name: Check out shell-operator code
uses: actions/checkout@v4
- name: Restore Go modules
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.5"
go-version: "1.26.1"
- name: Check out shell-operator code
uses: actions/checkout@v4
- name: Restore Go modules
Expand All @@ -31,7 +31,7 @@ jobs:
echo -n "Go modules unpacked size is: " && du -sh $HOME/go/pkg/mod
- name: Run golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b . v2.8.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b . v2.11.4
./golangci-lint run --build-tags integration,test
codespell:
name: Run codespell
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-labeled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.5"
go-version: "1.26.1"
- name: Check out shell-operator code
uses: actions/checkout@v4
- name: Restore Go modules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.5"
go-version: "1.26.1"
- name: Check out shell-operator code
uses: actions/checkout@v4
- name: Restore Go modules
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ YQ = $(LOCALBIN)/yq
## TODO: remap in yaml file (version.yaml or smthng)
## Tool Versions
# GO_BUILDER_VERSION must be without 'v' prefix
GO_BUILDER_VERSION = 1.25.5
GOLANGCI_LINT_VERSION = v2.8.0
GO_BUILDER_VERSION = 1.26.1
GOLANGCI_LINT_VERSION = v2.11.4
YQ_VERSION ?= v4.50.1


Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/flant/shell-operator

go 1.24.0
go 1.25.8

require (
github.com/deckhouse/deckhouse/pkg/log v0.2.0
Expand Down Expand Up @@ -37,7 +37,7 @@ require (
replace github.com/go-openapi/validate => github.com/flant/go-openapi-validate v0.19.12-flant.0

require (
github.com/deckhouse/module-sdk v0.10.2
github.com/deckhouse/module-sdk v0.10.4
github.com/gojuno/minimock/v3 v3.4.7
github.com/itchyny/gojq v0.12.17
github.com/muesli/termenv v0.16.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ github.com/deckhouse/deckhouse/pkg/log v0.2.0 h1:6tmZQLwNb1o/hP1gzJQBjcwfA/bubbg
github.com/deckhouse/deckhouse/pkg/log v0.2.0/go.mod h1:pbAxTSDcPmwyl3wwKDcEB3qdxHnRxqTV+J0K+sha8bw=
github.com/deckhouse/deckhouse/pkg/metrics-storage v0.3.0 h1:xZvbKuexrSQGEw6CB4n3UC7XbOb9QNLbm8UhcGZ2R1I=
github.com/deckhouse/deckhouse/pkg/metrics-storage v0.3.0/go.mod h1:Rz++SzCLkFW03WGgftnn91TimGU2shiKb5S/YuxcBuE=
github.com/deckhouse/module-sdk v0.10.2 h1:jYxFTgjdaZ9NKWKbFP95RvD55WJvhwjPAeSMFKhZb0o=
github.com/deckhouse/module-sdk v0.10.2/go.mod h1:Z1jfmd0fICoYww0daMijWAU+OZTxeJUXfMciKKuYAYA=
github.com/deckhouse/module-sdk v0.10.4 h1:1C61nXevgQiUnmv5Is+XP9Octu05XWKgjFi6gmL7miM=
github.com/deckhouse/module-sdk v0.10.4/go.mod h1:wpEKjpMUHZ4D5JGPfHChKGzBcOVyZnUN4sP0yTEaHdU=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
Expand Down
24 changes: 12 additions & 12 deletions pkg/task/dump/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ func TaskMainQueue(tqs *queue.TaskQueueSet, format string) interface{} {

if format == "text" {
var buf strings.Builder
buf.WriteString(fmt.Sprintf("Queue '%s': length %d, status: '%s'\n", dq.Name, dq.TasksCount, dq.Status))
fmt.Fprintf(&buf, "Queue '%s': length %d, status: '%s'\n", dq.Name, dq.TasksCount, dq.Status)
buf.WriteString("\n")

for _, ts := range dq.Tasks {
buf.WriteString(fmt.Sprintf("%2d. ", ts.Index))
fmt.Fprintf(&buf, "%2d. ", ts.Index)
buf.WriteString(ts.Description)
buf.WriteString("\n")
}
Expand Down Expand Up @@ -264,21 +264,21 @@ func (dtq dumpTaskQueues) asText(showEmpty bool) string {
buf.WriteString("\n")
}

buf.WriteString(fmt.Sprintf("Queue '%s': length %d, status: '%s'\n", taskQueue.Name, taskQueue.TasksCount, taskQueue.Status))
fmt.Fprintf(&buf, "Queue '%s': length %d, status: '%s'\n", taskQueue.Name, taskQueue.TasksCount, taskQueue.Status)
buf.WriteString("\n")

for _, tk := range taskQueue.Tasks {
buf.WriteString(fmt.Sprintf("%2d. ", tk.Index))
fmt.Fprintf(&buf, "%2d. ", tk.Index)
buf.WriteString(tk.Description)
buf.WriteString("\n")
}
}

// Empty queues. Do not report single empty main queue.
if showEmpty {
buf.WriteString(fmt.Sprintf("\nEmpty queues (%d):\n", len(dtq.Empty)))
fmt.Fprintf(&buf, "\nEmpty queues (%d):\n", len(dtq.Empty))
for _, taskQueue := range dtq.Empty {
buf.WriteString(fmt.Sprintf("- %s\n", taskQueue.Name))
fmt.Fprintf(&buf, "- %s\n", taskQueue.Name)
}
}

Expand All @@ -300,22 +300,22 @@ func (dtq dumpTaskQueues) asText(showEmpty bool) string {
buf.WriteString("Summary:\n")
if dtq.MainQueue != nil {
otherQueuesCount-- // minus main queue
buf.WriteString(fmt.Sprintf("- '%s' queue: %s.\n",
fmt.Fprintf(&buf, "- '%s' queue: %s.\n",
dtq.MainQueue.Name,
pluralize(len(dtq.MainQueue.Tasks), "empty", "task", "tasks")))
pluralize(len(dtq.MainQueue.Tasks), "empty", "task", "tasks"))
}

if otherQueuesCount > 0 {
buf.WriteString(fmt.Sprintf("- %s (%d active, %d empty): %s.\n",
fmt.Fprintf(&buf, "- %s (%d active, %d empty): %s.\n",
pluralize(otherQueuesCount, "", "other queue", "other queues"),
dtq.Summary.otherQueuesActiveCount, dtq.Summary.otherQueuesEmptyCount,
pluralize(dtq.Summary.otherQueuesTasksCount, "", "task", "tasks")))
pluralize(dtq.Summary.otherQueuesTasksCount, "", "task", "tasks"))
}
if dtq.Summary.totalTasksCount == 0 {
buf.WriteString("- no tasks to handle.\n")
} else {
buf.WriteString(fmt.Sprintf("- total %s to handle.\n",
pluralize(dtq.Summary.totalTasksCount, "", "task", "tasks")))
fmt.Fprintf(&buf, "- total %s to handle.\n",
pluralize(dtq.Summary.totalTasksCount, "", "task", "tasks"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/task/queue/task_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ func (q *TaskQueue) String() string {
qLen := q.Length()

q.IterateSnapshot(func(t task.Task) {
buf.WriteString(fmt.Sprintf("[%s,id=%10.10s]", t.GetDescription(), t.GetId()))
fmt.Fprintf(&buf, "[%s,id=%10.10s]", t.GetDescription(), t.GetId())
index++
if index == qLen {
return
Expand Down
Loading