forked from argoproj/argo-events
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Artifacts can now be inline with the sensor yaml. See ./examples/inline-sensor.yaml as an example. Refs argoproj#41
- Loading branch information
Showing
9 changed files
with
306 additions
and
194 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Sensor | ||
metadata: | ||
name: inline-example | ||
labels: | ||
sensors.argoproj.io/controller-instanceid: axis | ||
spec: | ||
signals: | ||
- name: time | ||
calendar: | ||
interval: 10s | ||
triggers: | ||
- name: inline-workflow-trigger | ||
resource: | ||
namespace: default | ||
group: argoproj.io | ||
version: v1alpha1 | ||
kind: Workflow | ||
artifactLocation: | ||
inline: | | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: hello-world- | ||
spec: | ||
entrypoint: whalesay | ||
templates: | ||
- | ||
container: | ||
args: | ||
- "hello world" | ||
command: | ||
- cowsay | ||
image: "docker/whalesay:latest" | ||
name: whalesay |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package store | ||
|
||
// InlineReader implements the ArtifactReader interface for inlined artifacts | ||
type InlineReader struct { | ||
inlineArtifact string | ||
} | ||
|
||
// NewInlineReader creates a new ArtifactReader for inline | ||
func NewInlineReader(inlineArtifact string) (ArtifactReader, error) { | ||
// TODO(shri): Add logging here | ||
return &InlineReader{inlineArtifact}, nil | ||
} | ||
|
||
func (reader *InlineReader) Read() ([]byte, error) { | ||
return []byte(reader.inlineArtifact), nil | ||
} |
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,18 @@ | ||
package store | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestInlineReader(t *testing.T) { | ||
myStr := "myStr" | ||
inlineReader, err := NewInlineReader(myStr) | ||
assert.NotNil(t, inlineReader) | ||
assert.Nil(t, err) | ||
data, err := inlineReader.Read() | ||
assert.NotNil(t, data) | ||
assert.Nil(t, err) | ||
assert.Equal(t, string(data), myStr) | ||
} |
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