From 614bc60e2915bad5e60dd2964006869fedc71dca Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Wed, 4 May 2022 16:21:54 +0200 Subject: [PATCH] Revert "Switch to using 'uri' Kubernetes components in test Devfiles" This reverts commit df1f19ed959b8c82aa17ac3cf12c343305789149. This will be done in a separate PR, with ideally changes that should allow to use the same set of tests for testing both Inlined and URI-referenced manifests. --- pkg/component/delete/delete_test.go | 12 ++-- ....yaml => devfile-deploy-with-k8s-uri.yaml} | 23 +------ ...evfile-deploy-with-multiple-resources.yaml | 4 -- .../devfiles/nodejs/devfile-deploy.yaml | 23 ++++++- ...roject_source-in-docker-build-context.yaml | 38 ++++++++++- .../devfiles/nodejs/devfile-with-link.yaml | 65 ++++++++++++++++++- .../devfiles/nodejs/devfile-with-pod.yaml | 25 ++++++- .../devfile-with-two-deploy-commands.yaml | 23 ++++++- ...h-image-component-and-no-buildContext.yaml | 37 ++++++++++- .../outerloop-deploy.yaml | 18 ----- .../outerloop-service.yaml | 15 ----- .../kubernetes/devfile-with-link/myredis.yaml | 41 ------------ .../devfile-with-link/redis-link.yaml | 20 ------ .../devfile-with-pod/etcdcluster.yaml | 9 --- .../kubernetes/devfile-with-pod/nginx.yaml | 12 ---- .../outerloop-deploy.yaml | 21 ------ .../outerloop-deploy.yaml | 18 ----- .../outerloop-service.yaml | 15 ----- ...-deploy.yaml => outerloop-deployment.yaml} | 2 +- .../devfile/cmd_devfile_build_images_test.go | 7 -- .../devfile/cmd_devfile_deploy_test.go | 34 ++++------ .../devfile/cmd_devfile_init_test.go | 2 - .../devfile/cmd_devfile_list_test.go | 2 - 23 files changed, 221 insertions(+), 245 deletions(-) rename tests/examples/source/devfiles/nodejs/{devfile-deploy-with-k8s-inlined.yaml => devfile-deploy-with-k8s-uri.yaml} (77%) delete mode 100644 tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-deploy.yaml delete mode 100644 tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-service.yaml delete mode 100644 tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-link/myredis.yaml delete mode 100644 tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-link/redis-link.yaml delete mode 100644 tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-pod/etcdcluster.yaml delete mode 100644 tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-pod/nginx.yaml delete mode 100644 tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-two-deploy-commands/outerloop-deploy.yaml delete mode 100644 tests/examples/source/devfiles/nodejs/project/kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-deploy.yaml delete mode 100644 tests/examples/source/devfiles/nodejs/project/kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-service.yaml rename tests/examples/source/devfiles/nodejs/project/kubernetes/{devfile-deploy/outerloop-deploy.yaml => outerloop-deployment.yaml} (95%) diff --git a/pkg/component/delete/delete_test.go b/pkg/component/delete/delete_test.go index 637be50f825..f1548d35ef6 100644 --- a/pkg/component/delete/delete_test.go +++ b/pkg/component/delete/delete_test.go @@ -324,7 +324,7 @@ func TestDeleteComponentClient_ListResourcesToDeleteFromDevfile(t *testing.T) { }, }, args: args{ - devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy-with-k8s-inlined.yaml"), + devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy.yaml"), appName: appName, }, wantIsInnerLoopDeployed: true, @@ -371,7 +371,7 @@ func TestDeleteComponentClient_ListResourcesToDeleteFromDevfile(t *testing.T) { }, }, args: args{ - devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy-with-k8s-inlined.yaml"), + devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy.yaml"), appName: appName, }, wantIsInnerLoopDeployed: false, @@ -388,7 +388,7 @@ func TestDeleteComponentClient_ListResourcesToDeleteFromDevfile(t *testing.T) { }, }, args: args{ - devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy-with-k8s-inlined.yaml"), + devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy.yaml"), appName: appName, }, wantIsInnerLoopDeployed: false, @@ -406,7 +406,7 @@ func TestDeleteComponentClient_ListResourcesToDeleteFromDevfile(t *testing.T) { }, }, args: args{ - devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy-with-k8s-inlined.yaml"), + devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy.yaml"), appName: appName, }, wantIsInnerLoopDeployed: true, @@ -427,7 +427,7 @@ func TestDeleteComponentClient_ListResourcesToDeleteFromDevfile(t *testing.T) { }, }, args: args{ - devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy-with-k8s-inlined.yaml"), + devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy.yaml"), appName: appName, }, wantIsInnerLoopDeployed: true, @@ -487,7 +487,7 @@ func TestDeleteComponentClient_ExecutePreStopEvents(t *testing.T) { }, }, args: args{ - devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy-with-k8s-inlined.yaml"), + devfileObj: odoTestingUtil.GetTestDevfileObjFromFile("devfile-deploy.yaml"), appName: appName, }, wantErr: false, diff --git a/tests/examples/source/devfiles/nodejs/devfile-deploy-with-k8s-inlined.yaml b/tests/examples/source/devfiles/nodejs/devfile-deploy-with-k8s-uri.yaml similarity index 77% rename from tests/examples/source/devfiles/nodejs/devfile-deploy-with-k8s-inlined.yaml rename to tests/examples/source/devfiles/nodejs/devfile-deploy-with-k8s-uri.yaml index 8cf0f27dd47..54eb4d90f59 100644 --- a/tests/examples/source/devfiles/nodejs/devfile-deploy-with-k8s-inlined.yaml +++ b/tests/examples/source/devfiles/nodejs/devfile-deploy-with-k8s-uri.yaml @@ -86,25 +86,4 @@ components: uri: ./Dockerfile - name: outerloop-deploy kubernetes: - inlined: | - kind: Deployment - apiVersion: apps/v1 - metadata: - name: my-component - spec: - replicas: 1 - selector: - matchLabels: - app: node-app - template: - metadata: - labels: - app: node-app - spec: - containers: - - name: main - image: {{CONTAINER_IMAGE}} - resources: - limits: - memory: "128Mi" - cpu: "500m" + uri: 'kubernetes/outerloop-deployment.yaml' diff --git a/tests/examples/source/devfiles/nodejs/devfile-deploy-with-multiple-resources.yaml b/tests/examples/source/devfiles/nodejs/devfile-deploy-with-multiple-resources.yaml index 5fbab94291f..870a49e3dbc 100644 --- a/tests/examples/source/devfiles/nodejs/devfile-deploy-with-multiple-resources.yaml +++ b/tests/examples/source/devfiles/nodejs/devfile-deploy-with-multiple-resources.yaml @@ -69,8 +69,6 @@ components: - name: outerloop-deploy kubernetes: - # TODO(rm3l): Move this as a URI by default once https://github.com/redhat-developer/odo/issues/5637 is fixed - # Also consider keeping an "Inlined" version for testing inlined: | kind: Deployment apiVersion: apps/v1 @@ -95,8 +93,6 @@ components: cpu: "500m" - name: outerloop-deploy-2 kubernetes: - # TODO(rm3l): Move this as a URI by default once https://github.com/redhat-developer/odo/issues/5637 is fixed - # Also consider keeping an "Inlined" version for testing inlined: | apiVersion: v1 kind: Service diff --git a/tests/examples/source/devfiles/nodejs/devfile-deploy.yaml b/tests/examples/source/devfiles/nodejs/devfile-deploy.yaml index d8424156eb3..ada31e2b5ca 100644 --- a/tests/examples/source/devfiles/nodejs/devfile-deploy.yaml +++ b/tests/examples/source/devfiles/nodejs/devfile-deploy.yaml @@ -65,7 +65,28 @@ components: - name: outerloop-deploy kubernetes: - uri: kubernetes/devfile-deploy/outerloop-deploy.yaml + inlined: | + kind: Deployment + apiVersion: apps/v1 + metadata: + name: my-component + spec: + replicas: 1 + selector: + matchLabels: + app: node-app + template: + metadata: + labels: + app: node-app + spec: + containers: + - name: main + image: {{CONTAINER_IMAGE}} + resources: + limits: + memory: "128Mi" + cpu: "500m" metadata: description: Stack with Node.js 14 displayName: Node.js Runtime diff --git a/tests/examples/source/devfiles/nodejs/devfile-outerloop-project_source-in-docker-build-context.yaml b/tests/examples/source/devfiles/nodejs/devfile-outerloop-project_source-in-docker-build-context.yaml index 2b5a004a34f..71bd0b76cf9 100644 --- a/tests/examples/source/devfiles/nodejs/devfile-outerloop-project_source-in-docker-build-context.yaml +++ b/tests/examples/source/devfiles/nodejs/devfile-outerloop-project_source-in-docker-build-context.yaml @@ -58,7 +58,41 @@ components: buildContext: ${PROJECT_SOURCE} - name: outerloop-deploy kubernetes: - uri: kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-deploy.yaml + inlined: | + kind: Deployment + apiVersion: apps/v1 + metadata: + name: devfile-nodejs-deploy + spec: + replicas: 1 + selector: + matchLabels: + app: devfile-nodejs-deploy + template: + metadata: + labels: + app: devfile-nodejs-deploy + spec: + containers: + - name: main + image: "{{CONTAINER_IMAGE}}" + resources: {} - name: outerloop-service kubernetes: - uri: kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-service.yaml + inlined: | + apiVersion: v1 + kind: Service + metadata: + labels: + app: devfile-nodejs-deploy + name: devfile-nodejs-deploy + spec: + ports: + - name: http-3000 + port: 3000 + protocol: TCP + targetPort: 3000 + selector: + app: devfile-nodejs-deploy + type: LoadBalancer + diff --git a/tests/examples/source/devfiles/nodejs/devfile-with-link.yaml b/tests/examples/source/devfiles/nodejs/devfile-with-link.yaml index 2079621ba3c..6e7cae607ca 100644 --- a/tests/examples/source/devfiles/nodejs/devfile-with-link.yaml +++ b/tests/examples/source/devfiles/nodejs/devfile-with-link.yaml @@ -42,10 +42,71 @@ components: sourceMapping: /project name: runtime - kubernetes: - uri: kubernetes/devfile-with-link/myredis.yaml + inlined: | + apiVersion: redis.redis.opstreelabs.in/v1beta1 + kind: Redis + metadata: + name: myredis + annotations: + service.binding/name: path={.metadata.name} + spec: + redisExporter: + enabled: true + image: 'quay.io/opstree/redis-exporter:1.0' + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi + kubernetesConfig: + image: 'quay.io/opstree/redis:v6.2' + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + redisSecret: + name: redis-secret + key: password + serviceType: LoadBalancer + redisConfig: {} + storage: + volumeClaimTemplate: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi name: myredis - kubernetes: - uri: kubernetes/devfile-with-link/redis-link.yaml + inlined: | + apiVersion: binding.operators.coreos.com/v1alpha1 + kind: ServiceBinding + metadata: + creationTimestamp: null + name: redis-link + spec: + application: + group: apps + name: api-app + resource: deployments + version: v1 + bindAsFiles: true + detectBindingResources: true + services: + - group: redis.redis.opstreelabs.in + kind: Redis + name: myredis + version: v1beta1 + status: + secret: "" name: redis-link metadata: description: Stack with Node.js 14 diff --git a/tests/examples/source/devfiles/nodejs/devfile-with-pod.yaml b/tests/examples/source/devfiles/nodejs/devfile-with-pod.yaml index f704739b523..dd6409a6a1d 100644 --- a/tests/examples/source/devfiles/nodejs/devfile-with-pod.yaml +++ b/tests/examples/source/devfiles/nodejs/devfile-with-pod.yaml @@ -24,10 +24,31 @@ components: sourceMapping: /project name: runtime - kubernetes: - uri: kubernetes/devfile-with-pod/etcdcluster.yaml + inlined: | + apiVersion: etcd.database.coreos.com/v1beta2 + kind: EtcdCluster + metadata: + annotations: + etcd.database.coreos.com/scope: clusterwide + name: etcdcluster + spec: + size: 3 + version: 3.2.13 name: etcdcluster - kubernetes: - uri: kubernetes/devfile-with-pod/nginx.yaml + inlined: | + apiVersion: v1 + kind: Pod + metadata: + labels: + name: nginx + name: nginx + spec: + containers: + - image: quay.io/bitnami/nginx + name: nginx + ports: + - containerPort: 80 name: nginx commands: - exec: diff --git a/tests/examples/source/devfiles/nodejs/devfile-with-two-deploy-commands.yaml b/tests/examples/source/devfiles/nodejs/devfile-with-two-deploy-commands.yaml index 09a8e348618..ec4b66c45ec 100644 --- a/tests/examples/source/devfiles/nodejs/devfile-with-two-deploy-commands.yaml +++ b/tests/examples/source/devfiles/nodejs/devfile-with-two-deploy-commands.yaml @@ -72,7 +72,28 @@ components: - name: outerloop-deploy kubernetes: - uri: kubernetes/devfile-with-two-deploy-commands/outerloop-deploy.yaml + inlined: | + kind: Deployment + apiVersion: apps/v1 + metadata: + name: my-component + spec: + replicas: 1 + selector: + matchLabels: + app: node-app + template: + metadata: + labels: + app: node-app + spec: + containers: + - name: main + image: {{CONTAINER_IMAGE}} + resources: + limits: + memory: "128Mi" + cpu: "500m" metadata: description: Stack with Node.js 14 displayName: Node.js Runtime diff --git a/tests/examples/source/devfiles/nodejs/issue-5600-devfile-with-image-component-and-no-buildContext.yaml b/tests/examples/source/devfiles/nodejs/issue-5600-devfile-with-image-component-and-no-buildContext.yaml index 559a0301e7d..bd00d831918 100644 --- a/tests/examples/source/devfiles/nodejs/issue-5600-devfile-with-image-component-and-no-buildContext.yaml +++ b/tests/examples/source/devfiles/nodejs/issue-5600-devfile-with-image-component-and-no-buildContext.yaml @@ -48,10 +48,43 @@ components: imageName: localhost:5000/devfile-nodejs-deploy:0.1.0 name: prod-image - kubernetes: - uri: kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-deploy.yaml + inlined: | + kind: Deployment + apiVersion: apps/v1 + metadata: + name: devfile-nodejs-deploy + spec: + replicas: 1 + selector: + matchLabels: + app: devfile-nodejs-deploy + template: + metadata: + labels: + app: devfile-nodejs-deploy + spec: + containers: + - name: main + image: "localhost:5000/devfile-nodejs-deploy:0.1.0" + resources: {} name: outerloop-deploy - kubernetes: - uri: kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-service.yaml + inlined: | + apiVersion: v1 + kind: Service + metadata: + labels: + app: devfile-nodejs-deploy + name: devfile-nodejs-deploy + spec: + ports: + - name: http-3000 + port: 3000 + protocol: TCP + targetPort: 3000 + selector: + app: devfile-nodejs-deploy + type: LoadBalancer name: outerloop-service metadata: language: javascript diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-deploy.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-deploy.yaml deleted file mode 100644 index c73a309e8e0..00000000000 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-deploy.yaml +++ /dev/null @@ -1,18 +0,0 @@ -kind: Deployment -apiVersion: apps/v1 -metadata: - name: devfile-nodejs-deploy -spec: - replicas: 1 - selector: - matchLabels: - app: devfile-nodejs-deploy - template: - metadata: - labels: - app: devfile-nodejs-deploy - spec: - containers: - - name: main - image: "{{CONTAINER_IMAGE}}" - resources: {} \ No newline at end of file diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-service.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-service.yaml deleted file mode 100644 index 4c6ec53b676..00000000000 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-outerloop-project_source-in-docker-build-context/outerloop-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: devfile-nodejs-deploy - name: devfile-nodejs-deploy -spec: - ports: - - name: http-3000 - port: 3000 - protocol: TCP - targetPort: 3000 - selector: - app: devfile-nodejs-deploy - type: LoadBalancer \ No newline at end of file diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-link/myredis.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-link/myredis.yaml deleted file mode 100644 index 46f6251385f..00000000000 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-link/myredis.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: redis.redis.opstreelabs.in/v1beta1 -kind: Redis -metadata: - name: myredis - annotations: - service.binding/name: path={.metadata.name} -spec: - redisExporter: - enabled: true - image: 'quay.io/opstree/redis-exporter:1.0' - imagePullPolicy: Always - resources: - requests: - cpu: 100m - memory: 128Mi - limits: - cpu: 100m - memory: 128Mi - kubernetesConfig: - image: 'quay.io/opstree/redis:v6.2' - imagePullPolicy: IfNotPresent - resources: - requests: - cpu: 101m - memory: 128Mi - limits: - cpu: 101m - memory: 128Mi - redisSecret: - name: redis-secret - key: password - serviceType: LoadBalancer - redisConfig: {} - storage: - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi \ No newline at end of file diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-link/redis-link.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-link/redis-link.yaml deleted file mode 100644 index c4868d07b93..00000000000 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-link/redis-link.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: binding.operators.coreos.com/v1alpha1 -kind: ServiceBinding -metadata: - creationTimestamp: null - name: redis-link -spec: - application: - group: apps - name: api-app - resource: deployments - version: v1 - bindAsFiles: true - detectBindingResources: true - services: - - group: redis.redis.opstreelabs.in - kind: Redis - name: myredis - version: v1beta1 -status: - secret: "" \ No newline at end of file diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-pod/etcdcluster.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-pod/etcdcluster.yaml deleted file mode 100644 index 68aef654216..00000000000 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-pod/etcdcluster.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: etcd.database.coreos.com/v1beta2 -kind: EtcdCluster -metadata: - annotations: - etcd.database.coreos.com/scope: clusterwide - name: etcdcluster -spec: - size: 3 - version: 3.2.13 \ No newline at end of file diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-pod/nginx.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-pod/nginx.yaml deleted file mode 100644 index 67239bd5025..00000000000 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-pod/nginx.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - labels: - name: nginx - name: nginx -spec: - containers: - - image: quay.io/bitnami/nginx - name: nginx - ports: - - containerPort: 80 \ No newline at end of file diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-two-deploy-commands/outerloop-deploy.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-two-deploy-commands/outerloop-deploy.yaml deleted file mode 100644 index 68b4e32eccb..00000000000 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-with-two-deploy-commands/outerloop-deploy.yaml +++ /dev/null @@ -1,21 +0,0 @@ -kind: Deployment -apiVersion: apps/v1 -metadata: - name: my-component -spec: - replicas: 1 - selector: - matchLabels: - app: node-app - template: - metadata: - labels: - app: node-app - spec: - containers: - - name: main - image: {{CONTAINER_IMAGE}} - resources: - limits: - memory: "128Mi" - cpu: "500m" \ No newline at end of file diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-deploy.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-deploy.yaml deleted file mode 100644 index bfa919341c8..00000000000 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-deploy.yaml +++ /dev/null @@ -1,18 +0,0 @@ -kind: Deployment -apiVersion: apps/v1 -metadata: - name: devfile-nodejs-deploy -spec: - replicas: 1 - selector: - matchLabels: - app: devfile-nodejs-deploy - template: - metadata: - labels: - app: devfile-nodejs-deploy - spec: - containers: - - name: main - image: "localhost:5000/devfile-nodejs-deploy:0.1.0" - resources: {} \ No newline at end of file diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-service.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-service.yaml deleted file mode 100644 index 4c6ec53b676..00000000000 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/issue-5600-devfile-with-image-component-and-no-buildContext/outerloop-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: devfile-nodejs-deploy - name: devfile-nodejs-deploy -spec: - ports: - - name: http-3000 - port: 3000 - protocol: TCP - targetPort: 3000 - selector: - app: devfile-nodejs-deploy - type: LoadBalancer \ No newline at end of file diff --git a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-deploy/outerloop-deploy.yaml b/tests/examples/source/devfiles/nodejs/project/kubernetes/outerloop-deployment.yaml similarity index 95% rename from tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-deploy/outerloop-deploy.yaml rename to tests/examples/source/devfiles/nodejs/project/kubernetes/outerloop-deployment.yaml index 5ac9de29bbc..2a155d1a780 100644 --- a/tests/examples/source/devfiles/nodejs/project/kubernetes/devfile-deploy/outerloop-deploy.yaml +++ b/tests/examples/source/devfiles/nodejs/project/kubernetes/outerloop-deployment.yaml @@ -20,4 +20,4 @@ spec: resources: limits: memory: "128Mi" - cpu: "500m" \ No newline at end of file + cpu: "500m" diff --git a/tests/integration/devfile/cmd_devfile_build_images_test.go b/tests/integration/devfile/cmd_devfile_build_images_test.go index 29d785a6da2..c49b2537de5 100644 --- a/tests/integration/devfile/cmd_devfile_build_images_test.go +++ b/tests/integration/devfile/cmd_devfile_build_images_test.go @@ -79,9 +79,6 @@ var _ = Describe("odo devfile build-images command tests", func() { BeforeEach(func() { helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context) - helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes", - "devfile-outerloop-project_source-in-docker-build-context"), - filepath.Join(commonVar.Context, "kubernetes", "devfile-outerloop-project_source-in-docker-build-context")) helper.Cmd("odo", "init", "--name", "aname", "--devfile-path", helper.GetExamplePath("source", "devfiles", "nodejs", @@ -124,10 +121,6 @@ var _ = Describe("odo devfile build-images command tests", func() { BeforeEach(func() { helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context) - helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes", - "issue-5600-devfile-with-image-component-and-no-buildContext"), - filepath.Join(commonVar.Context, "kubernetes", - "issue-5600-devfile-with-image-component-and-no-buildContext")) helper.CopyExampleDevFile( filepath.Join("source", "devfiles", "nodejs", "issue-5600-devfile-with-image-component-and-no-buildContext.yaml"), diff --git a/tests/integration/devfile/cmd_devfile_deploy_test.go b/tests/integration/devfile/cmd_devfile_deploy_test.go index 2bb71328ef3..5be778a2673 100644 --- a/tests/integration/devfile/cmd_devfile_deploy_test.go +++ b/tests/integration/devfile/cmd_devfile_deploy_test.go @@ -40,7 +40,7 @@ var _ = Describe("odo devfile deploy command tests", func() { }) }) - for _, testCtx := range []struct { + for _, ctx := range []struct { title string devfileName string setupFunc func() @@ -48,27 +48,28 @@ var _ = Describe("odo devfile deploy command tests", func() { { title: "using a devfile.yaml containing a deploy command", devfileName: "devfile-deploy.yaml", - setupFunc: func() { - helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes", "devfile-deploy"), - filepath.Join(commonVar.Context, "kubernetes", "devfile-deploy")) - }, + setupFunc: nil, }, { - title: "using a devfile.yaml containing an outer-loop Kubernetes component inlined", - devfileName: "devfile-deploy-with-k8s-inlined.yaml", + title: "using a devfile.yaml containing an outer-loop Kubernetes component referenced via an URI", + devfileName: "devfile-deploy-with-k8s-uri.yaml", + setupFunc: func() { + helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes"), + filepath.Join(commonVar.Context, "kubernetes")) + }, }, } { - When(testCtx.title, func() { + When(ctx.title, func() { // from devfile cmpName := "nodejs-prj1-api-abhz" deploymentName := "my-component" BeforeEach(func() { helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context) - helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "nodejs", testCtx.devfileName), + helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "nodejs", ctx.devfileName), path.Join(commonVar.Context, "devfile.yaml")) - if testCtx.setupFunc != nil { - testCtx.setupFunc() + if ctx.setupFunc != nil { + ctx.setupFunc() } }) @@ -134,8 +135,6 @@ var _ = Describe("odo devfile deploy command tests", func() { When("using a devfile.yaml containing two deploy commands", func() { BeforeEach(func() { helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context) - helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes", "devfile-with-two-deploy-commands"), - filepath.Join(commonVar.Context, "kubernetes", "devfile-with-two-deploy-commands")) helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "nodejs", "devfile-with-two-deploy-commands.yaml"), path.Join(commonVar.Context, "devfile.yaml")) }) It("should run odo deploy", func() { @@ -154,8 +153,6 @@ var _ = Describe("odo devfile deploy command tests", func() { When("recording telemetry data", func() { BeforeEach(func() { helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context) - helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes", "devfile-deploy"), - filepath.Join(commonVar.Context, "kubernetes", "devfile-deploy")) helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "nodejs", "devfile-deploy.yaml"), path.Join(commonVar.Context, "devfile.yaml")) helper.EnableTelemetryDebug() helper.Cmd("odo", "deploy").AddEnv("PODMAN_CMD=echo").ShouldPass() @@ -179,9 +176,6 @@ var _ = Describe("odo devfile deploy command tests", func() { BeforeEach(func() { helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context) - helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes", - "devfile-outerloop-project_source-in-docker-build-context"), - filepath.Join(commonVar.Context, "kubernetes", "devfile-outerloop-project_source-in-docker-build-context")) helper.Cmd("odo", "init", "--name", "aname", "--devfile-path", helper.GetExamplePath("source", "devfiles", "nodejs", @@ -226,10 +220,6 @@ var _ = Describe("odo devfile deploy command tests", func() { BeforeEach(func() { helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context) - helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes", - "issue-5600-devfile-with-image-component-and-no-buildContext"), - filepath.Join(commonVar.Context, "kubernetes", - "issue-5600-devfile-with-image-component-and-no-buildContext")) helper.CopyExampleDevFile( filepath.Join("source", "devfiles", "nodejs", "issue-5600-devfile-with-image-component-and-no-buildContext.yaml"), diff --git a/tests/integration/devfile/cmd_devfile_init_test.go b/tests/integration/devfile/cmd_devfile_init_test.go index 49985e7b284..482ac1e655e 100644 --- a/tests/integration/devfile/cmd_devfile_init_test.go +++ b/tests/integration/devfile/cmd_devfile_init_test.go @@ -268,8 +268,6 @@ var _ = Describe("odo devfile init command tests", func() { var out string BeforeEach(func() { helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "nodejs", "devfile-deploy.yaml"), devfilePath) - helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes", "devfile-deploy"), - filepath.Join(commonVar.Context, "kubernetes", "devfile-deploy")) out = helper.Cmd("odo", "init", "--name", "aname", "--devfile-path", devfilePath).ShouldPass().Out() }) It("should show information about both `odo dev`, and `odo deploy`", func() { diff --git a/tests/integration/devfile/cmd_devfile_list_test.go b/tests/integration/devfile/cmd_devfile_list_test.go index 618d8365f1a..6e8b28fefcb 100644 --- a/tests/integration/devfile/cmd_devfile_list_test.go +++ b/tests/integration/devfile/cmd_devfile_list_test.go @@ -32,8 +32,6 @@ var _ = Describe("odo list with devfile", func() { BeforeEach(func() { helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context) helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "nodejs", "devfile-deploy.yaml"), path.Join(commonVar.Context, "devfile.yaml")) - helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project", "kubernetes", "devfile-deploy"), - filepath.Join(commonVar.Context, "kubernetes", "devfile-deploy")) helper.Chdir(commonVar.Context) var err error devSession, _, _, _, err = helper.StartDevMode()