Skip to content

Commit

Permalink
Change MakeTarget to GadgetTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
jawn-smith committed Mar 17, 2023
1 parent 027fa8d commit 0835665
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/imagedefinition/image_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type ImageDefinition struct {
// Gadget defines the gadget section of the image definition file
type Gadget struct {
Ref string `yaml:"ref" json:"Ref,omitempty"`
MakeTarget string `yaml:"target" json:"MakeTarget,omitempty"`
GadgetTarget string `yaml:"target" json:"GadgetTarget,omitempty"`
GadgetBranch string `yaml:"branch" json:"GadgetBranch,omitempty"`
GadgetType string `yaml:"type" json:"GadgetType" jsonschema:"enum=git,enum=directory,enum=prebuilt"`
GadgetURL string `yaml:"url" json:"GadgetURL,omitempty" jsonschema:"type=string,format=uri"`
Expand Down
4 changes: 2 additions & 2 deletions internal/statemachine/classic_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ func (stateMachine *StateMachine) buildGadgetTree() error {
makeCmd := execCommand("make")

// if a make target was specified then add it to the command
if classicStateMachine.ImageDef.Gadget.MakeTarget != "" {
makeCmd.Args = append(makeCmd.Args, classicStateMachine.ImageDef.Gadget.MakeTarget)
if classicStateMachine.ImageDef.Gadget.GadgetTarget != "" {
makeCmd.Args = append(makeCmd.Args, classicStateMachine.ImageDef.Gadget.GadgetTarget)
}

// add ARCH and SERIES environment variables for making the gadget tree
Expand Down
10 changes: 5 additions & 5 deletions internal/statemachine/classic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2265,8 +2265,8 @@ func TestBuildGadgetTree(t *testing.T) {
})
}

// TestGadgetMakeTargets tests using alternate make targets with gadget builds
func TestGadgetMakeTargets(t *testing.T) {
// TestGadgetGadgetTargets tests using alternate make targets with gadget builds
func TestGadgetGadgetTargets(t *testing.T) {
testCases := []struct {
name string
target string
Expand Down Expand Up @@ -2304,9 +2304,9 @@ func TestGadgetMakeTargets(t *testing.T) {
Architecture: getHostArch(),
Series: getHostSuite(),
Gadget: &imagedefinition.Gadget{
GadgetURL: fmt.Sprintf("file://%s", gadgetSrc),
GadgetType: "directory",
MakeTarget: tc.target,
GadgetURL: fmt.Sprintf("file://%s", gadgetSrc),
GadgetType: "directory",
GadgetTarget: tc.target,
},
}
stateMachine.ImageDef = imageDef
Expand Down

0 comments on commit 0835665

Please sign in to comment.