mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Updating api/validation/schema_test to test testapi.Version rather than just v1beta1
This commit is contained in:
13
pkg/api/validation/testdata/v1beta1/invalidPod.yaml
vendored
Normal file
13
pkg/api/validation/testdata/v1beta1/invalidPod.yaml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
kind: Pod
|
||||
apiVersion: v1beta1
|
||||
id: name
|
||||
desiredState:
|
||||
manifest:
|
||||
version: v1beta1
|
||||
id: redis-master
|
||||
containers:
|
||||
- name: "master"
|
||||
image: "dockerfile/redis"
|
||||
command: "this is a bad command"
|
||||
labels:
|
||||
name: "redis-master"
|
||||
19
pkg/api/validation/testdata/v1beta1/invalidPod1.json
vendored
Normal file
19
pkg/api/validation/testdata/v1beta1/invalidPod1.json
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"id": "name",
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1beta1",
|
||||
"desiredState": {
|
||||
"manifest": {
|
||||
"version": "v1beta1",
|
||||
"id": "redis-master",
|
||||
"containers": [{
|
||||
"name": "master",
|
||||
"image": "dockerfile/redis",
|
||||
"command": "this is a bad command"
|
||||
}]
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"name": "redis-master"
|
||||
}
|
||||
}
|
||||
28
pkg/api/validation/testdata/v1beta1/invalidPod2.json
vendored
Normal file
28
pkg/api/validation/testdata/v1beta1/invalidPod2.json
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"apiVersion": "v1beta1",
|
||||
"kind": "Pod",
|
||||
"id": "apache-php",
|
||||
"desiredState": {
|
||||
"manifest": {
|
||||
"version": "v1beta1",
|
||||
"id": "apache-php",
|
||||
"containers": [{
|
||||
"name": "apache-php",
|
||||
"image": "php:5.6.2-apache",
|
||||
"ports": [{ "name": "apache", "containerPort": 80, "hostPort":"13380", "protocol":"TCP" }],
|
||||
"volumeMounts": [{"name": "shared-disk","mountPath": "/var/www/html", "readOnly": false}]
|
||||
}],
|
||||
"restartPolicy": {"always": {}},
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"volumes": [{
|
||||
"name": "shared-disk",
|
||||
"source": {
|
||||
"GCEPersistentDisk": {
|
||||
"path": "shared-disk"
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
"labels": { "name": "apache-php" }
|
||||
}
|
||||
28
pkg/api/validation/testdata/v1beta1/invalidPod3.json
vendored
Normal file
28
pkg/api/validation/testdata/v1beta1/invalidPod3.json
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"apiVersion": "v1beta1",
|
||||
"kind": "Pod",
|
||||
"id": "apache-php",
|
||||
"desiredState": {
|
||||
"manifest": {
|
||||
"version": "v1beta1",
|
||||
"id": "apache-php",
|
||||
"containers": [{
|
||||
"name": "apache-php",
|
||||
"image": "php:5.6.2-apache",
|
||||
"ports": [{ "name": "apache", "containerPort": 80, "hostPort":13380, "protocol":"TCP" }],
|
||||
"volumeMounts": [{"name": "shared-disk","mountPath": "/var/www/html", "readOnly": false}]
|
||||
}],
|
||||
"restartPolicy": {"always": {}},
|
||||
"dnsPolicy": "ClusterFirst",
|
||||
"volumes": [
|
||||
"name": "shared-disk",
|
||||
"source": {
|
||||
"GCEPersistentDisk": {
|
||||
"path": "shared-disk"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"labels": { "name": "apache-php" }
|
||||
}
|
||||
18
pkg/api/validation/testdata/v1beta1/validPod.yaml
vendored
Normal file
18
pkg/api/validation/testdata/v1beta1/validPod.yaml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
id: name
|
||||
kind: Pod
|
||||
apiVersion: v1beta1
|
||||
desiredState:
|
||||
manifest:
|
||||
version: v1beta1
|
||||
id: redis-master
|
||||
containers:
|
||||
- name: "master"
|
||||
image: "dockerfile/redis"
|
||||
command:
|
||||
- this
|
||||
- is
|
||||
- an
|
||||
- ok
|
||||
- command
|
||||
labels:
|
||||
name: "redis-master"
|
||||
11
pkg/api/validation/testdata/v1beta3/invalidPod.yaml
vendored
Normal file
11
pkg/api/validation/testdata/v1beta3/invalidPod.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1beta3
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
name: redis-master
|
||||
name: name
|
||||
spec:
|
||||
containers:
|
||||
- args: "this is a bad command"
|
||||
image: dockerfile/redis
|
||||
name: master
|
||||
19
pkg/api/validation/testdata/v1beta3/invalidPod1.json
vendored
Normal file
19
pkg/api/validation/testdata/v1beta3/invalidPod1.json
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1beta3",
|
||||
"metadata": {
|
||||
"name": "name",
|
||||
"labels": {
|
||||
"name": "redis-master"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "master",
|
||||
"image": "dockerfile/redis",
|
||||
"args": "this is a bad command"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
35
pkg/api/validation/testdata/v1beta3/invalidPod2.json
vendored
Normal file
35
pkg/api/validation/testdata/v1beta3/invalidPod2.json
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1beta3",
|
||||
"metadata": {
|
||||
"name": "apache-php",
|
||||
"labels": {
|
||||
"name": "apache-php"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [{
|
||||
"name": "shared-disk"
|
||||
}],
|
||||
"containers": [
|
||||
{
|
||||
"name": "apache-php",
|
||||
"image": "php:5.6.2-apache",
|
||||
"ports": [
|
||||
{
|
||||
"name": "apache",
|
||||
"hostPort": "13380",
|
||||
"containerPort": 80,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "shared-disk",
|
||||
"mountPath": "/var/www/html"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
35
pkg/api/validation/testdata/v1beta3/invalidPod3.json
vendored
Normal file
35
pkg/api/validation/testdata/v1beta3/invalidPod3.json
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"kind": "Pod",
|
||||
"apiVersion": "v1beta3",
|
||||
"metadata": {
|
||||
"name": "apache-php",
|
||||
"labels": {
|
||||
"name": "apache-php"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
"name": "shared-disk"
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "apache-php",
|
||||
"image": "php:5.6.2-apache",
|
||||
"ports": [
|
||||
{
|
||||
"name": "apache",
|
||||
"hostPort": 13380,
|
||||
"containerPort": 80,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "shared-disk",
|
||||
"mountPath": "/var/www/html"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
16
pkg/api/validation/testdata/v1beta3/validPod.yaml
vendored
Normal file
16
pkg/api/validation/testdata/v1beta3/validPod.yaml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1beta3
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
name: redis-master
|
||||
name: name
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- this
|
||||
- is
|
||||
- an
|
||||
- ok
|
||||
- command
|
||||
image: dockerfile/redis
|
||||
name: master
|
||||
Reference in New Issue
Block a user