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 @@ -13,7 +13,7 @@ on:
- 'feat/*'

env:
GO_VERSION: 1.25.0
GO_VERSION: 1.26.2
NODE_VERSION: 20.19.0
HELM_VERSION: 3.8.2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
GO_VERSION: 1.25.0
GO_VERSION: 1.26.2
NODE_VERSION: 20.19.0
GOLANGCI_LINT_VERSION: v2.4.0
GOLANGCI_LINT_VERSION: v2.11.4
HELM_VERSION: 3.17.3

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_binary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'v*'

env:
GO_VERSION: 1.25.0
GO_VERSION: 1.26.2

jobs:
gh_release:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_pipedv1_exp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
permissions: {}

env:
GO_VERSION: 1.25.0
GO_VERSION: 1.26.2
GHCR: ghcr.io
GCR: gcr.io
HELM_VERSION: 3.8.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
GO_VERSION: 1.25.0
GO_VERSION: 1.26.2
NODE_VERSION: 20.19.0

jobs:
Expand Down
2 changes: 1 addition & 1 deletion cmd/helloworld/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.26.2 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion cmd/launcher/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.26.2 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion cmd/launcher/Dockerfile-okd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.26.2 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion cmd/pipecd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN make update/web-deps
RUN make build/web

# pipecd builder
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.26.2 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion cmd/pipecd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Prerequisites

