-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Task-level actions for job submissions and retrieval * FIXME: Temporary workaround to get ember dev server to pass exec through to 4646 * Update api/tasks.go Co-authored-by: Tim Gross <[email protected]> * Update command/agent/job_endpoint.go Co-authored-by: Tim Gross <[email protected]> * Diff and copy implementations * Action structs get their own file, diff updates to behave like our other diffs * Test to observe actions changes in a version update * Tests migrated into structs/diff_test and modified with PR comments in mind * APIActionToSTructsAction now returns a new value * de-comment some plain parts, remove unused action lookup * unused param in action converter --------- Co-authored-by: Tim Gross <[email protected]>
- Loading branch information
1 parent
7267be7
commit a0a56c9
Showing
13 changed files
with
389 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ var ( | |
"kind", | ||
"volume_mount", | ||
"csi_plugin", | ||
"actions", | ||
) | ||
|
||
sidecarTaskKeys = append(commonTaskKeys, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
|
||
// Actions are executable commands that can be run on an allocation within | ||
// the context of a task. They are left open-ended enough to be applied to | ||
// other Nomad concepts like Nodes in the future. | ||
|
||
package structs | ||
|
||
import "slices" | ||
|
||
type Action struct { | ||
Name string | ||
Command string | ||
Args []string | ||
} | ||
|
||
func (a *Action) Copy() *Action { | ||
if a == nil { | ||
return nil | ||
} | ||
na := new(Action) | ||
*na = *a | ||
na.Args = slices.Clone(a.Args) | ||
return na | ||
} | ||
|
||
func (a *Action) Equal(o *Action) bool { | ||
if a == o { | ||
return true | ||
} | ||
if a == nil || o == nil { | ||
return false | ||
} | ||
return a.Name == o.Name && | ||
a.Command == o.Command && | ||
slices.Equal(a.Args, o.Args) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.