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 Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# docker build -t target/vela-cli:latest . #
#################################################

FROM alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
FROM alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659

RUN apk add --update --no-cache ca-certificates

Expand Down
5 changes: 2 additions & 3 deletions action/config/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
yaml "go.yaml.in/yaml/v3"

"github.com/go-vela/cli/internal"
"github.com/go-vela/sdk-go/vela"
)

// Update modifies one or more fields from the config file based off the provided configuration.
Expand Down Expand Up @@ -149,9 +148,9 @@ func (c *Config) Update() error {
if strings.EqualFold(key, internal.FlagColor) {
// set the color field to value provided
if value == "true" {
config.Color = vela.Bool(true)
config.Color = new(true)
} else {
config.Color = vela.Bool(false)
config.Color = new(false)
}
}

Expand Down
2 changes: 1 addition & 1 deletion action/dashboard/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *Config) Add(ctx context.Context, client *vela.Client) error {

// create the dashboard object
d := &api.Dashboard{
Name: vela.String(c.Name),
Name: new(c.Name),
Repos: &dashRepos,
Admins: &dashAdmins,
}
Expand Down
32 changes: 16 additions & 16 deletions action/repo/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ func (c *Config) Add(ctx context.Context, client *vela.Client) error {
//
// https://pkg.go.dev/github.com/go-vela/server/api/types?tab=doc#Repo
r := &api.Repo{
Org: vela.String(c.Org),
Name: vela.String(c.Name),
FullName: vela.String(fmt.Sprintf("%s/%s", c.Org, c.Name)),
Link: vela.String(c.Link),
Clone: vela.String(c.Clone),
Branch: vela.String(c.Branch),
BuildLimit: vela.Int32(c.BuildLimit),
Timeout: vela.Int32(c.Timeout),
Counter: vela.Int64(c.Counter),
Visibility: vela.String(c.Visibility),
Private: vela.Bool(c.Private),
Trusted: vela.Bool(c.Trusted),
Active: vela.Bool(c.Active),
PipelineType: vela.String(c.PipelineType),
ApproveBuild: vela.String(c.ApproveBuild),
MergeQueueEvents: vela.Strings(c.MergeQueueEvents),
Org: new(c.Org),
Name: new(c.Name),
FullName: new(fmt.Sprintf("%s/%s", c.Org, c.Name)),
Link: new(c.Link),
Clone: new(c.Clone),
Branch: new(c.Branch),
BuildLimit: new(c.BuildLimit),
Timeout: new(c.Timeout),
Counter: new(c.Counter),
Visibility: new(c.Visibility),
Private: new(c.Private),
Trusted: new(c.Trusted),
Active: new(c.Active),
PipelineType: new(c.PipelineType),
ApproveBuild: new(c.ApproveBuild),
MergeQueueEvents: new(c.MergeQueueEvents),
}

logrus.Tracef("adding repo %s/%s", c.Org, c.Name)
Expand Down
32 changes: 16 additions & 16 deletions action/repo/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ func (c *Config) Update(ctx context.Context, client *vela.Client) error {
//
// https://pkg.go.dev/github.com/go-vela/server/api/types?tab=doc#Repo
r := &api.Repo{
Org: vela.String(c.Org),
Name: vela.String(c.Name),
FullName: vela.String(fmt.Sprintf("%s/%s", c.Org, c.Name)),
Link: vela.String(c.Link),
Clone: vela.String(c.Clone),
Branch: vela.String(c.Branch),
BuildLimit: vela.Int32(c.BuildLimit),
Timeout: vela.Int32(c.Timeout),
Counter: vela.Int64(c.Counter),
Visibility: vela.String(c.Visibility),
Private: vela.Bool(c.Private),
Trusted: vela.Bool(c.Trusted),
Active: vela.Bool(c.Active),
PipelineType: vela.String(c.PipelineType),
ApproveBuild: vela.String(c.ApproveBuild),
MergeQueueEvents: vela.Strings(c.MergeQueueEvents),
Org: new(c.Org),
Name: new(c.Name),
FullName: new(fmt.Sprintf("%s/%s", c.Org, c.Name)),
Link: new(c.Link),
Clone: new(c.Clone),
Branch: new(c.Branch),
BuildLimit: new(c.BuildLimit),
Timeout: new(c.Timeout),
Counter: new(c.Counter),
Visibility: new(c.Visibility),
Private: new(c.Private),
Trusted: new(c.Trusted),
Active: new(c.Active),
PipelineType: new(c.PipelineType),
ApproveBuild: new(c.ApproveBuild),
MergeQueueEvents: new(c.MergeQueueEvents),
}

if len(c.Events) > 0 {
Expand Down
8 changes: 4 additions & 4 deletions action/schedule/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ func (c *Config) Add(ctx context.Context, client *vela.Client) error {

// create the schedule object
s := &api.Schedule{
Active: vela.Bool(c.Active),
Name: vela.String(c.Name),
Entry: vela.String(c.Entry),
Branch: vela.String(c.Branch),
Active: new(c.Active),
Name: new(c.Name),
Entry: new(c.Entry),
Branch: new(c.Branch),
}

logrus.Tracef("adding schedule %s/%s/%s", c.Org, c.Repo, c.Name)
Expand Down
8 changes: 4 additions & 4 deletions action/schedule/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ func (c *Config) Update(ctx context.Context, client *vela.Client) error {

// create the schedule object
s := &api.Schedule{
Active: vela.Bool(c.Active),
Name: vela.String(c.Name),
Entry: vela.String(c.Entry),
Branch: vela.String(c.Branch),
Active: new(c.Active),
Name: new(c.Name),
Entry: new(c.Entry),
Branch: new(c.Branch),
}

logrus.Tracef("updating schedule %s/%s/%s", c.Org, c.Repo, c.Name)
Expand Down
12 changes: 6 additions & 6 deletions action/settings/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *Config) Update(ctx context.Context, client *vela.Client) error {
// create the settings object
sUpdate := &settings.Platform{
Queue: &settings.Queue{
Routes: vela.Strings(s.GetRoutes()),
Routes: new(s.GetRoutes()),
},
Compiler: &settings.Compiler{
CloneImage: c.CloneImage,
Expand All @@ -44,8 +44,8 @@ func (c *Config) Update(ctx context.Context, client *vela.Client) error {
OrgRoleMap: c.OrgRoleMap,
TeamRoleMap: c.TeamRoleMap,
},
RepoAllowlist: vela.Strings(s.GetRepoAllowlist()),
ScheduleAllowlist: vela.Strings(s.GetScheduleAllowlist()),
RepoAllowlist: new(s.GetRepoAllowlist()),
ScheduleAllowlist: new(s.GetScheduleAllowlist()),
}

// update max dashboard repos if set
Expand Down Expand Up @@ -227,15 +227,15 @@ func (c *Config) UpdateFromFile(ctx context.Context, client *vela.Client) error
// update values if set
if f.Compiler != nil {
if f.CloneImage != nil {
s.CloneImage = vela.String(f.GetCloneImage())
s.CloneImage = new(f.GetCloneImage())
}

if f.TemplateDepth != nil {
s.TemplateDepth = vela.Int(f.GetTemplateDepth())
s.TemplateDepth = new(f.GetTemplateDepth())
}

if f.StarlarkExecLimit != nil {
s.StarlarkExecLimit = vela.Int64(f.GetStarlarkExecLimit())
s.StarlarkExecLimit = new(f.GetStarlarkExecLimit())
}
}

Expand Down
6 changes: 3 additions & 3 deletions action/settings/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ func TestSettings_Config_Update(t *testing.T) {
Action: "update",
Output: "",
Compiler: Compiler{
CloneImage: vela.String("test"),
TemplateDepth: vela.Int(1),
StarlarkExecLimit: vela.Int64(1),
CloneImage: new("test"),
TemplateDepth: new(1),
StarlarkExecLimit: new(int64(1)),
},
},
},
Expand Down
10 changes: 4 additions & 6 deletions action/settings/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ package settings

import (
"testing"

"github.com/go-vela/sdk-go/vela"
)

func TestSettings_Config_Validate(t *testing.T) {
Expand All @@ -19,7 +17,7 @@ func TestSettings_Config_Validate(t *testing.T) {
config: &Config{
Action: "update",
Compiler: Compiler{
CloneImage: vela.String("test"),
CloneImage: new("test"),
},
Output: "",
},
Expand All @@ -29,7 +27,7 @@ func TestSettings_Config_Validate(t *testing.T) {
config: &Config{
Action: "update",
Compiler: Compiler{
TemplateDepth: vela.Int(1),
TemplateDepth: new(1),
},
Output: "",
},
Expand All @@ -39,7 +37,7 @@ func TestSettings_Config_Validate(t *testing.T) {
config: &Config{
Action: "update",
Compiler: Compiler{
StarlarkExecLimit: vela.Int64(1),
StarlarkExecLimit: new(int64(1)),
},
Output: "",
},
Expand All @@ -59,7 +57,7 @@ func TestSettings_Config_Validate(t *testing.T) {
config: &Config{
Action: "update",
Queue: Queue{
Routes: vela.Strings([]string{"test"}),
Routes: new([]string{"test"}),
},
Output: "",
},
Expand Down
8 changes: 4 additions & 4 deletions action/worker/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ func (c *Config) Update(ctx context.Context, client *vela.Client) error {

// create the worker object
w := &api.Worker{
Hostname: vela.String(c.Hostname),
Address: vela.String(c.Address),
Hostname: new(c.Hostname),
Address: new(c.Address),
Active: c.Active,
Routes: vela.Strings(c.Routes),
BuildLimit: vela.Int32(c.BuildLimit),
Routes: new(c.Routes),
BuildLimit: new(c.BuildLimit),
}

logrus.Tracef("updating worker %s", c.Hostname)
Expand Down
4 changes: 2 additions & 2 deletions command/pipeline/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ var CommandExec = &cli.Command{
Sources: cli.EnvVars("VELA_CLONE_IMAGE", "COMPILER_CLONE_IMAGE"),
Name: "clone-image",
Usage: "the clone image to use for the injected clone step",
Value: "docker.io/target/vela-git-slim:v0.12.1@sha256:93cdb399e0a3150addac494198473c464c978ca055121593607097b75480192b", // renovate: container
Value: "docker.io/target/vela-git-slim:v0.14.0@sha256:592b6f0607912380ed61c79dcfca8145509a7d0f49b0839d9132095f5797668c", // renovate: container
},
&cli.StringFlag{
Sources: cli.EnvVars("VELA_OUTPUTS_IMAGE", "EXECUTOR_OUTPUTS_IMAGE"),
Name: "outputs-image",
Usage: "the outputs image to use for the build",
Value: "docker.io/library/alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1", // renovate: container
Value: "docker.io/library/alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659", // renovate: container
},

// Environment Flags
Expand Down
2 changes: 1 addition & 1 deletion command/pipeline/testdata/.vela.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ version: "1"

steps:
- name: hello
image: alpine@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
image: alpine@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659
commands:
- echo "Hello, world!"
2 changes: 1 addition & 1 deletion command/pipeline/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ var CommandValidate = &cli.Command{
Sources: cli.EnvVars("VELA_CLONE_IMAGE", "COMPILER_CLONE_IMAGE"),
Name: "clone-image",
Usage: "the clone image to use for the injected clone step",
Value: "docker.io/target/vela-git-slim:v0.12.1@sha256:93cdb399e0a3150addac494198473c464c978ca055121593607097b75480192b", // renovate: container
Value: "docker.io/target/vela-git-slim:v0.14.0@sha256:592b6f0607912380ed61c79dcfca8145509a7d0f49b0839d9132095f5797668c", // renovate: container
Category: "4. Compiler:",
},
},
Expand Down
7 changes: 3 additions & 4 deletions command/settings/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/go-vela/cli/action/settings"
"github.com/go-vela/cli/internal"
"github.com/go-vela/cli/internal/client"
"github.com/go-vela/sdk-go/vela"
"github.com/go-vela/server/util"
)

Expand Down Expand Up @@ -217,15 +216,15 @@ func update(ctx context.Context, c *cli.Command) error {

// compiler
if c.IsSet(CompilerCloneImageKey) {
s.CloneImage = vela.String(c.String(CompilerCloneImageKey))
s.CloneImage = new(c.String(CompilerCloneImageKey))
}

if c.IsSet(CompilerTemplateDepthKey) {
s.TemplateDepth = vela.Int(c.Int(CompilerTemplateDepthKey))
s.TemplateDepth = new(c.Int(CompilerTemplateDepthKey))
}

if c.IsSet(CompilerStarlarkExecLimitKey) {
s.StarlarkExecLimit = vela.Int64(c.Int64(CompilerStarlarkExecLimitKey))
s.StarlarkExecLimit = new(c.Int64(CompilerStarlarkExecLimitKey))
}

// scm
Expand Down
Loading
Loading