Skip to content

Commit

Permalink
Revert "Switch to using 'uri' Kubernetes components in test Devfiles"
Browse files Browse the repository at this point in the history
This reverts commit df1f19e.

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.
  • Loading branch information
rm3l committed May 5, 2022
1 parent 951ec8c commit 614bc60
Show file tree
Hide file tree
Showing 23 changed files with 221 additions and 245 deletions.
12 changes: 6 additions & 6 deletions pkg/component/delete/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
23 changes: 22 additions & 1 deletion tests/examples/source/devfiles/nodejs/devfile-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
65 changes: 63 additions & 2 deletions tests/examples/source/devfiles/nodejs/devfile-with-link.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 23 additions & 2 deletions tests/examples/source/devfiles/nodejs/devfile-with-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 614bc60

Please sign in to comment.