- [Go 1.24 or later](https://go.dev/)
- [Go 1.26 or later](https://go.dev/)
- [NodeJS v20.19.0 or later](https://nodejs.org/en/)
- [Docker](https://www.docker.com/)
- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) (If you want to run Control Plane locally)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pipectl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.26.2 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion cmd/piped/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.26.2 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion cmd/piped/Dockerfile-okd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.26.2 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion cmd/piped/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Prerequisites

- [Go 1.24 or later](https://go.dev/)
- [Go 1.26 or later](https://go.dev/)

## Repositories
- [pipecd](https://github.com/pipe-cd/pipecd): contains all source code and documentation of PipeCD project.
Expand Down
2 changes: 1 addition & 1 deletion cmd/pipedv1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS builder
FROM --platform=$BUILDPLATFORM golang:1.26.2 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion cmd/pipedv1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ See [Overview of the Plan for Pluginnable PipeCD](https://pipecd.dev/blog/2024/1

## Prerequisites

- [Go 1.24 or later](https://go.dev/)
- [Go 1.26 or later](https://go.dev/)

## Repositories
- [pipecd](https://github.com/pipe-cd/pipecd): contains all source code and documentation of PipeCD project.
Expand Down
2 changes: 1 addition & 1 deletion docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.25.0-alpine3.22 AS builder
FROM golang:1.26.2-alpine3.22 AS builder
COPY main.go .
RUN go build -o /server main.go

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/pipe-cd/pipecd

go 1.25.0
go 1.26.2

require (
cloud.google.com/go/firestore v1.14.0
Expand Down
5 changes: 3 additions & 2 deletions pkg/app/ops/firestoreindexensurer/gcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ func (c *gcloud) createIndex(ctx context.Context, idx *index) error {
// For that, seems like additional permission is required. We have to look out for.

// Run gcloud command in async mode, which returns immediately without waiting for the operation in progress to complete.
args := []string{
args := make([]string, 0, 9+2*len(idx.Fields))
args = append(args,
"firestore", "indexes", "composite", "create",
"--async",
"--project", c.projectID,
"--collection-group", idx.CollectionGroup,
}
)
for _, f := range idx.Fields {
fieldCfg := fmt.Sprintf("field-path=%s", f.FieldPath)
if f.Order != "" {
Expand Down
8 changes: 4 additions & 4 deletions pkg/app/ops/firestoreindexensurer/indexes.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ func (idx *index) validate() error {
// id builds a unique string based on its fields.
func (idx *index) id() string {
var b strings.Builder
b.WriteString(fmt.Sprintf("%s/%s", idx.CollectionGroup, idx.QueryScope))
fmt.Fprintf(&b, "%s/%s", idx.CollectionGroup, idx.QueryScope)

fields := idx.Fields
for _, f := range fields {
b.WriteString(fmt.Sprintf("/field-path:%s", f.FieldPath))
fmt.Fprintf(&b, "/field-path:%s", f.FieldPath)
if f.Order != "" {
b.WriteString(fmt.Sprintf("/order:%s", f.Order))
fmt.Fprintf(&b, "/order:%s", f.Order)
}
if f.ArrayConfig != "" {
b.WriteString(fmt.Sprintf("/array-config:%s", f.ArrayConfig))
fmt.Fprintf(&b, "/array-config:%s", f.ArrayConfig)
}
}
return b.String()
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/controller/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ func (s *scheduler) executeStage(sig executor.StopSignal, ps model.PipelineStage
// Skip the stage if needed based on the skip config.
skip, err := s.shouldSkipStage(sig.Context(), input)
if err != nil {
lp.Errorf("failed to check whether skipping the stage: %w", err.Error())
lp.Errorf("failed to check whether skipping the stage: %s", err.Error())
if err := s.reportStageStatus(ctx, ps.Id, model.StageStatus_STAGE_FAILURE, ps.Requires); err != nil {
s.logger.Error("failed to report stage status", zap.Error(err))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/driftdetector/cloudrun/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func makeSyncState(r *provider.DiffResult, commit string) model.ApplicationSyncS
}

var b strings.Builder
b.WriteString(fmt.Sprintf("Diff between the defined state in Git at commit %s and actual live state:\n\n", commit))
fmt.Fprintf(&b, "Diff between the defined state in Git at commit %s and actual live state:\n\n", commit)
b.WriteString("--- Actual (LiveState)\n+++ Expected (Git)\n\n")

details := r.Render(provider.DiffRenderOptions{
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/driftdetector/ecs/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ func makeSyncState(r *provider.DiffResult, commit string) model.ApplicationSyncS
}

var b strings.Builder
b.WriteString(fmt.Sprintf("Diff between the defined state in Git at commit %s and actual live state:\n\n", commit))
fmt.Fprintf(&b, "Diff between the defined state in Git at commit %s and actual live state:\n\n", commit)
b.WriteString("--- Actual (LiveState)\n+++ Expected (Git)\n\n")

details := r.Render(provider.DiffRenderOptions{
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/driftdetector/kubernetes/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func makeSyncState(r *provider.DiffListResult, commit string) model.ApplicationS
}

var b strings.Builder
b.WriteString(fmt.Sprintf("Diff between the defined state in Git at commit %s and actual state in cluster:\n\n", commit))
fmt.Fprintf(&b, "Diff between the defined state in Git at commit %s and actual state in cluster:\n\n", commit)
b.WriteString("--- Actual (LiveState)\n+++ Expected (Git)\n\n")

details := r.Render(provider.DiffRenderOptions{
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/driftdetector/lambda/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func makeSyncState(r *provider.DiffResult, commit string) model.ApplicationSyncS
}

var b strings.Builder
b.WriteString(fmt.Sprintf("Diff between the defined state in Git at commit %s and actual live state:\n\n", commit))
fmt.Fprintf(&b, "Diff between the defined state in Git at commit %s and actual live state:\n\n", commit)
b.WriteString("--- Actual (LiveState)\n+++ Expected (Git)\n\n")

details := r.Render(provider.DiffRenderOptions{
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/driftdetector/terraform/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func makeSyncState(r provider.PlanResult, commit string) (*model.ApplicationSync
}

var b strings.Builder
b.WriteString(fmt.Sprintf("Diff between the defined state in Git at commit %s and actual live state:\n\n", commit))
fmt.Fprintf(&b, "Diff between the defined state in Git at commit %s and actual live state:\n\n", commit)
b.WriteString("--- Actual (LiveState)\n+++ Expected (Git)\n\n")

details, err := r.Render()
Expand Down
4 changes: 2 additions & 2 deletions pkg/app/piped/planner/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,10 @@ func determineVersion(manifests []provider.Manifest) (string, error) {
// In case multiple containers are used
// return version in format: "tag-1 (name-1), tag-2 (name-2)"
var b strings.Builder
b.WriteString(fmt.Sprintf("%s (%s)", images[0].tag, images[0].name))
fmt.Fprintf(&b, "%s (%s)", images[0].tag, images[0].name)

for _, img := range images[1:] {
b.WriteString(fmt.Sprintf(", %s (%s)", img.tag, img.name))
fmt.Fprintf(&b, ", %s (%s)", img.tag, img.name)
}

return b.String(), nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/platformprovider/cloudrun/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (d *DiffResult) Render(opt DiffRenderOptions) string {
} else {
d, err := diffByCommand(diffCommand, d.Old, d.New)
if err != nil {
b.WriteString(fmt.Sprintf("An error occurred while rendering diff (%v)", err))
fmt.Fprintf(&b, "An error occurred while rendering diff (%v)", err)
} else {
b.Write(d)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/platformprovider/ecs/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (d *DiffResult) Render(opt DiffRenderOptions) string {
} else {
d, err := renderByCommand(diffCommand, d.Old, d.New)
if err != nil {
b.WriteString(fmt.Sprintf("An error occurred while rendering diff (%v)", err))
fmt.Fprintf(&b, "An error occurred while rendering diff (%v)", err)
} else {
b.Write(d)
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/app/piped/platformprovider/kubernetes/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ func (r *DiffListResult) Render(opt DiffRenderOptions) string {
index := 0
for _, delete := range r.Deletes {
index++
b.WriteString(fmt.Sprintf("- %d. %s\n\n", index, delete.Key.ReadableString()))
fmt.Fprintf(&b, "- %d. %s\n\n", index, delete.Key.ReadableString())
}
for _, add := range r.Adds {
index++
b.WriteString(fmt.Sprintf("+ %d. %s\n\n", index, add.Key.ReadableString()))
fmt.Fprintf(&b, "+ %d. %s\n\n", index, add.Key.ReadableString())
}

maxPrintDiffs := len(r.Changes)
Expand All @@ -180,7 +180,7 @@ func (r *DiffListResult) Render(opt DiffRenderOptions) string {
renderer := diff.NewRenderer(opts...)

index++
b.WriteString(fmt.Sprintf("# %d. %s\n\n", index, key.ReadableString()))
fmt.Fprintf(&b, "# %d. %s\n\n", index, key.ReadableString())

// Use our diff check in one of the following cases:
// - not explicit set useDiffCommand option.
Expand All @@ -191,7 +191,7 @@ func (r *DiffListResult) Render(opt DiffRenderOptions) string {
// TODO: Find a way to mask values in case of using unix `diff` command.
d, err := diffByCommand(diffCommand, change.Old, change.New)
if err != nil {
b.WriteString(fmt.Sprintf("An error occurred while rendering diff (%v)", err))
fmt.Fprintf(&b, "An error occurred while rendering diff (%v)", err)
} else {
b.Write(d)
}
Expand All @@ -205,7 +205,7 @@ func (r *DiffListResult) Render(opt DiffRenderOptions) string {
}

if prints < len(r.Changes) {
b.WriteString(fmt.Sprintf("... (omitted %d other changed manifests\n", len(r.Changes)-prints))
fmt.Fprintf(&b, "... (omitted %d other changed manifests\n", len(r.Changes)-prints)
}

return b.String()
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/platformprovider/lambda/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (c *client) CreateFunction(ctx context.Context, fm FunctionManifest) error
Layers: fm.Spec.Layers,
}
if len(fm.Spec.Architectures) != 0 {
var architectures []types.Architecture
architectures := make([]types.Architecture, 0, len(fm.Spec.Architectures))
for _, arch := range fm.Spec.Architectures {
architectures = append(architectures, types.Architecture(arch.Name))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/platformprovider/lambda/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (d *DiffResult) Render(opt DiffRenderOptions) string {
} else {
d, err := diff.RenderByCommand(diffCommand, d.Old, d.New)
if err != nil {
b.WriteString(fmt.Sprintf("An error occurred while rendering diff (%v)", err))
fmt.Fprintf(&b, "An error occurred while rendering diff (%v)", err)
} else {
b.Write(d)
}
Expand Down
28 changes: 12 additions & 16 deletions pkg/app/piped/platformprovider/terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ func (t *Terraform) Version(ctx context.Context) (string, error) {
}

func (t *Terraform) Init(ctx context.Context, w io.Writer) error {
args := []string{
"init",
}
args = append(args, t.makeCommonCommandArgs()...)
commonArgs := t.makeCommonCommandArgs()
args := make([]string, 0, 1+len(commonArgs)+len(t.options.initFlags))
args = append(args, "init")
args = append(args, commonArgs...)
args = append(args, t.options.initFlags...)

cmd := exec.CommandContext(ctx, t.execPath, args...)
Expand Down Expand Up @@ -274,12 +274,10 @@ func GetExitCode(err error) int {
}

func (t *Terraform) Plan(ctx context.Context, w io.Writer) (PlanResult, error) {
args := []string{
"plan",
"-lock=false",
"-detailed-exitcode",
}
args = append(args, t.makeCommonCommandArgs()...)
commonArgs := t.makeCommonCommandArgs()
args := make([]string, 0, 3+len(commonArgs)+len(t.options.planFlags))
args = append(args, "plan", "-lock=false", "-detailed-exitcode")
args = append(args, commonArgs...)
args = append(args, t.options.planFlags...)

var buf bytes.Buffer
Expand Down Expand Up @@ -390,12 +388,10 @@ func parsePlanResult(out string, ansiIncluded bool) (PlanResult, error) {
}

func (t *Terraform) Apply(ctx context.Context, w io.Writer) error {
args := []string{
"apply",
"-auto-approve",
"-input=false",
}
args = append(args, t.makeCommonCommandArgs()...)
commonArgs := t.makeCommonCommandArgs()
args := make([]string, 0, 3+len(commonArgs)+len(t.options.applyFlags))
args = append(args, "apply", "-auto-approve", "-input=false")
args = append(args, commonArgs...)
args = append(args, t.options.applyFlags...)

cmd := exec.CommandContext(ctx, t.execPath, args...)
Expand Down
4 changes: 2 additions & 2 deletions pkg/app/piped/trigger/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func (t *Trigger) listCommandCandidates() []candidate {
func (t *Trigger) listOutOfSyncCandidates() []candidate {
var (
list = t.applicationLister.List()
apps = make([]candidate, 0)
apps = make([]candidate, 0, len(list))
)
for _, app := range list {
if !app.IsOutOfSync() {
Expand All @@ -432,7 +432,7 @@ func (t *Trigger) listOutOfSyncCandidates() []candidate {
func (t *Trigger) listCommitCandidates() []candidate {
var (
list = t.applicationLister.List()
apps = make([]candidate, 0)
apps = make([]candidate, 0, len(list))
)
for _, app := range list {
apps = append(apps, candidate{
Expand Down
Loading
Loading