Skip to content

Commit

Permalink
Merge pull request #245 from ksimon1/remove-params
Browse files Browse the repository at this point in the history
feat: clean up create-vm task
  • Loading branch information
ksimon1 authored May 18, 2023
2 parents 83cd6e1 + db74f96 commit d43c255
Show file tree
Hide file tree
Showing 70 changed files with 70 additions and 6,186 deletions.
22 changes: 22 additions & 0 deletions automation/e2e-deploy-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ CDI_VERSION=$(curl -s https://api.github.com/repos/kubevirt/containerized-data-i
TEKTON_VERSION=$(curl -s https://api.github.com/repos/tektoncd/operator/releases | \
jq '.[] | select(.prerelease==false) | .tag_name' | sort -V | tail -n1 | tr -d '"')

SSP_OPERATOR_VERSION=$(curl -s https://api.github.com/repos/kubevirt/ssp-operator/releases | \
jq '.[] | select(.prerelease==false) | .tag_name' | sort -V | tail -n1 | tr -d '"')

if kubectl get templates > /dev/null 2>&1; then
# okd
COMMON_TEMPLATES_VERSION=$(curl -s https://api.github.com/repos/kubevirt/common-templates/releases | \
Expand All @@ -39,6 +42,9 @@ kubectl apply -f "https://github.com/kubevirt/containerized-data-importer/releas

kubectl apply -f "https://github.com/kubevirt/containerized-data-importer/releases/download/${CDI_VERSION}/cdi-cr.yaml"

# Deploy SSP
kubectl apply -f "https://github.com/kubevirt/ssp-operator/releases/download/${SSP_OPERATOR_VERSION}/ssp-operator.yaml"

# wait for tekton pipelines
kubectl rollout status -n openshift-operators deployment/openshift-pipelines-operator --timeout 10m

Expand All @@ -62,3 +68,19 @@ kubectl wait -n openshift-pipelines deployment tekton-pipelines-webhook --for co
# Wait for kubevirt to be available
kubectl rollout status -n cdi deployment/cdi-operator --timeout 10m
kubectl wait -n kubevirt kv kubevirt --for condition=Available --timeout 10m
kubectl wait -n kubevirt deployment ssp-operator --for condition=Available --timeout 10m

kubectl create -f - <<EOF
apiVersion: ssp.kubevirt.io/v1beta1
kind: SSP
metadata:
name: ssp-sample
namespace: kubevirt
spec:
commonTemplates:
namespace: openshift
templateValidator:
replicas: 1
EOF

kubectl wait -n kubevirt ssp ssp-sample --for condition=Available --timeout 10m
24 changes: 0 additions & 24 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.

48 changes: 0 additions & 48 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.

8 changes: 0 additions & 8 deletions modules/create-vm/cmd/create-vm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,13 @@ func main() {
exit.ExitOrDieFromError(GenericExitCode, err)
}

if err := vmCreator.CheckVolumesExist(); err != nil {
exit.ExitFromError(VolumesNotPresentExitCode, err)
}

vm, err := vmCreator.CreateVM()
if err != nil {
exit.ExitOrDieFromError(CreateVMErrorExitCode, err,
zerrors.IsStatusError(err, http.StatusNotFound, http.StatusConflict, http.StatusUnprocessableEntity),
)
}

if err := vmCreator.OwnVolumes(vm); err != nil {
exit.ExitFromError(OwnVolumesErrorExitCode, err)
}

if cliOptions.GetStartVMFlag() &&
(vm.Spec.RunStrategy == nil || *vm.Spec.RunStrategy != kubevirtv1.RunStrategyAlways) &&
(vm.Spec.Running == nil || !*vm.Spec.Running) {
Expand Down
4 changes: 1 addition & 3 deletions modules/create-vm/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/alexflint/go-arg v1.3.0
github.com/kubevirt/kubevirt-tekton-tasks/modules/shared v0.0.0
github.com/kubevirt/kubevirt-tekton-tasks/modules/sharedtest v0.0.0
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a
github.com/onsi/ginkgo/v2 v2.2.0
github.com/onsi/gomega v1.20.2
github.com/openshift/api v0.0.0
Expand All @@ -17,8 +16,6 @@ require (
k8s.io/client-go v12.0.0+incompatible
kubevirt.io/api v1.0.0-alpha.0
kubevirt.io/client-go v1.0.0-alpha.0
kubevirt.io/containerized-data-importer v1.55.0
kubevirt.io/containerized-data-importer-api v1.55.0
kubevirt.io/kubevirt v1.0.0-alpha.0
sigs.k8s.io/yaml v1.3.0
)
Expand Down Expand Up @@ -79,6 +76,7 @@ require (
k8s.io/kube-aggregator v0.23.5 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
kubevirt.io/containerized-data-importer-api v1.55.0 // indirect
kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
Expand Down
4 changes: 0 additions & 4 deletions modules/create-vm/go.sum

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

70 changes: 0 additions & 70 deletions modules/create-vm/pkg/datavolume/datavolume-provider.go

This file was deleted.

14 changes: 0 additions & 14 deletions modules/create-vm/pkg/k8s/ownerereferences.go

This file was deleted.

23 changes: 0 additions & 23 deletions modules/create-vm/pkg/k8s/ownerereferences_test.go

This file was deleted.

25 changes: 0 additions & 25 deletions modules/create-vm/pkg/k8s/patch.go

This file was deleted.

33 changes: 0 additions & 33 deletions modules/create-vm/pkg/k8s/patch_test.go

This file was deleted.

Loading

0 comments on commit d43c255

Please sign in to comment.