Skip to content

Commit

Permalink
fix nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
zc2638 committed Mar 30, 2024
1 parent 92f8c04 commit b8eb09d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions core/worker/hooks/docker/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ func toHostConfig(spec *worker.Workflow, step *worker.Step) *container.HostConfi
Type: "json-file",
},
}
// windows do not support privileged, so we hard-code
// this value to false.
if spec.Worker != nil && spec.Worker.Platform.OS == "windows" {

// windows do not support privileged,
// so we hard-code this value to false.
if spec.Worker != nil && spec.Worker.Platform != nil && spec.Worker.Platform.OS == "windows" {
config.Privileged = false
}
if len(step.Network) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion core/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func execute(

secretValueSet := sets.New[string]()
for _, secret := range secrets {
if err := secret.Decrypt(); err == nil {
if err := secret.Decrypt(); err != nil {
status.Phase = v1.PhaseFailed
status.Error = err.Error()
for _, step := range status.Steps {
Expand Down

0 comments on commit b8eb09d

Please sign in to comment.