Skip to content
Open
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
26 changes: 13 additions & 13 deletions fn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters"
}`),
},
Expand All @@ -63,7 +63,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellCommand": ""
}`),
Expand All @@ -88,7 +88,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellCommand": "echo foo",
"stdoutField": "spec.atFunction.shell.stdout"
Expand Down Expand Up @@ -129,7 +129,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellCommand": "set -euo pìpefail",
"stdoutField": "status.atFunction.shell.stdout",
Expand Down Expand Up @@ -173,7 +173,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellCommand": "unknown-shell-command",
"stdoutField": "status.atFunction.shell.stdout",
Expand Down Expand Up @@ -217,7 +217,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellCommand": "echo 'success output'; echo 'error output' >&2; exit 1",
"stdoutField": "status.atFunction.shell.stdout",
Expand Down Expand Up @@ -260,7 +260,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellEnvVars": [{"key": "TEST_ENV_VAR", "value": "foo"}],
"shellCommand": "echo ${TEST_ENV_VAR}",
Expand Down Expand Up @@ -302,7 +302,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellEnvVars": [{"key": "TEST_ENV_VAR", "fieldRef":{"path": "spec.foo", "policy": "Required"}, "type": "FieldRef"}],
"shellCommand": "echo ${TEST_ENV_VAR}",
Expand Down Expand Up @@ -355,7 +355,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellEnvVars": [{"key": "TEST_ENV_VAR", "fieldRef":{"path": "spec.bad", "policy": "Optional", "defaultValue": "default"}, "type": "FieldRef"}],
"shellCommand": "echo ${TEST_ENV_VAR}",
Expand Down Expand Up @@ -397,7 +397,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellEnvVars": [{"key": "TEST_ENV_VAR", "value": "foo", "type": "bad"}],
"shellCommand": "echo ${TEST_ENV_VAR}",
Expand All @@ -424,7 +424,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellEnvVars": [{"key": "TEST_ENV_VAR", "fieldRef":{"policy": "Optional", "defaultValue": "default"}, "type": "FieldRef"}],
"shellCommand": "echo ${TEST_ENV_VAR}",
Expand All @@ -451,7 +451,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellCommand": "echo test",
"cacheTTL": "5m",
Expand Down Expand Up @@ -493,7 +493,7 @@ func TestRunFunction(t *testing.T) {
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Input: resource.MustStructJSON(`{
"apiVersion": "template.fn.crossplane.io/v1alpha1",
"apiVersion": "shell.fn.crossplane.io/v1alpha1",
"kind": "Parameters",
"shellCommand": "echo test",
"cacheTTL": "5x",
Expand Down
2 changes: 1 addition & 1 deletion input/v1alpha1/parameters.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package v1alpha1 contains the input type for this Function
// +kubebuilder:object:generate=true
// +groupName=template.fn.crossplane.io
// +groupName=shell.fn.crossplane.io
// +versionName=v1alpha1
package v1alpha1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.18.0
name: parameters.template.fn.crossplane.io
name: parameters.shell.fn.crossplane.io
spec:
group: template.fn.crossplane.io
group: shell.fn.crossplane.io
names:
categories:
- crossplane
Expand Down
Loading