forked from argoproj/argo-workflows
-
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.
fix(controller): Adds PNS_PRIVILEGED, fixed termination bug (argoproj…
…#4983) Signed-off-by: Alex Collins <[email protected]>
- Loading branch information
Showing
40 changed files
with
566 additions
and
556 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ run: | |
- api | ||
- cli | ||
- cron | ||
- e2e | ||
- smoke | ||
- executor | ||
- functional | ||
linters: | ||
enable: | ||
- goimports | ||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
controller: DEFAULT_REQUEUE_TIME=${DEFAULT_REQUEUE_TIME} LEADER_ELECTION_IDENTITY=local ALWAYS_OFFLOAD_NODE_STATUS=${ALWAYS_OFFLOAD_NODE_STATUS} OFFLOAD_NODE_STATUS_TTL=30s WORKFLOW_GC_PERIOD=30s UPPERIO_DB_DEBUG=${UPPERIO_DB_DEBUG} ARCHIVED_WORKFLOW_GC_PERIOD=30s ./dist/workflow-controller --executor-image argoproj/argoexec:${VERSION} --namespaced=${NAMESPACED} --namespace ${NAMESPACE} --loglevel ${LOG_LEVEL} | ||
controller: PNS_PRIVILEGED=true DEFAULT_REQUEUE_TIME=${DEFAULT_REQUEUE_TIME} LEADER_ELECTION_IDENTITY=local ALWAYS_OFFLOAD_NODE_STATUS=${ALWAYS_OFFLOAD_NODE_STATUS} OFFLOAD_NODE_STATUS_TTL=30s WORKFLOW_GC_PERIOD=30s UPPERIO_DB_DEBUG=${UPPERIO_DB_DEBUG} ARCHIVED_WORKFLOW_GC_PERIOD=30s ./dist/workflow-controller --executor-image ${IMAGE_NAMESPACE}/argoexec:${VERSION} --namespaced=${NAMESPACED} --namespace ${NAMESPACE} --loglevel ${LOG_LEVEL} | ||
argo-server: UPPERIO_DB_DEBUG=${UPPERIO_DB_DEBUG} ./dist/argo --loglevel ${LOG_LEVEL} server --namespaced=${NAMESPACED} --namespace ${NAMESPACE} --auth-mode ${AUTH_MODE} --secure=$SECURE --x-frame-options=SAMEORIGIN | ||
ui: yarn --cwd ui install && yarn --cwd ui start |
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,155 @@ | ||
// +build executor | ||
|
||
package e2e | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/suite" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
wfv1 "github.com/argoproj/argo/v2/pkg/apis/workflow/v1alpha1" | ||
"github.com/argoproj/argo/v2/test/e2e/fixtures" | ||
) | ||
|
||
type ArtifactsSuite struct { | ||
fixtures.E2ESuite | ||
} | ||
|
||
func (s *ArtifactsSuite) TestInputOnMount() { | ||
s.Given(). | ||
Workflow("@testdata/input-on-mount-workflow.yaml"). | ||
When(). | ||
SubmitWorkflow(). | ||
WaitForWorkflow(). | ||
Then(). | ||
ExpectWorkflow(func(t *testing.T, _ *metav1.ObjectMeta, status *wfv1.WorkflowStatus) { | ||
assert.Equal(t, wfv1.WorkflowSucceeded, status.Phase) | ||
}) | ||
} | ||
|
||
func (s *ArtifactsSuite) TestOutputOnMount() { | ||
s.Given(). | ||
Workflow("@testdata/output-on-mount-workflow.yaml"). | ||
When(). | ||
SubmitWorkflow(). | ||
WaitForWorkflow(). | ||
Then(). | ||
ExpectWorkflow(func(t *testing.T, _ *metav1.ObjectMeta, status *wfv1.WorkflowStatus) { | ||
assert.Equal(t, wfv1.WorkflowSucceeded, status.Phase) | ||
}) | ||
} | ||
|
||
func (s *ArtifactsSuite) TestOutputOnInput() { | ||
s.Need(fixtures.BaseLayerArtifacts) // I believe this would work on both K8S and Kubelet, not validation does not allow it | ||
s.Given(). | ||
Workflow("@testdata/output-on-input-workflow.yaml"). | ||
When(). | ||
SubmitWorkflow(). | ||
WaitForWorkflow(). | ||
Then(). | ||
ExpectWorkflow(func(t *testing.T, _ *metav1.ObjectMeta, status *wfv1.WorkflowStatus) { | ||
assert.Equal(t, wfv1.WorkflowSucceeded, status.Phase) | ||
}) | ||
} | ||
|
||
func (s *ArtifactsSuite) TestArtifactPassing() { | ||
s.Need(fixtures.BaseLayerArtifacts) | ||
s.Given(). | ||
Workflow("@smoke/artifact-passing.yaml"). | ||
When(). | ||
SubmitWorkflow(). | ||
WaitForWorkflow(). | ||
Then(). | ||
ExpectWorkflow(func(t *testing.T, _ *metav1.ObjectMeta, status *wfv1.WorkflowStatus) { | ||
assert.Equal(t, wfv1.WorkflowSucceeded, status.Phase) | ||
}) | ||
} | ||
|
||
func (s *ArtifactsSuite) TestDefaultParameterOutputs() { | ||
s.Need(fixtures.BaseLayerArtifacts) | ||
s.Need(fixtures.None(fixtures.PNS)) | ||
s.Given(). | ||
Workflow(` | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
name: default-params | ||
labels: | ||
argo-e2e: true | ||
spec: | ||
entrypoint: start | ||
templates: | ||
- name: start | ||
steps: | ||
- - name: generate-1 | ||
template: generate | ||
- - name: generate-2 | ||
when: "True == False" | ||
template: generate | ||
outputs: | ||
parameters: | ||
- name: nested-out-parameter | ||
valueFrom: | ||
default: "Default value" | ||
parameter: "{{steps.generate-2.outputs.parameters.out-parameter}}" | ||
- name: generate | ||
container: | ||
image: argoproj/argosay:v2 | ||
args: [echo, my-output-parameter, /tmp/my-output-parameter.txt] | ||
outputs: | ||
parameters: | ||
- name: out-parameter | ||
valueFrom: | ||
path: /tmp/my-output-parameter.txt | ||
`). | ||
When(). | ||
SubmitWorkflow(). | ||
WaitForWorkflow(). | ||
Then(). | ||
ExpectWorkflow(func(t *testing.T, _ *metav1.ObjectMeta, status *wfv1.WorkflowStatus) { | ||
assert.Equal(t, wfv1.WorkflowSucceeded, status.Phase) | ||
assert.True(t, status.Nodes.Any(func(node wfv1.NodeStatus) bool { | ||
if node.Outputs != nil { | ||
for _, param := range node.Outputs.Parameters { | ||
if param.Value != nil && param.Value.String() == "Default value" { | ||
return true | ||
} | ||
} | ||
} | ||
return false | ||
})) | ||
}) | ||
} | ||
|
||
func (s *ArtifactsSuite) TestSameInputOutputPathOptionalArtifact() { | ||
s.Need(fixtures.BaseLayerArtifacts) | ||
s.Given(). | ||
Workflow("@testdata/same-input-output-path-optional.yaml"). | ||
When(). | ||
SubmitWorkflow(). | ||
WaitForWorkflow(). | ||
Then(). | ||
ExpectWorkflow(func(t *testing.T, _ *metav1.ObjectMeta, status *wfv1.WorkflowStatus) { | ||
assert.Equal(t, wfv1.WorkflowSucceeded, status.Phase) | ||
}) | ||
} | ||
|
||
func (s *ArtifactsSuite) TestOutputArtifactS3BucketCreationEnabled() { | ||
s.Need(fixtures.BaseLayerArtifacts) | ||
s.Given(). | ||
Workflow("@testdata/output-artifact-with-s3-bucket-creation-enabled.yaml"). | ||
When(). | ||
SubmitWorkflow(). | ||
WaitForWorkflow(). | ||
Then(). | ||
ExpectWorkflow(func(t *testing.T, _ *metav1.ObjectMeta, status *wfv1.WorkflowStatus) { | ||
assert.Equal(t, wfv1.WorkflowSucceeded, status.Phase) | ||
}) | ||
} | ||
|
||
func TestArtifactsSuite(t *testing.T) { | ||
suite.Run(t, new(ArtifactsSuite)) | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +build e2e | ||
// +build functional | ||
|
||
package e2e | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +build e2e | ||
// +build functional | ||
|
||
package e2e | ||
|
||
|
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
Oops, something went wrong.