Skip to content

Commit

Permalink
Merge pull request #239 from ksimon1/replace-cluster-tasks
Browse files Browse the repository at this point in the history
Replace cluster tasks with task object
  • Loading branch information
ksimon1 authored Apr 11, 2023
2 parents 325ad2b + 8a561a3 commit ad55604
Show file tree
Hide file tree
Showing 92 changed files with 196 additions and 266 deletions.
4 changes: 2 additions & 2 deletions automation/e2e-deploy-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ kubectl apply -f "https://github.com/kubevirt/containerized-data-importer/releas
# wait for tekton pipelines
kubectl rollout status -n openshift-operators deployment/openshift-pipelines-operator --timeout 10m

# wait until clustertasks tekton CRD is properly deployed
# wait until tasks tekton CRD is properly deployed
timeout 10m bash <<- EOF
until kubectl get crd clustertasks.tekton.dev; do
until kubectl get crd tasks.tekton.dev; do
sleep 5
done
EOF
Expand Down
1 change: 0 additions & 1 deletion automation/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -ex

export SCOPE="${SCOPE:-cluster}"
export DEV_MODE="${DEV_MODE:-false}"
export STORAGE_CLASS="${STORAGE_CLASS:-}"
export DEPLOY_NAMESPACE="${DEPLOY_NAMESPACE:-e2e-tests-$(shuf -i10000-99999 -n1)}"
Expand Down
8 changes: 0 additions & 8 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ make cluster-sync
./scripts/cluster-sync.sh execute-in-vm
```

You can also change the scope of the tasks to be single namespace only:

```bash
SCOPE=namespace make cluster-sync
```

## Testing

### Running Unit Tests
Expand All @@ -55,8 +49,6 @@ make test
### Running E2E Tests
```bash
NUM_NODES=4 make cluster-test
# for namespace scope use
SCOPE=namespace NUM_NODES=4 make cluster-test
# clean all used resources, namespaces and images
make cluster-clean
Expand Down
10 changes: 5 additions & 5 deletions examples/pipelines/server-deployer/server-deployer-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- name: waitForSuccess
value: 'true'
taskRef:
kind: ClusterTask
kind: Task
name: modify-data-object
- name: generate-ssh-keys
params:
Expand All @@ -36,7 +36,7 @@ spec:
- 'user:fedora'
- 'disable-strict-host-key-checking:true'
taskRef:
kind: ClusterTask
kind: Task
name: generate-ssh-keys
- name: disk-virt-customize
params:
Expand All @@ -47,7 +47,7 @@ spec:
install git,vim,pip
run-command pip install flask
taskRef:
kind: ClusterTask
kind: Task
name: disk-virt-customize
runAfter:
- modify-data-object
Expand Down Expand Up @@ -118,7 +118,7 @@ spec:
- disk-virt-customize
- generate-ssh-keys
taskRef:
kind: ClusterTask
kind: Task
name: create-vm-from-manifest
- name: execute-in-vm
params:
Expand All @@ -138,5 +138,5 @@ spec:
runAfter:
- create-vm-from-manifest
taskRef:
kind: ClusterTask
kind: Task
name: execute-in-vm
8 changes: 4 additions & 4 deletions examples/pipelines/unit-tester/unit-tester-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
- 'user:fedora'
- 'disable-strict-host-key-checking:true'
taskRef:
kind: ClusterTask
kind: Task
name: generate-ssh-keys
- name: create-vm-from-manifest
params:
Expand Down Expand Up @@ -87,7 +87,7 @@ spec:
runAfter:
- generate-ssh-keys
taskRef:
kind: ClusterTask
kind: Task
name: create-vm-from-manifest
- name: execute-in-vm
params:
Expand All @@ -110,7 +110,7 @@ spec:
runAfter:
- create-vm-from-manifest
taskRef:
kind: ClusterTask
kind: Task
name: execute-in-vm
finally:
- name: cleanup-vm
Expand All @@ -135,5 +135,5 @@ spec:
cat ${RESULT_FILES}
fi
taskRef:
kind: ClusterTask
kind: Task
name: cleanup-vm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- name: waitForSuccess
value: 'true'
taskRef:
kind: ClusterTask
kind: Task
name: modify-data-object
- name: disk-virt-sysprep
params:
Expand All @@ -39,7 +39,7 @@ spec:
- name: additionalOptions
value: "--network"
taskRef:
kind: ClusterTask
kind: Task
name: disk-virt-sysprep
runAfter:
- modify-data-object
Expand Down Expand Up @@ -102,5 +102,5 @@ spec:
runAfter:
- disk-virt-sysprep
taskRef:
kind: ClusterTask
kind: Task
name: create-vm-from-manifest
18 changes: 9 additions & 9 deletions manifests/kubernetes/kubevirt-tekton-tasks-kubernetes.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions manifests/okd/kubevirt-tekton-tasks-okd.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions modules/tests/test/constants/constants.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package constants

import (
"github.com/kubevirt/kubevirt-tekton-tasks/modules/sharedtest/testconstants"
"strings"
"time"

"github.com/kubevirt/kubevirt-tekton-tasks/modules/sharedtest/testconstants"
)

const e2eNamespacePrefix = "e2e-tests"
Expand All @@ -22,13 +23,6 @@ const (
EmptyTargetNS TargetNamespace = "empty"
)

type TestScope string

const (
ClusterTestScope TestScope = "cluster"
NamespaceTestScope TestScope = "namespace"
)

type EnvScope string

const (
Expand Down
9 changes: 5 additions & 4 deletions modules/tests/test/constants/copy-template.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package constants

const (
CopyTemplateClusterTaskName = "copy-template"
CopyTemplateServiceAccountName = "copy-template-task"
CopyTemplateTaskRunName = "taskrun-copy-template"
NewTemplateName = "test-template"
CopyTemplateTaskName = "copy-template"
CopyTemplateServiceAccountName = "copy-template-task"
CopyTemplateServiceAccountNameNamespaced = "copy-template-test"
CopyTemplateTaskRunName = "taskrun-copy-template"
NewTemplateName = "test-template"

SourceTemplateNameOptionName = "sourceTemplateName"
SourceTemplateNamespaceOptionName = "sourceTemplateNamespace"
Expand Down
7 changes: 4 additions & 3 deletions modules/tests/test/constants/create-data-object.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package constants

const (
ModifyDataObjectClusterTaskName = "modify-data-object"
ModifyDataObjectServiceAccountName = "modify-data-object-task"
ModifyDataObjectTaskrunName = "taskrun-modify-data-object"
ModifyDataObjectTaskName = "modify-data-object"
ModifyDataObjectServiceAccountName = "modify-data-object-task"
ModifyDataObjectServiceAccountNameNamespaced = "modify-data-object-test"
ModifyDataObjectTaskrunName = "taskrun-modify-data-object"

UnusualRestartCountThreshold = 3
ReasonError = "Error"
Expand Down
Loading

0 comments on commit ad55604

Please sign in to comment.