| ... | ... |
@@ -108,9 +108,9 @@ report should be stored. For example: |
| 108 | 108 |
|
| 109 | 109 |
After that you can open `/path/to/dir/coverage.html` in the browser. |
| 110 | 110 |
|
| 111 |
-To generate a jUnit XML report from the output of the tests, and see a summary of the test output |
|
| 111 |
+To generate a jUnit XML report from the output of the tests, and see a summary of the test output |
|
| 112 | 112 |
instead of the full test output, use: |
| 113 |
- |
|
| 113 |
+ |
|
| 114 | 114 |
$ JUNIT_REPORT=true hack/test-go.sh |
| 115 | 115 |
|
| 116 | 116 |
`hack/test-go.sh` cannot generate jUnit XML and a coverage report for all packages at once. If you |
| ... | ... |
@@ -476,7 +476,7 @@ OpenShift and Kubernetes integrate with the [Swagger 2.0 API framework](http://s |
| 476 | 476 |
|
| 477 | 477 |
$ openshift start --cors-allowed-origins=.* |
| 478 | 478 |
|
| 479 |
-and then browse to http://openshift3swagger-claytondev.rhcloud.com (which runs a copy of the Swagger UI that points to localhost:8080 by default). Expand the operations available on v1beta3 to see the schemas (and to try the API directly). |
|
| 479 |
+and then browse to http://openshift3swagger-claytondev.rhcloud.com (which runs a copy of the Swagger UI that points to localhost:8080 by default). Expand the operations available on v1 to see the schemas (and to try the API directly). |
|
| 480 | 480 |
|
| 481 | 481 |
Note: Hosted API documentation can be found [here](http://docs.openshift.org/latest/rest_api/openshift_v1.html). |
| 482 | 482 |
|
| ... | ... |
@@ -12,7 +12,7 @@ In OpenShift, deployment is an update to a single replication controller's pod t |
| 12 | 12 |
|
| 13 | 13 |
#### Concepts |
| 14 | 14 |
|
| 15 |
-An OpenShift `deploymentConfig` describes a single `template` and a set of `triggers` for when a new `deployment` should be created. A `deployment` is simply a specially annotated `replicationController`. A `strategy` is responsible for making a `deployment` live in the cluster. |
|
| 15 |
+An OpenShift `deploymentConfig` describes a single `template` and a set of `triggers` for when a new `deployment` should be created. A `deployment` is simply a specially annotated `replicationController`. A `strategy` is responsible for making a `deployment` live in the cluster. |
|
| 16 | 16 |
|
| 17 | 17 |
Each time a new deployment is created, the `latestVersion` field of `deploymentConfig` is incremented, and a `deploymentCause` is added to the `deploymentConfig` describing the change that led to the latest deployment. |
| 18 | 18 |
|
| ... | ... |
@@ -23,7 +23,7 @@ A `deploymentConfig` in OpenShift is a REST object which can be POSTed to the AP |
| 23 | 23 |
``` |
| 24 | 24 |
{
|
| 25 | 25 |
"kind": "DeploymentConfig", |
| 26 |
- "apiVersion": "v1beta3", |
|
| 26 |
+ "apiVersion": "v1", |
|
| 27 | 27 |
"metadata": {
|
| 28 | 28 |
"name": "frontend" |
| 29 | 29 |
}, |
| ... | ... |
@@ -148,7 +148,7 @@ The algorithm for this `strategy` is: |
| 148 | 148 |
|
| 149 | 149 |
##### Custom strategy |
| 150 | 150 |
|
| 151 |
-The Custom `strategy` allows users of OpenShift to provide their own deployment behavior. |
|
| 151 |
+The Custom `strategy` allows users of OpenShift to provide their own deployment behavior. |
|
| 152 | 152 |
|
| 153 | 153 |
``` |
| 154 | 154 |
{
|
| ... | ... |
@@ -187,7 +187,7 @@ The `rollback` API object configures the generation process and provides the sco |
| 187 | 187 |
``` |
| 188 | 188 |
{
|
| 189 | 189 |
"kind": "DeploymentConfigRollback", |
| 190 |
- "apiVersion": "v1beta3", |
|
| 190 |
+ "apiVersion": "v1", |
|
| 191 | 191 |
"spec": {
|
| 192 | 192 |
"from": {
|
| 193 | 193 |
"name": "deployment-1" |
| ... | ... |
@@ -32,7 +32,7 @@ Decrypt data encrypted with "oc adm ca encrypt" |
| 32 | 32 |
---- |
| 33 | 33 |
# Decrypt an encrypted file to a cleartext file: |
| 34 | 34 |
oc adm ca decrypt --key=secret.key --in=secret.encrypted --out=secret.decrypted |
| 35 |
- |
|
| 35 |
+ |
|
| 36 | 36 |
# Decrypt from stdin to stdout: |
| 37 | 37 |
oc adm ca decrypt --key=secret.key < secret2.encrypted > secret2.decrypted |
| 38 | 38 |
|
| ... | ... |
@@ -49,7 +49,7 @@ Encrypt data with AES-256-CBC encryption |
| 49 | 49 |
---- |
| 50 | 50 |
# Encrypt the content of secret.txt with a generated key: |
| 51 | 51 |
oc adm ca encrypt --genkey=secret.key --in=secret.txt --out=secret.encrypted |
| 52 |
- |
|
| 52 |
+ |
|
| 53 | 53 |
# Encrypt the content of secret2.txt with an existing key: |
| 54 | 54 |
oc adm ca encrypt --key=secret.key < secret2.txt > secret2.encrypted |
| 55 | 55 |
|
| ... | ... |
@@ -91,7 +91,7 @@ Change configuration files for the client |
| 91 | 91 |
---- |
| 92 | 92 |
# Change the config context to use |
| 93 | 93 |
oc adm config use-context my-context |
| 94 |
- |
|
| 94 |
+ |
|
| 95 | 95 |
# Set the value of a config preference |
| 96 | 96 |
oc adm config set preferences.some true |
| 97 | 97 |
---- |
| ... | ... |
@@ -120,10 +120,10 @@ Sets a cluster entry in kubeconfig |
| 120 | 120 |
---- |
| 121 | 121 |
# Set only the server field on the e2e cluster entry without touching other values. |
| 122 | 122 |
oc adm config set-cluster e2e --server=https://1.2.3.4 |
| 123 |
- |
|
| 123 |
+ |
|
| 124 | 124 |
# Embed certificate authority data for the e2e cluster entry |
| 125 | 125 |
oc adm config set-cluster e2e --certificate-authority=~/.kube/e2e/kubernetes.ca.crt |
| 126 |
- |
|
| 126 |
+ |
|
| 127 | 127 |
# Disable cert checking for the dev cluster entry |
| 128 | 128 |
oc adm config set-cluster e2e --insecure-skip-tls-verify=true |
| 129 | 129 |
---- |
| ... | ... |
@@ -153,10 +153,10 @@ Sets a user entry in kubeconfig |
| 153 | 153 |
# Set only the "client-key" field on the "cluster-admin" |
| 154 | 154 |
# entry, without touching other values: |
| 155 | 155 |
oc adm config set-credentials cluster-admin --client-key=~/.kube/admin.key |
| 156 |
- |
|
| 156 |
+ |
|
| 157 | 157 |
# Set basic auth for the "cluster-admin" entry |
| 158 | 158 |
oc adm config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif |
| 159 |
- |
|
| 159 |
+ |
|
| 160 | 160 |
# Embed client certificate data in the "cluster-admin" entry |
| 161 | 161 |
oc adm config set-credentials cluster-admin --client-certificate=~/.kube/admin.crt --embed-certs=true |
| 162 | 162 |
---- |
| ... | ... |
@@ -172,7 +172,7 @@ Displays merged kubeconfig settings or a specified kubeconfig file. |
| 172 | 172 |
---- |
| 173 | 173 |
# Show Merged kubeconfig settings. |
| 174 | 174 |
oc adm config view |
| 175 |
- |
|
| 175 |
+ |
|
| 176 | 176 |
# Get the password for the e2e user |
| 177 | 177 |
oc adm config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
|
| 178 | 178 |
---- |
| ... | ... |
@@ -580,7 +580,7 @@ Install a router |
| 580 | 580 |
|
| 581 | 581 |
# Run the router with a hint to the underlying implementation to _not_ expose statistics. |
| 582 | 582 |
oc adm router router-west --stats-port=0 |
| 583 |
- |
|
| 583 |
+ |
|
| 584 | 584 |
---- |
| 585 | 585 |
==== |
| 586 | 586 |
|
| ... | ... |
@@ -766,7 +766,7 @@ Change configuration files for the client |
| 766 | 766 |
---- |
| 767 | 767 |
# Change the config context to use |
| 768 | 768 |
oc config use-context my-context |
| 769 |
- |
|
| 769 |
+ |
|
| 770 | 770 |
# Set the value of a config preference |
| 771 | 771 |
oc config set preferences.some true |
| 772 | 772 |
---- |
| ... | ... |
@@ -795,10 +795,10 @@ Sets a cluster entry in kubeconfig |
| 795 | 795 |
---- |
| 796 | 796 |
# Set only the server field on the e2e cluster entry without touching other values. |
| 797 | 797 |
oc config set-cluster e2e --server=https://1.2.3.4 |
| 798 |
- |
|
| 798 |
+ |
|
| 799 | 799 |
# Embed certificate authority data for the e2e cluster entry |
| 800 | 800 |
oc config set-cluster e2e --certificate-authority=~/.kube/e2e/kubernetes.ca.crt |
| 801 |
- |
|
| 801 |
+ |
|
| 802 | 802 |
# Disable cert checking for the dev cluster entry |
| 803 | 803 |
oc config set-cluster e2e --insecure-skip-tls-verify=true |
| 804 | 804 |
---- |
| ... | ... |
@@ -828,10 +828,10 @@ Sets a user entry in kubeconfig |
| 828 | 828 |
# Set only the "client-key" field on the "cluster-admin" |
| 829 | 829 |
# entry, without touching other values: |
| 830 | 830 |
oc config set-credentials cluster-admin --client-key=~/.kube/admin.key |
| 831 |
- |
|
| 831 |
+ |
|
| 832 | 832 |
# Set basic auth for the "cluster-admin" entry |
| 833 | 833 |
oc config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif |
| 834 |
- |
|
| 834 |
+ |
|
| 835 | 835 |
# Embed client certificate data in the "cluster-admin" entry |
| 836 | 836 |
oc config set-credentials cluster-admin --client-certificate=~/.kube/admin.crt --embed-certs=true |
| 837 | 837 |
---- |
| ... | ... |
@@ -847,7 +847,7 @@ Displays merged kubeconfig settings or a specified kubeconfig file. |
| 847 | 847 |
---- |
| 848 | 848 |
# Show Merged kubeconfig settings. |
| 849 | 849 |
oc config view |
| 850 |
- |
|
| 850 |
+ |
|
| 851 | 851 |
# Get the password for the e2e user |
| 852 | 852 |
oc config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
|
| 853 | 853 |
---- |
| ... | ... |
@@ -884,7 +884,7 @@ Create a resource by filename or stdin |
| 884 | 884 |
---- |
| 885 | 885 |
# Create a pod using the data in pod.json. |
| 886 | 886 |
oc create -f pod.json |
| 887 |
- |
|
| 887 |
+ |
|
| 888 | 888 |
# Create a pod based on the JSON passed into stdin. |
| 889 | 889 |
cat pod.json | oc create -f - |
| 890 | 890 |
---- |
| ... | ... |
@@ -913,10 +913,10 @@ Create a configMap from a local file, directory or literal value. |
| 913 | 913 |
---- |
| 914 | 914 |
# Create a new configmap named my-config with keys for each file in folder bar |
| 915 | 915 |
oc create configmap my-config --from-file=path/to/bar |
| 916 |
- |
|
| 916 |
+ |
|
| 917 | 917 |
# Create a new configmap named my-config with specified keys instead of names on disk |
| 918 | 918 |
oc create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt |
| 919 |
- |
|
| 919 |
+ |
|
| 920 | 920 |
# Create a new configMap named my-config with key1=config1 and key2=config2 |
| 921 | 921 |
oc create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2 |
| 922 | 922 |
---- |
| ... | ... |
@@ -997,7 +997,7 @@ Create a route that uses edge TLS termination |
| 997 | 997 |
---- |
| 998 | 998 |
# Create an edge route named "my-route" that exposes frontend service. |
| 999 | 999 |
oc create route edge my-route --service=frontend |
| 1000 |
- |
|
| 1000 |
+ |
|
| 1001 | 1001 |
# Create an edge route that exposes the frontend service and specify a path. |
| 1002 | 1002 |
# If the route name is omitted, the service name will be re-used. |
| 1003 | 1003 |
oc create route edge --service=frontend --path /assets |
| ... | ... |
@@ -1014,7 +1014,7 @@ Create a route that uses passthrough TLS termination |
| 1014 | 1014 |
---- |
| 1015 | 1015 |
# Create a passthrough route named "my-route" that exposes the frontend service. |
| 1016 | 1016 |
oc create route passthrough my-route --service=frontend |
| 1017 |
- |
|
| 1017 |
+ |
|
| 1018 | 1018 |
# Create a passthrough route that exposes the frontend service and specify |
| 1019 | 1019 |
# a hostname. If the route name is omitted, the service name will be re-used. |
| 1020 | 1020 |
oc create route passthrough --service=frontend --hostname=www.example.com |
| ... | ... |
@@ -1031,7 +1031,7 @@ Create a route that uses reencrypt TLS termination |
| 1031 | 1031 |
---- |
| 1032 | 1032 |
# Create a route named "my-route" that exposes the frontend service. |
| 1033 | 1033 |
oc create route reencrypt my-route --service=frontend --dest-ca-cert cert.cert |
| 1034 |
- |
|
| 1034 |
+ |
|
| 1035 | 1035 |
# Create a reencrypt route that exposes the frontend service and re-use |
| 1036 | 1036 |
# the service name as the route name. |
| 1037 | 1037 |
oc create route reencrypt --service=frontend --dest-ca-cert cert.cert |
| ... | ... |
@@ -1061,10 +1061,10 @@ Create a secret from a local file, directory or literal value. |
| 1061 | 1061 |
---- |
| 1062 | 1062 |
# Create a new secret named my-secret with keys for each file in folder bar |
| 1063 | 1063 |
oc create secret generic my-secret --from-file=path/to/bar |
| 1064 |
- |
|
| 1064 |
+ |
|
| 1065 | 1065 |
# Create a new secret named my-secret with specified keys instead of names on disk |
| 1066 | 1066 |
oc create secret generic my-secret --from-file=ssh-privatekey=~/.ssh/id_rsa --from-file=ssh-publickey=~/.ssh/id_rsa.pub |
| 1067 |
- |
|
| 1067 |
+ |
|
| 1068 | 1068 |
# Create a new secret named my-secret with key1=supersecret and key2=topsecret |
| 1069 | 1069 |
oc create secret generic my-secret --from-literal=key1=supersecret --from-literal=key2=topsecret |
| 1070 | 1070 |
---- |
| ... | ... |
@@ -1218,8 +1218,8 @@ Edit a resource on the server |
| 1218 | 1218 |
# Use an alternative editor |
| 1219 | 1219 |
OC_EDITOR="nano" oc edit dc/my-deployment |
| 1220 | 1220 |
|
| 1221 |
- # Edit the service 'docker-registry' in JSON using the v1beta3 API format: |
|
| 1222 |
- oc edit svc/docker-registry --output-version=v1beta3 -o json |
|
| 1221 |
+ # Edit the service 'docker-registry' in JSON using the v1 API format: |
|
| 1222 |
+ oc edit svc/docker-registry --output-version=v1 -o json |
|
| 1223 | 1223 |
---- |
| 1224 | 1224 |
==== |
| 1225 | 1225 |
|
| ... | ... |
@@ -1325,9 +1325,6 @@ Export resources so they can be used elsewhere |
| 1325 | 1325 |
|
| 1326 | 1326 |
# export to JSON |
| 1327 | 1327 |
oc export service -o json |
| 1328 |
- |
|
| 1329 |
- # convert a file on disk to the latest API version (in YAML, the default) |
|
| 1330 |
- oc export -f a_v1beta3_service.json --output-version=v1 --exact |
|
| 1331 | 1328 |
---- |
| 1332 | 1329 |
==== |
| 1333 | 1330 |
|
| ... | ... |
@@ -2059,7 +2056,7 @@ Generate a new token for a service account. |
| 2059 | 2059 |
# Generate a new token for service account 'default' |
| 2060 | 2060 |
oc serviceaccounts new-token 'default' |
| 2061 | 2061 |
|
| 2062 |
- # Generate a new token for service account 'default' and apply |
|
| 2062 |
+ # Generate a new token for service account 'default' and apply |
|
| 2063 | 2063 |
# labels 'foo' and 'bar' to the new token for identification |
| 2064 | 2064 |
# oc serviceaccounts new-token 'default' --labels foo=foo-value,bar=bar-value |
| 2065 | 2065 |
|
| ... | ... |
@@ -205,7 +205,7 @@ This API answers the question: which users and groups can perform the specified |
| 205 | 205 |
// input |
| 206 | 206 |
{
|
| 207 | 207 |
"kind": "ResourceAccessReview", |
| 208 |
- "apiVersion": "v1beta3", |
|
| 208 |
+ "apiVersion": "v1", |
|
| 209 | 209 |
"verb": "list", |
| 210 | 210 |
"resource": "replicationcontrollers" |
| 211 | 211 |
} |
| ... | ... |
@@ -218,7 +218,7 @@ accessReviewResult, err := Client.ResourceAccessReviews(namespace).Create(resour |
| 218 | 218 |
// output |
| 219 | 219 |
{
|
| 220 | 220 |
"kind": "ResourceAccessReviewResponse", |
| 221 |
- "apiVersion": "v1beta3", |
|
| 221 |
+ "apiVersion": "v1", |
|
| 222 | 222 |
"namespace": "default" |
| 223 | 223 |
"users": ["Clark", "Hubert"], |
| 224 | 224 |
"groups": ["cluster-admins"] |
| ... | ... |
@@ -262,13 +262,13 @@ This API answers the question: can a user or group (use authenticated user if no |
| 262 | 262 |
// input |
| 263 | 263 |
{
|
| 264 | 264 |
"kind": "SubjectAccessReview", |
| 265 |
- "apiVersion": "v1beta3", |
|
| 265 |
+ "apiVersion": "v1", |
|
| 266 | 266 |
"verb": "create", |
| 267 | 267 |
"resource": "pods", |
| 268 | 268 |
"user": "Clark", |
| 269 | 269 |
"content": {
|
| 270 | 270 |
"kind": "pods", |
| 271 |
- "apiVersion": "v1beta3" |
|
| 271 |
+ "apiVersion": "v1" |
|
| 272 | 272 |
// rest of pod content |
| 273 | 273 |
} |
| 274 | 274 |
} |
| ... | ... |
@@ -281,7 +281,7 @@ accessReviewResult, err := Client.SubjectAccessReviews(namespace).Create(subject |
| 281 | 281 |
// output |
| 282 | 282 |
{
|
| 283 | 283 |
"kind": "SubjectAccessReviewResponse", |
| 284 |
- "apiVersion": "v1beta3", |
|
| 284 |
+ "apiVersion": "v1", |
|
| 285 | 285 |
"namespace": "default", |
| 286 | 286 |
"allowed": true |
| 287 | 287 |
} |
| ... | ... |
@@ -282,7 +282,7 @@ A database is exposed to the application using a service: |
| 282 | 282 |
```json |
| 283 | 283 |
{
|
| 284 | 284 |
"kind": "Service", |
| 285 |
- "apiVersion": "v1beta3", |
|
| 285 |
+ "apiVersion": "v1", |
|
| 286 | 286 |
"metadata": {
|
| 287 | 287 |
"name": "mysql" |
| 288 | 288 |
}, |
| ... | ... |
@@ -310,7 +310,7 @@ A deployment configuration describes the template for application deployments: |
| 310 | 310 |
```json |
| 311 | 311 |
{
|
| 312 | 312 |
"kind": "DeploymentConfig", |
| 313 |
- "apiVersion": "v1beta3", |
|
| 313 |
+ "apiVersion": "v1", |
|
| 314 | 314 |
"metadata": {
|
| 315 | 315 |
"name": "rails" |
| 316 | 316 |
}, |
| ... | ... |
@@ -133,7 +133,7 @@ pod.json |
| 133 | 133 |
|
| 134 | 134 |
{
|
| 135 | 135 |
"kind": "Pod", |
| 136 |
- "apiVersion": "v1beta3", |
|
| 136 |
+ "apiVersion": "v1", |
|
| 137 | 137 |
"metadata": {
|
| 138 | 138 |
"name": "hello-pod", |
| 139 | 139 |
"labels": {
|
| ... | ... |
@@ -170,7 +170,7 @@ service.json |
| 170 | 170 |
|
| 171 | 171 |
{
|
| 172 | 172 |
"kind": "Service", |
| 173 |
- "apiVersion": "v1beta3", |
|
| 173 |
+ "apiVersion": "v1", |
|
| 174 | 174 |
"metadata": {
|
| 175 | 175 |
"name": "hello-openshift" |
| 176 | 176 |
}, |
| ... | ... |
@@ -196,7 +196,7 @@ route.json |
| 196 | 196 |
|
| 197 | 197 |
{
|
| 198 | 198 |
"kind": "Route", |
| 199 |
- "apiVersion": "v1beta3", |
|
| 199 |
+ "apiVersion": "v1", |
|
| 200 | 200 |
"metadata": {
|
| 201 | 201 |
"name": "hello-route" |
| 202 | 202 |
}, |
| ... | ... |
@@ -19,7 +19,7 @@ at most to a single host. |
| 19 | 19 |
|
| 20 | 20 |
```shell |
| 21 | 21 |
$ cat pod-with-resources.yaml |
| 22 |
-apiVersion: v1beta3 |
|
| 22 |
+apiVersion: v1 |
|
| 23 | 23 |
kind: Pod |
| 24 | 24 |
metadata: |
| 25 | 25 |
name: pod-with-resources |
| ... | ... |
@@ -106,7 +106,7 @@ cpu and memory. |
| 106 | 106 |
|
| 107 | 107 |
```shell |
| 108 | 108 |
$ cat pod-without-resources.yaml |
| 109 |
-apiVersion: v1beta3 |
|
| 109 |
+apiVersion: v1 |
|
| 110 | 110 |
kind: Pod |
| 111 | 111 |
metadata: |
| 112 | 112 |
name: pod-without-resources |
| ... | ... |
@@ -144,7 +144,7 @@ So let's set some default limits for this project: |
| 144 | 144 |
|
| 145 | 145 |
```shell |
| 146 | 146 |
$ cat limits.yaml |
| 147 |
-apiVersion: v1beta3 |
|
| 147 |
+apiVersion: v1 |
|
| 148 | 148 |
kind: LimitRange |
| 149 | 149 |
metadata: |
| 150 | 150 |
name: limits |
| ... | ... |
@@ -259,7 +259,7 @@ Labels: <none> |
| 259 | 259 |
Description: This example shows how to create a simple ruby application in openshift origin v3 |
| 260 | 260 |
Annotations: iconClass=icon-ruby,tags=instant-app,ruby,mysql |
| 261 | 261 |
|
| 262 |
-Parameters: |
|
| 262 |
+Parameters: |
|
| 263 | 263 |
Name: ADMIN_USERNAME |
| 264 | 264 |
Description: administrator username |
| 265 | 265 |
Generated: expression |
| ... | ... |
@@ -316,7 +316,7 @@ Parameters: |
| 316 | 316 |
|
| 317 | 317 |
Object Labels: template=application-template-stibuild |
| 318 | 318 |
|
| 319 |
-Objects: |
|
| 319 |
+Objects: |
|
| 320 | 320 |
Service frontend |
| 321 | 321 |
Route route-edge |
| 322 | 322 |
ImageStream origin-ruby-sample |
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "Template", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {
|
| 5 | 5 |
"name": "ruby-helloworld-sample-with-resources", |
| 6 | 6 |
"creationTimestamp": null, |
| ... | ... |
@@ -13,7 +13,7 @@ |
| 13 | 13 |
"objects": [ |
| 14 | 14 |
{
|
| 15 | 15 |
"kind": "Service", |
| 16 |
- "apiVersion": "v1beta3", |
|
| 16 |
+ "apiVersion": "v1", |
|
| 17 | 17 |
"metadata": {
|
| 18 | 18 |
"name": "frontend", |
| 19 | 19 |
"creationTimestamp": null |
| ... | ... |
@@ -41,7 +41,7 @@ |
| 41 | 41 |
}, |
| 42 | 42 |
{
|
| 43 | 43 |
"kind": "Route", |
| 44 |
- "apiVersion": "v1beta3", |
|
| 44 |
+ "apiVersion": "v1", |
|
| 45 | 45 |
"metadata": {
|
| 46 | 46 |
"name": "route-edge", |
| 47 | 47 |
"creationTimestamp": null |
| ... | ... |
@@ -63,7 +63,7 @@ |
| 63 | 63 |
}, |
| 64 | 64 |
{
|
| 65 | 65 |
"kind": "ImageStream", |
| 66 |
- "apiVersion": "v1beta3", |
|
| 66 |
+ "apiVersion": "v1", |
|
| 67 | 67 |
"metadata": {
|
| 68 | 68 |
"name": "origin-ruby-sample", |
| 69 | 69 |
"creationTimestamp": null |
| ... | ... |
@@ -75,7 +75,7 @@ |
| 75 | 75 |
}, |
| 76 | 76 |
{
|
| 77 | 77 |
"kind": "ImageStream", |
| 78 |
- "apiVersion": "v1beta3", |
|
| 78 |
+ "apiVersion": "v1", |
|
| 79 | 79 |
"metadata": {
|
| 80 | 80 |
"name": "ruby-20-centos7", |
| 81 | 81 |
"creationTimestamp": null |
| ... | ... |
@@ -89,11 +89,11 @@ |
| 89 | 89 |
}, |
| 90 | 90 |
{
|
| 91 | 91 |
"kind": "BuildConfig", |
| 92 |
- "apiVersion": "v1beta3", |
|
| 92 |
+ "apiVersion": "v1", |
|
| 93 | 93 |
"metadata": {
|
| 94 | 94 |
"name": "ruby-sample-build", |
| 95 | 95 |
"namespace": "quota-demo", |
| 96 |
- "selfLink": "/osapi/v1beta3/namespaces/quota-demo/buildconfigs/ruby-sample-build", |
|
| 96 |
+ "selfLink": "/osapi/v1/namespaces/quota-demo/buildconfigs/ruby-sample-build", |
|
| 97 | 97 |
"uid": "bf2174b3-fe5e-11e4-8f83-080027893417", |
| 98 | 98 |
"creationTimestamp": "2015-05-19T19:39:21Z", |
| 99 | 99 |
"labels": {
|
| ... | ... |
@@ -157,7 +157,7 @@ |
| 157 | 157 |
}, |
| 158 | 158 |
{
|
| 159 | 159 |
"kind": "DeploymentConfig", |
| 160 |
- "apiVersion": "v1beta3", |
|
| 160 |
+ "apiVersion": "v1", |
|
| 161 | 161 |
"metadata": {
|
| 162 | 162 |
"name": "frontend", |
| 163 | 163 |
"namespace": "test", |
| ... | ... |
@@ -292,7 +292,7 @@ |
| 292 | 292 |
}, |
| 293 | 293 |
{
|
| 294 | 294 |
"kind": "Service", |
| 295 |
- "apiVersion": "v1beta3", |
|
| 295 |
+ "apiVersion": "v1", |
|
| 296 | 296 |
"metadata": {
|
| 297 | 297 |
"name": "database", |
| 298 | 298 |
"creationTimestamp": null |
| ... | ... |
@@ -320,7 +320,7 @@ |
| 320 | 320 |
}, |
| 321 | 321 |
{
|
| 322 | 322 |
"kind": "DeploymentConfig", |
| 323 |
- "apiVersion": "v1beta3", |
|
| 323 |
+ "apiVersion": "v1", |
|
| 324 | 324 |
"metadata": {
|
| 325 | 325 |
"name": "database", |
| 326 | 326 |
"namespace": "test", |
| ... | ... |
@@ -1,11 +1,11 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "Config", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {},
|
| 5 | 5 |
"items": [ |
| 6 | 6 |
{
|
| 7 | 7 |
"kind": "Service", |
| 8 |
- "apiVersion": "v1beta3", |
|
| 8 |
+ "apiVersion": "v1", |
|
| 9 | 9 |
"metadata": {
|
| 10 | 10 |
"name": "hello-openshift-service", |
| 11 | 11 |
"creationTimestamp": null |
| ... | ... |
@@ -32,7 +32,7 @@ |
| 32 | 32 |
}, |
| 33 | 33 |
{
|
| 34 | 34 |
"kind": "ReplicationController", |
| 35 |
- "apiVersion": "v1beta3", |
|
| 35 |
+ "apiVersion": "v1", |
|
| 36 | 36 |
"metadata": {
|
| 37 | 37 |
"name": "hello-openshift", |
| 38 | 38 |
"creationTimestamp": null, |
| ... | ... |
@@ -84,7 +84,7 @@ |
| 84 | 84 |
}, |
| 85 | 85 |
{
|
| 86 | 86 |
"kind": "Route", |
| 87 |
- "apiVersion": "v1beta3", |
|
| 87 |
+ "apiVersion": "v1", |
|
| 88 | 88 |
"metadata": {
|
| 89 | 89 |
"name": "hello-openshift-route", |
| 90 | 90 |
"creationTimestamp": null |
| ... | ... |
@@ -15,13 +15,13 @@ var Version = unversioned.GroupVersion{Group: "", Version: "v1"}
|
| 15 | 15 |
|
| 16 | 16 |
// OldestVersion is the string that represents the oldest server version supported, |
| 17 | 17 |
// for client code that wants to hardcode the lowest common denominator. |
| 18 |
-var OldestVersion = unversioned.GroupVersion{Group: "", Version: "v1beta3"}
|
|
| 18 |
+var OldestVersion = unversioned.GroupVersion{Group: "", Version: "v1"}
|
|
| 19 | 19 |
|
| 20 | 20 |
// Versions is the list of versions that are recognized in code. The order provided |
| 21 | 21 |
// may be assumed to be most preferred to least preferred, and clients may |
| 22 | 22 |
// choose to prefer the earlier items in the list over the latter items when presented |
| 23 | 23 |
// with a set of versions to choose. |
| 24 |
-var Versions = []unversioned.GroupVersion{{Group: "", Version: "v1"}, {Group: "", Version: "v1beta3"}}
|
|
| 24 |
+var Versions = []unversioned.GroupVersion{{Group: "", Version: "v1"}}
|
|
| 25 | 25 |
|
| 26 | 26 |
// originTypes are the hardcoded types defined by the OpenShift API. |
| 27 | 27 |
var originTypes map[unversioned.GroupVersionKind]bool |
| ... | ... |
@@ -13,7 +13,7 @@ import ( |
| 13 | 13 |
) |
| 14 | 14 |
|
| 15 | 15 |
func TestRESTRootScope(t *testing.T) {
|
| 16 |
- for _, v := range [][]string{{"v1beta3"}, {"v1"}} {
|
|
| 16 |
+ for _, v := range [][]string{{"v1"}} {
|
|
| 17 | 17 |
mapping, err := registered.RESTMapper().RESTMapping(kapi.Kind("Node"), v...)
|
| 18 | 18 |
if err != nil {
|
| 19 | 19 |
t.Fatal(err) |
| ... | ... |
@@ -23,7 +23,6 @@ import ( |
| 23 | 23 |
osapi "github.com/openshift/origin/pkg/api" |
| 24 | 24 |
_ "github.com/openshift/origin/pkg/api/latest" |
| 25 | 25 |
"github.com/openshift/origin/pkg/api/v1" |
| 26 |
- "github.com/openshift/origin/pkg/api/v1beta3" |
|
| 27 | 26 |
authorizationapi "github.com/openshift/origin/pkg/authorization/api" |
| 28 | 27 |
build "github.com/openshift/origin/pkg/build/api" |
| 29 | 28 |
deploy "github.com/openshift/origin/pkg/deploy/api" |
| ... | ... |
@@ -341,61 +340,6 @@ func fuzzInternalObject(t *testing.T, forVersion unversioned.GroupVersion, item |
| 341 | 341 |
j.From.Kind = "DockerImage" |
| 342 | 342 |
j.From.Name = specs[c.Intn(len(specs))] |
| 343 | 343 |
}, |
| 344 |
- func(j *kapi.PodSecurityContext, c fuzz.Continue) {
|
|
| 345 |
- c.FuzzNoCustom(j) |
|
| 346 |
- if forVersion == v1beta3.SchemeGroupVersion {
|
|
| 347 |
- // v1beta3 does not contain the PodSecurityContext type. For this API version, only fuzz |
|
| 348 |
- // the host namespace fields. The fields set to nil here are the other fields of the |
|
| 349 |
- // PodSecurityContext that will not roundtrip correctly from internal->v1beta3->internal. |
|
| 350 |
- j.SELinuxOptions = nil |
|
| 351 |
- j.RunAsUser = nil |
|
| 352 |
- j.RunAsNonRoot = nil |
|
| 353 |
- j.SupplementalGroups = nil |
|
| 354 |
- j.FSGroup = nil |
|
| 355 |
- } |
|
| 356 |
- }, |
|
| 357 |
- func(j *kapi.GitRepoVolumeSource, c fuzz.Continue) {
|
|
| 358 |
- c.FuzzNoCustom(j) |
|
| 359 |
- if forVersion == v1beta3.SchemeGroupVersion {
|
|
| 360 |
- // these fields are set to their empty state when testing v1beta3 |
|
| 361 |
- // they were added to v1 after v1beta3 was disabled as a storage or API version, so we don't have to support v1beta3 round-tripping |
|
| 362 |
- j.Directory = "" |
|
| 363 |
- } |
|
| 364 |
- }, |
|
| 365 |
- func(j *kapi.ISCSIVolumeSource, c fuzz.Continue) {
|
|
| 366 |
- c.FuzzNoCustom(j) |
|
| 367 |
- if forVersion == v1beta3.SchemeGroupVersion {
|
|
| 368 |
- // these fields are set to their empty state when testing v1beta3 |
|
| 369 |
- // they were added to v1 after v1beta3 was disabled as a storage or API version, so we don't have to support v1beta3 round-tripping |
|
| 370 |
- j.ISCSIInterface = "" |
|
| 371 |
- } else if j.ISCSIInterface == "" {
|
|
| 372 |
- // otherwise an empty value defaults to "default" |
|
| 373 |
- j.ISCSIInterface = "default" |
|
| 374 |
- } |
|
| 375 |
- }, |
|
| 376 |
- func(j *kapi.CephFSVolumeSource, c fuzz.Continue) {
|
|
| 377 |
- c.FuzzNoCustom(j) |
|
| 378 |
- // this field does not exist on v1beta3 |
|
| 379 |
- j.Path = "" |
|
| 380 |
- }, |
|
| 381 |
- func(j *kapi.Event, c fuzz.Continue) {
|
|
| 382 |
- c.FuzzNoCustom(j) |
|
| 383 |
- if forVersion == v1beta3.SchemeGroupVersion {
|
|
| 384 |
- // these fields are set to their empty state when testing v1beta3 |
|
| 385 |
- // they were added to v1 after v1beta3 was disabled as a storage or API version, so we don't have to support v1beta3 round-tripping |
|
| 386 |
- j.Type = "" |
|
| 387 |
- } |
|
| 388 |
- }, |
|
| 389 |
- func(j *kapi.Probe, c fuzz.Continue) {
|
|
| 390 |
- c.FuzzNoCustom(j) |
|
| 391 |
- if forVersion == v1beta3.SchemeGroupVersion {
|
|
| 392 |
- // these fields are set to their empty state when testing v1beta3 |
|
| 393 |
- // they were added to v1 after v1beta3 was disabled as a storage or API version, so we don't have to support v1beta3 round-tripping |
|
| 394 |
- j.PeriodSeconds = 0 |
|
| 395 |
- j.SuccessThreshold = 0 |
|
| 396 |
- j.FailureThreshold = 0 |
|
| 397 |
- } |
|
| 398 |
- }, |
|
| 399 | 344 |
func(j *runtime.Object, c fuzz.Continue) {
|
| 400 | 345 |
// runtime.EmbeddedObject causes a panic inside of fuzz because runtime.Object isn't handled. |
| 401 | 346 |
}, |
| 3 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,19 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- |
|
| 6 |
- _ "github.com/openshift/origin/pkg/authorization/api/v1beta3" |
|
| 7 |
- _ "github.com/openshift/origin/pkg/build/api/v1beta3" |
|
| 8 |
- _ "github.com/openshift/origin/pkg/deploy/api/v1beta3" |
|
| 9 |
- _ "github.com/openshift/origin/pkg/image/api/v1beta3" |
|
| 10 |
- _ "github.com/openshift/origin/pkg/oauth/api/v1beta3" |
|
| 11 |
- _ "github.com/openshift/origin/pkg/project/api/v1beta3" |
|
| 12 |
- _ "github.com/openshift/origin/pkg/route/api/v1beta3" |
|
| 13 |
- _ "github.com/openshift/origin/pkg/sdn/api/v1beta3" |
|
| 14 |
- _ "github.com/openshift/origin/pkg/template/api/v1beta3" |
|
| 15 |
- _ "github.com/openshift/origin/pkg/user/api/v1beta3" |
|
| 16 |
-) |
|
| 17 |
- |
|
| 18 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 19 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: "", Version: "v1beta3"}
|
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/openshift/origin/pkg/authorization/api" |
| 17 | 17 |
"github.com/openshift/origin/pkg/authorization/api/v1" |
| 18 |
- "github.com/openshift/origin/pkg/authorization/api/v1beta3" |
|
| 19 | 18 |
) |
| 20 | 19 |
|
| 21 | 20 |
const importPrefix = "github.com/openshift/origin/pkg/authorization/api" |
| ... | ... |
@@ -23,7 +22,7 @@ const importPrefix = "github.com/openshift/origin/pkg/authorization/api" |
| 23 | 23 |
var accessor = meta.NewAccessor() |
| 24 | 24 |
|
| 25 | 25 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 26 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 26 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
|
| 27 | 27 |
|
| 28 | 28 |
func init() {
|
| 29 | 29 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -81,8 +80,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 81 | 81 |
switch v {
|
| 82 | 82 |
case v1.SchemeGroupVersion: |
| 83 | 83 |
v1.AddToScheme(kapi.Scheme) |
| 84 |
- case v1beta3.SchemeGroupVersion: |
|
| 85 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 86 | 84 |
|
| 87 | 85 |
default: |
| 88 | 86 |
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
| ... | ... |
@@ -105,12 +102,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 105 | 105 |
MetadataAccessor: accessor, |
| 106 | 106 |
}, nil |
| 107 | 107 |
|
| 108 |
- case v1beta3.SchemeGroupVersion: |
|
| 109 |
- return &meta.VersionInterfaces{
|
|
| 110 |
- ObjectConvertor: kapi.Scheme, |
|
| 111 |
- MetadataAccessor: accessor, |
|
| 112 |
- }, nil |
|
| 113 |
- |
|
| 114 | 108 |
default: |
| 115 | 109 |
g, _ := registered.Group(api.GroupName) |
| 116 | 110 |
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
| 117 | 111 |
deleted file mode 100644 |
| ... | ... |
@@ -1,441 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "sort" |
|
| 5 |
- |
|
| 6 |
- "k8s.io/kubernetes/pkg/conversion" |
|
| 7 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 8 |
- "k8s.io/kubernetes/pkg/util/sets" |
|
| 9 |
- |
|
| 10 |
- oapi "github.com/openshift/origin/pkg/api" |
|
| 11 |
- newer "github.com/openshift/origin/pkg/authorization/api" |
|
| 12 |
- uservalidation "github.com/openshift/origin/pkg/user/api/validation" |
|
| 13 |
-) |
|
| 14 |
- |
|
| 15 |
-func Convert_v1beta3_ResourceAccessReview_To_api_ResourceAccessReview(in *ResourceAccessReview, out *newer.ResourceAccessReview, s conversion.Scope) error {
|
|
| 16 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 17 |
- return err |
|
| 18 |
- } |
|
| 19 |
- if err := s.DefaultConvert(&in.AuthorizationAttributes, &out.Action, conversion.IgnoreMissingFields); err != nil {
|
|
| 20 |
- return err |
|
| 21 |
- } |
|
| 22 |
- |
|
| 23 |
- return nil |
|
| 24 |
-} |
|
| 25 |
- |
|
| 26 |
-func Convert_api_ResourceAccessReview_To_v1beta3_ResourceAccessReview(in *newer.ResourceAccessReview, out *ResourceAccessReview, s conversion.Scope) error {
|
|
| 27 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 28 |
- return err |
|
| 29 |
- } |
|
| 30 |
- if err := s.DefaultConvert(&in.Action, &out.AuthorizationAttributes, conversion.IgnoreMissingFields); err != nil {
|
|
| 31 |
- return err |
|
| 32 |
- } |
|
| 33 |
- |
|
| 34 |
- return nil |
|
| 35 |
-} |
|
| 36 |
- |
|
| 37 |
-func Convert_v1beta3_LocalResourceAccessReview_To_api_LocalResourceAccessReview(in *LocalResourceAccessReview, out *newer.LocalResourceAccessReview, s conversion.Scope) error {
|
|
| 38 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 39 |
- return err |
|
| 40 |
- } |
|
| 41 |
- if err := s.DefaultConvert(&in.AuthorizationAttributes, &out.Action, conversion.IgnoreMissingFields); err != nil {
|
|
| 42 |
- return err |
|
| 43 |
- } |
|
| 44 |
- |
|
| 45 |
- return nil |
|
| 46 |
-} |
|
| 47 |
- |
|
| 48 |
-func Convert_api_LocalResourceAccessReview_To_v1beta3_LocalResourceAccessReview(in *newer.LocalResourceAccessReview, out *LocalResourceAccessReview, s conversion.Scope) error {
|
|
| 49 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 50 |
- return err |
|
| 51 |
- } |
|
| 52 |
- if err := s.DefaultConvert(&in.Action, &out.AuthorizationAttributes, conversion.IgnoreMissingFields); err != nil {
|
|
| 53 |
- return err |
|
| 54 |
- } |
|
| 55 |
- |
|
| 56 |
- return nil |
|
| 57 |
-} |
|
| 58 |
- |
|
| 59 |
-func Convert_v1beta3_SubjectAccessReview_To_api_SubjectAccessReview(in *SubjectAccessReview, out *newer.SubjectAccessReview, s conversion.Scope) error {
|
|
| 60 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 61 |
- return err |
|
| 62 |
- } |
|
| 63 |
- if err := s.DefaultConvert(&in.AuthorizationAttributes, &out.Action, conversion.IgnoreMissingFields); err != nil {
|
|
| 64 |
- return err |
|
| 65 |
- } |
|
| 66 |
- |
|
| 67 |
- out.Groups = sets.NewString(in.GroupsSlice...) |
|
| 68 |
- |
|
| 69 |
- return nil |
|
| 70 |
-} |
|
| 71 |
- |
|
| 72 |
-func Convert_api_SubjectAccessReview_To_v1beta3_SubjectAccessReview(in *newer.SubjectAccessReview, out *SubjectAccessReview, s conversion.Scope) error {
|
|
| 73 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 74 |
- return err |
|
| 75 |
- } |
|
| 76 |
- if err := s.DefaultConvert(&in.Action, &out.AuthorizationAttributes, conversion.IgnoreMissingFields); err != nil {
|
|
| 77 |
- return err |
|
| 78 |
- } |
|
| 79 |
- |
|
| 80 |
- out.GroupsSlice = in.Groups.List() |
|
| 81 |
- |
|
| 82 |
- return nil |
|
| 83 |
-} |
|
| 84 |
- |
|
| 85 |
-func Convert_v1beta3_LocalSubjectAccessReview_To_api_LocalSubjectAccessReview(in *LocalSubjectAccessReview, out *newer.LocalSubjectAccessReview, s conversion.Scope) error {
|
|
| 86 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 87 |
- return err |
|
| 88 |
- } |
|
| 89 |
- if err := s.DefaultConvert(&in.AuthorizationAttributes, &out.Action, conversion.IgnoreMissingFields); err != nil {
|
|
| 90 |
- return err |
|
| 91 |
- } |
|
| 92 |
- |
|
| 93 |
- out.Groups = sets.NewString(in.GroupsSlice...) |
|
| 94 |
- |
|
| 95 |
- return nil |
|
| 96 |
-} |
|
| 97 |
- |
|
| 98 |
-func Convert_api_LocalSubjectAccessReview_To_v1beta3_LocalSubjectAccessReview(in *newer.LocalSubjectAccessReview, out *LocalSubjectAccessReview, s conversion.Scope) error {
|
|
| 99 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 100 |
- return err |
|
| 101 |
- } |
|
| 102 |
- if err := s.DefaultConvert(&in.Action, &out.AuthorizationAttributes, conversion.IgnoreMissingFields); err != nil {
|
|
| 103 |
- return err |
|
| 104 |
- } |
|
| 105 |
- |
|
| 106 |
- out.GroupsSlice = in.Groups.List() |
|
| 107 |
- |
|
| 108 |
- return nil |
|
| 109 |
-} |
|
| 110 |
- |
|
| 111 |
-func Convert_v1beta3_ResourceAccessReviewResponse_To_api_ResourceAccessReviewResponse(in *ResourceAccessReviewResponse, out *newer.ResourceAccessReviewResponse, s conversion.Scope) error {
|
|
| 112 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 113 |
- return err |
|
| 114 |
- } |
|
| 115 |
- |
|
| 116 |
- out.Users = sets.NewString(in.UsersSlice...) |
|
| 117 |
- out.Groups = sets.NewString(in.GroupsSlice...) |
|
| 118 |
- |
|
| 119 |
- return nil |
|
| 120 |
-} |
|
| 121 |
- |
|
| 122 |
-func Convert_api_ResourceAccessReviewResponse_To_v1beta3_ResourceAccessReviewResponse(in *newer.ResourceAccessReviewResponse, out *ResourceAccessReviewResponse, s conversion.Scope) error {
|
|
| 123 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 124 |
- return err |
|
| 125 |
- } |
|
| 126 |
- |
|
| 127 |
- out.UsersSlice = in.Users.List() |
|
| 128 |
- out.GroupsSlice = in.Groups.List() |
|
| 129 |
- |
|
| 130 |
- return nil |
|
| 131 |
-} |
|
| 132 |
- |
|
| 133 |
-func Convert_v1beta3_PolicyRule_To_api_PolicyRule(in *PolicyRule, out *newer.PolicyRule, s conversion.Scope) error {
|
|
| 134 |
- if err := oapi.Convert_runtime_RawExtension_To_runtime_Object(&in.AttributeRestrictions, out.AttributeRestrictions, s); err != nil {
|
|
| 135 |
- return err |
|
| 136 |
- } |
|
| 137 |
- if in.AttributeRestrictions.Object != nil {
|
|
| 138 |
- out.AttributeRestrictions = in.AttributeRestrictions.Object |
|
| 139 |
- } |
|
| 140 |
- |
|
| 141 |
- out.APIGroups = in.APIGroups |
|
| 142 |
- |
|
| 143 |
- out.Resources = sets.String{}
|
|
| 144 |
- out.Resources.Insert(in.Resources...) |
|
| 145 |
- out.Resources.Insert(in.ResourceKinds...) |
|
| 146 |
- |
|
| 147 |
- out.Verbs = sets.String{}
|
|
| 148 |
- out.Verbs.Insert(in.Verbs...) |
|
| 149 |
- |
|
| 150 |
- out.ResourceNames = sets.NewString(in.ResourceNames...) |
|
| 151 |
- |
|
| 152 |
- out.NonResourceURLs = sets.NewString(in.NonResourceURLsSlice...) |
|
| 153 |
- |
|
| 154 |
- return nil |
|
| 155 |
-} |
|
| 156 |
- |
|
| 157 |
-func Convert_api_PolicyRule_To_v1beta3_PolicyRule(in *newer.PolicyRule, out *PolicyRule, s conversion.Scope) error {
|
|
| 158 |
- if err := oapi.Convert_runtime_Object_To_runtime_RawExtension(in.AttributeRestrictions, &out.AttributeRestrictions, s); err != nil {
|
|
| 159 |
- return err |
|
| 160 |
- } |
|
| 161 |
- |
|
| 162 |
- out.APIGroups = in.APIGroups |
|
| 163 |
- |
|
| 164 |
- out.Resources = []string{}
|
|
| 165 |
- out.Resources = append(out.Resources, in.Resources.List()...) |
|
| 166 |
- |
|
| 167 |
- out.Verbs = []string{}
|
|
| 168 |
- out.Verbs = append(out.Verbs, in.Verbs.List()...) |
|
| 169 |
- |
|
| 170 |
- out.ResourceNames = in.ResourceNames.List() |
|
| 171 |
- |
|
| 172 |
- out.NonResourceURLsSlice = in.NonResourceURLs.List() |
|
| 173 |
- |
|
| 174 |
- return nil |
|
| 175 |
-} |
|
| 176 |
- |
|
| 177 |
-func Convert_v1beta3_Policy_To_api_Policy(in *Policy, out *newer.Policy, s conversion.Scope) error {
|
|
| 178 |
- out.LastModified = in.LastModified |
|
| 179 |
- out.Roles = make(map[string]*newer.Role) |
|
| 180 |
- return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) |
|
| 181 |
-} |
|
| 182 |
- |
|
| 183 |
-func Convert_api_Policy_To_v1beta3_Policy(in *newer.Policy, out *Policy, s conversion.Scope) error {
|
|
| 184 |
- out.LastModified = in.LastModified |
|
| 185 |
- out.Roles = make([]NamedRole, 0, 0) |
|
| 186 |
- return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) |
|
| 187 |
-} |
|
| 188 |
- |
|
| 189 |
-func Convert_v1beta3_RoleBinding_To_api_RoleBinding(in *RoleBinding, out *newer.RoleBinding, s conversion.Scope) error {
|
|
| 190 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields|conversion.AllowDifferentFieldTypeNames); err != nil {
|
|
| 191 |
- return err |
|
| 192 |
- } |
|
| 193 |
- |
|
| 194 |
- // if the users and groups fields are cleared, then respect only subjects. The field was set in the DefaultConvert above |
|
| 195 |
- if in.UserNames == nil && in.GroupNames == nil {
|
|
| 196 |
- return nil |
|
| 197 |
- } |
|
| 198 |
- |
|
| 199 |
- out.Subjects = newer.BuildSubjects(in.UserNames, in.GroupNames, uservalidation.ValidateUserName, uservalidation.ValidateGroupName) |
|
| 200 |
- |
|
| 201 |
- return nil |
|
| 202 |
-} |
|
| 203 |
- |
|
| 204 |
-func Convert_api_RoleBinding_To_v1beta3_RoleBinding(in *newer.RoleBinding, out *RoleBinding, s conversion.Scope) error {
|
|
| 205 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields|conversion.AllowDifferentFieldTypeNames); err != nil {
|
|
| 206 |
- return err |
|
| 207 |
- } |
|
| 208 |
- |
|
| 209 |
- out.UserNames, out.GroupNames = newer.StringSubjectsFor(in.Namespace, in.Subjects) |
|
| 210 |
- |
|
| 211 |
- return nil |
|
| 212 |
-} |
|
| 213 |
- |
|
| 214 |
-func Convert_v1beta3_PolicyBinding_To_api_PolicyBinding(in *PolicyBinding, out *newer.PolicyBinding, s conversion.Scope) error {
|
|
| 215 |
- out.LastModified = in.LastModified |
|
| 216 |
- out.RoleBindings = make(map[string]*newer.RoleBinding) |
|
| 217 |
- return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) |
|
| 218 |
-} |
|
| 219 |
- |
|
| 220 |
-func Convert_api_PolicyBinding_To_v1beta3_PolicyBinding(in *newer.PolicyBinding, out *PolicyBinding, s conversion.Scope) error {
|
|
| 221 |
- out.LastModified = in.LastModified |
|
| 222 |
- out.RoleBindings = make([]NamedRoleBinding, 0, 0) |
|
| 223 |
- return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) |
|
| 224 |
-} |
|
| 225 |
- |
|
| 226 |
-// and now the globals |
|
| 227 |
-func Convert_v1beta3_ClusterPolicy_To_api_ClusterPolicy(in *ClusterPolicy, out *newer.ClusterPolicy, s conversion.Scope) error {
|
|
| 228 |
- out.LastModified = in.LastModified |
|
| 229 |
- out.Roles = make(map[string]*newer.ClusterRole) |
|
| 230 |
- return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) |
|
| 231 |
-} |
|
| 232 |
- |
|
| 233 |
-func Convert_api_ClusterPolicy_To_v1beta3_ClusterPolicy(in *newer.ClusterPolicy, out *ClusterPolicy, s conversion.Scope) error {
|
|
| 234 |
- out.LastModified = in.LastModified |
|
| 235 |
- out.Roles = make([]NamedClusterRole, 0, 0) |
|
| 236 |
- return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) |
|
| 237 |
-} |
|
| 238 |
- |
|
| 239 |
-func Convert_v1beta3_ClusterRoleBinding_To_api_ClusterRoleBinding(in *ClusterRoleBinding, out *newer.ClusterRoleBinding, s conversion.Scope) error {
|
|
| 240 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields|conversion.AllowDifferentFieldTypeNames); err != nil {
|
|
| 241 |
- return err |
|
| 242 |
- } |
|
| 243 |
- |
|
| 244 |
- // if the users and groups fields are cleared, then respect only subjects. The field was set in the DefaultConvert above |
|
| 245 |
- if in.UserNames == nil && in.GroupNames == nil {
|
|
| 246 |
- return nil |
|
| 247 |
- } |
|
| 248 |
- |
|
| 249 |
- out.Subjects = newer.BuildSubjects(in.UserNames, in.GroupNames, uservalidation.ValidateUserName, uservalidation.ValidateGroupName) |
|
| 250 |
- |
|
| 251 |
- return nil |
|
| 252 |
-} |
|
| 253 |
- |
|
| 254 |
-func Convert_api_ClusterRoleBinding_To_v1beta3_ClusterRoleBinding(in *newer.ClusterRoleBinding, out *ClusterRoleBinding, s conversion.Scope) error {
|
|
| 255 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields|conversion.AllowDifferentFieldTypeNames); err != nil {
|
|
| 256 |
- return err |
|
| 257 |
- } |
|
| 258 |
- |
|
| 259 |
- out.UserNames, out.GroupNames = newer.StringSubjectsFor(in.Namespace, in.Subjects) |
|
| 260 |
- |
|
| 261 |
- return nil |
|
| 262 |
-} |
|
| 263 |
- |
|
| 264 |
-func Convert_v1beta3_ClusterPolicyBinding_To_api_ClusterPolicyBinding(in *ClusterPolicyBinding, out *newer.ClusterPolicyBinding, s conversion.Scope) error {
|
|
| 265 |
- out.LastModified = in.LastModified |
|
| 266 |
- out.RoleBindings = make(map[string]*newer.ClusterRoleBinding) |
|
| 267 |
- return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) |
|
| 268 |
-} |
|
| 269 |
- |
|
| 270 |
-func Convert_api_ClusterPolicyBinding_To_v1beta3_ClusterPolicyBinding(in *newer.ClusterPolicyBinding, out *ClusterPolicyBinding, s conversion.Scope) error {
|
|
| 271 |
- out.LastModified = in.LastModified |
|
| 272 |
- out.RoleBindings = make([]NamedClusterRoleBinding, 0, 0) |
|
| 273 |
- return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) |
|
| 274 |
-} |
|
| 275 |
- |
|
| 276 |
-func addConversionFuncs(scheme *runtime.Scheme) {
|
|
| 277 |
- err := scheme.AddConversionFuncs( |
|
| 278 |
- Convert_v1beta3_SubjectAccessReview_To_api_SubjectAccessReview, |
|
| 279 |
- Convert_api_SubjectAccessReview_To_v1beta3_SubjectAccessReview, |
|
| 280 |
- Convert_v1beta3_LocalSubjectAccessReview_To_api_LocalSubjectAccessReview, |
|
| 281 |
- Convert_api_LocalSubjectAccessReview_To_v1beta3_LocalSubjectAccessReview, |
|
| 282 |
- Convert_v1beta3_ResourceAccessReview_To_api_ResourceAccessReview, |
|
| 283 |
- Convert_api_ResourceAccessReview_To_v1beta3_ResourceAccessReview, |
|
| 284 |
- Convert_v1beta3_LocalResourceAccessReview_To_api_LocalResourceAccessReview, |
|
| 285 |
- Convert_api_LocalResourceAccessReview_To_v1beta3_LocalResourceAccessReview, |
|
| 286 |
- Convert_v1beta3_ResourceAccessReviewResponse_To_api_ResourceAccessReviewResponse, |
|
| 287 |
- Convert_api_ResourceAccessReviewResponse_To_v1beta3_ResourceAccessReviewResponse, |
|
| 288 |
- Convert_v1beta3_PolicyRule_To_api_PolicyRule, |
|
| 289 |
- Convert_api_PolicyRule_To_v1beta3_PolicyRule, |
|
| 290 |
- Convert_v1beta3_Policy_To_api_Policy, |
|
| 291 |
- Convert_api_Policy_To_v1beta3_Policy, |
|
| 292 |
- Convert_v1beta3_RoleBinding_To_api_RoleBinding, |
|
| 293 |
- Convert_api_RoleBinding_To_v1beta3_RoleBinding, |
|
| 294 |
- Convert_v1beta3_PolicyBinding_To_api_PolicyBinding, |
|
| 295 |
- Convert_api_PolicyBinding_To_v1beta3_PolicyBinding, |
|
| 296 |
- Convert_api_ClusterPolicy_To_v1beta3_ClusterPolicy, |
|
| 297 |
- Convert_v1beta3_ClusterRoleBinding_To_api_ClusterRoleBinding, |
|
| 298 |
- Convert_api_ClusterRoleBinding_To_v1beta3_ClusterRoleBinding, |
|
| 299 |
- Convert_v1beta3_ClusterPolicyBinding_To_api_ClusterPolicyBinding, |
|
| 300 |
- Convert_api_ClusterPolicyBinding_To_v1beta3_ClusterPolicyBinding, |
|
| 301 |
- |
|
| 302 |
- func(in *[]NamedRoleBinding, out *map[string]*newer.RoleBinding, s conversion.Scope) error {
|
|
| 303 |
- for _, curr := range *in {
|
|
| 304 |
- newRoleBinding := &newer.RoleBinding{}
|
|
| 305 |
- if err := s.Convert(&curr.RoleBinding, newRoleBinding, 0); err != nil {
|
|
| 306 |
- return err |
|
| 307 |
- } |
|
| 308 |
- (*out)[curr.Name] = newRoleBinding |
|
| 309 |
- } |
|
| 310 |
- |
|
| 311 |
- return nil |
|
| 312 |
- }, |
|
| 313 |
- |
|
| 314 |
- func(in *map[string]*newer.RoleBinding, out *[]NamedRoleBinding, s conversion.Scope) error {
|
|
| 315 |
- allKeys := make([]string, 0, len(*in)) |
|
| 316 |
- for key := range *in {
|
|
| 317 |
- allKeys = append(allKeys, key) |
|
| 318 |
- } |
|
| 319 |
- sort.Strings(allKeys) |
|
| 320 |
- |
|
| 321 |
- for _, key := range allKeys {
|
|
| 322 |
- newRoleBinding := (*in)[key] |
|
| 323 |
- oldRoleBinding := &RoleBinding{}
|
|
| 324 |
- if err := s.Convert(newRoleBinding, oldRoleBinding, 0); err != nil {
|
|
| 325 |
- return err |
|
| 326 |
- } |
|
| 327 |
- |
|
| 328 |
- namedRoleBinding := NamedRoleBinding{key, *oldRoleBinding}
|
|
| 329 |
- *out = append(*out, namedRoleBinding) |
|
| 330 |
- } |
|
| 331 |
- |
|
| 332 |
- return nil |
|
| 333 |
- }, |
|
| 334 |
- |
|
| 335 |
- func(in *[]NamedClusterRole, out *map[string]*newer.ClusterRole, s conversion.Scope) error {
|
|
| 336 |
- for _, curr := range *in {
|
|
| 337 |
- newRole := &newer.ClusterRole{}
|
|
| 338 |
- if err := s.Convert(&curr.Role, newRole, 0); err != nil {
|
|
| 339 |
- return err |
|
| 340 |
- } |
|
| 341 |
- if *out == nil {
|
|
| 342 |
- m := make(map[string]*newer.ClusterRole) |
|
| 343 |
- *out = m |
|
| 344 |
- } |
|
| 345 |
- (*out)[curr.Name] = newRole |
|
| 346 |
- } |
|
| 347 |
- |
|
| 348 |
- return nil |
|
| 349 |
- }, |
|
| 350 |
- |
|
| 351 |
- func(in *map[string]*newer.ClusterRole, out *[]NamedClusterRole, s conversion.Scope) error {
|
|
| 352 |
- allKeys := make([]string, 0, len(*in)) |
|
| 353 |
- for key := range *in {
|
|
| 354 |
- allKeys = append(allKeys, key) |
|
| 355 |
- } |
|
| 356 |
- sort.Strings(allKeys) |
|
| 357 |
- |
|
| 358 |
- for _, key := range allKeys {
|
|
| 359 |
- newRole := (*in)[key] |
|
| 360 |
- oldRole := &ClusterRole{}
|
|
| 361 |
- if err := s.Convert(newRole, oldRole, 0); err != nil {
|
|
| 362 |
- return err |
|
| 363 |
- } |
|
| 364 |
- |
|
| 365 |
- namedRole := NamedClusterRole{key, *oldRole}
|
|
| 366 |
- *out = append(*out, namedRole) |
|
| 367 |
- } |
|
| 368 |
- |
|
| 369 |
- return nil |
|
| 370 |
- }, |
|
| 371 |
- |
|
| 372 |
- func(in *[]NamedRole, out *map[string]*newer.Role, s conversion.Scope) error {
|
|
| 373 |
- for _, curr := range *in {
|
|
| 374 |
- newRole := &newer.Role{}
|
|
| 375 |
- if err := s.Convert(&curr.Role, newRole, 0); err != nil {
|
|
| 376 |
- return err |
|
| 377 |
- } |
|
| 378 |
- (*out)[curr.Name] = newRole |
|
| 379 |
- } |
|
| 380 |
- |
|
| 381 |
- return nil |
|
| 382 |
- }, |
|
| 383 |
- |
|
| 384 |
- func(in *map[string]*newer.Role, out *[]NamedRole, s conversion.Scope) error {
|
|
| 385 |
- allKeys := make([]string, 0, len(*in)) |
|
| 386 |
- for key := range *in {
|
|
| 387 |
- allKeys = append(allKeys, key) |
|
| 388 |
- } |
|
| 389 |
- sort.Strings(allKeys) |
|
| 390 |
- |
|
| 391 |
- for _, key := range allKeys {
|
|
| 392 |
- newRole := (*in)[key] |
|
| 393 |
- oldRole := &Role{}
|
|
| 394 |
- if err := s.Convert(newRole, oldRole, 0); err != nil {
|
|
| 395 |
- return err |
|
| 396 |
- } |
|
| 397 |
- |
|
| 398 |
- namedRole := NamedRole{key, *oldRole}
|
|
| 399 |
- *out = append(*out, namedRole) |
|
| 400 |
- } |
|
| 401 |
- |
|
| 402 |
- return nil |
|
| 403 |
- }, |
|
| 404 |
- |
|
| 405 |
- func(in *[]NamedClusterRoleBinding, out *map[string]*newer.ClusterRoleBinding, s conversion.Scope) error {
|
|
| 406 |
- for _, curr := range *in {
|
|
| 407 |
- newRoleBinding := &newer.ClusterRoleBinding{}
|
|
| 408 |
- if err := s.Convert(&curr.RoleBinding, newRoleBinding, 0); err != nil {
|
|
| 409 |
- return err |
|
| 410 |
- } |
|
| 411 |
- (*out)[curr.Name] = newRoleBinding |
|
| 412 |
- } |
|
| 413 |
- |
|
| 414 |
- return nil |
|
| 415 |
- }, |
|
| 416 |
- func(in *map[string]*newer.ClusterRoleBinding, out *[]NamedClusterRoleBinding, s conversion.Scope) error {
|
|
| 417 |
- allKeys := make([]string, 0, len(*in)) |
|
| 418 |
- for key := range *in {
|
|
| 419 |
- allKeys = append(allKeys, key) |
|
| 420 |
- } |
|
| 421 |
- sort.Strings(allKeys) |
|
| 422 |
- |
|
| 423 |
- for _, key := range allKeys {
|
|
| 424 |
- newRoleBinding := (*in)[key] |
|
| 425 |
- oldRoleBinding := &ClusterRoleBinding{}
|
|
| 426 |
- if err := s.Convert(newRoleBinding, oldRoleBinding, 0); err != nil {
|
|
| 427 |
- return err |
|
| 428 |
- } |
|
| 429 |
- |
|
| 430 |
- namedRoleBinding := NamedClusterRoleBinding{key, *oldRoleBinding}
|
|
| 431 |
- *out = append(*out, namedRoleBinding) |
|
| 432 |
- } |
|
| 433 |
- |
|
| 434 |
- return nil |
|
| 435 |
- }, |
|
| 436 |
- ) |
|
| 437 |
- if err != nil {
|
|
| 438 |
- // If one of the conversion functions is malformed, detect it immediately. |
|
| 439 |
- panic(err) |
|
| 440 |
- } |
|
| 441 |
-} |
| 442 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,29 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- kapi "k8s.io/kubernetes/pkg/api" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
- |
|
| 7 |
- internal "github.com/openshift/origin/pkg/authorization/api" |
|
| 8 |
-) |
|
| 9 |
- |
|
| 10 |
-var oldAllowAllPolicyRule = PolicyRule{APIGroups: nil, Verbs: []string{internal.VerbAll}, Resources: []string{internal.ResourceAll}}
|
|
| 11 |
- |
|
| 12 |
-func addDefaultingFuncs(scheme *runtime.Scheme) {
|
|
| 13 |
- err := scheme.AddDefaultingFuncs( |
|
| 14 |
- func(obj *PolicyRule) {
|
|
| 15 |
- if obj == nil {
|
|
| 16 |
- return |
|
| 17 |
- } |
|
| 18 |
- |
|
| 19 |
- // this seems really strange, but semantic equality checks most of what we want, but nil == {}
|
|
| 20 |
- // this is ok for the restof the fields, but not APIGroups |
|
| 21 |
- if kapi.Semantic.Equalities.DeepEqual(oldAllowAllPolicyRule, *obj) && obj.APIGroups == nil {
|
|
| 22 |
- obj.APIGroups = []string{internal.APIGroupAll}
|
|
| 23 |
- } |
|
| 24 |
- }, |
|
| 25 |
- ) |
|
| 26 |
- if err != nil {
|
|
| 27 |
- panic(err) |
|
| 28 |
- } |
|
| 29 |
-} |
| 30 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,76 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-const GroupName = "" |
|
| 9 |
- |
|
| 10 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 11 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 12 |
- |
|
| 13 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 14 |
- addKnownTypes(scheme) |
|
| 15 |
- addConversionFuncs(scheme) |
|
| 16 |
- addDefaultingFuncs(scheme) |
|
| 17 |
-} |
|
| 18 |
- |
|
| 19 |
-// Adds the list of known types to api.Scheme. |
|
| 20 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 21 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 22 |
- &Role{},
|
|
| 23 |
- &RoleBinding{},
|
|
| 24 |
- &Policy{},
|
|
| 25 |
- &PolicyBinding{},
|
|
| 26 |
- &PolicyList{},
|
|
| 27 |
- &PolicyBindingList{},
|
|
| 28 |
- &RoleBindingList{},
|
|
| 29 |
- &RoleList{},
|
|
| 30 |
- |
|
| 31 |
- &SelfSubjectRulesReview{},
|
|
| 32 |
- &ResourceAccessReview{},
|
|
| 33 |
- &SubjectAccessReview{},
|
|
| 34 |
- &LocalResourceAccessReview{},
|
|
| 35 |
- &LocalSubjectAccessReview{},
|
|
| 36 |
- &ResourceAccessReviewResponse{},
|
|
| 37 |
- &SubjectAccessReviewResponse{},
|
|
| 38 |
- &IsPersonalSubjectAccessReview{},
|
|
| 39 |
- |
|
| 40 |
- &ClusterRole{},
|
|
| 41 |
- &ClusterRoleBinding{},
|
|
| 42 |
- &ClusterPolicy{},
|
|
| 43 |
- &ClusterPolicyBinding{},
|
|
| 44 |
- &ClusterPolicyList{},
|
|
| 45 |
- &ClusterPolicyBindingList{},
|
|
| 46 |
- &ClusterRoleBindingList{},
|
|
| 47 |
- &ClusterRoleList{},
|
|
| 48 |
- ) |
|
| 49 |
-} |
|
| 50 |
- |
|
| 51 |
-func (obj *ClusterRoleList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 52 |
-func (obj *ClusterRoleBindingList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 53 |
-func (obj *ClusterPolicyBindingList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 54 |
-func (obj *ClusterPolicyList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 55 |
-func (obj *ClusterPolicyBinding) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 56 |
-func (obj *ClusterPolicy) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 57 |
-func (obj *ClusterRoleBinding) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 58 |
-func (obj *ClusterRole) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 59 |
- |
|
| 60 |
-func (obj *IsPersonalSubjectAccessReview) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 61 |
-func (obj *SubjectAccessReviewResponse) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 62 |
-func (obj *ResourceAccessReviewResponse) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 63 |
-func (obj *LocalSubjectAccessReview) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 64 |
-func (obj *LocalResourceAccessReview) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 65 |
-func (obj *SubjectAccessReview) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 66 |
-func (obj *ResourceAccessReview) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 67 |
-func (obj *SelfSubjectRulesReview) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 68 |
- |
|
| 69 |
-func (obj *RoleList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 70 |
-func (obj *RoleBindingList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 71 |
-func (obj *PolicyBindingList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 72 |
-func (obj *PolicyList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 73 |
-func (obj *PolicyBinding) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 74 |
-func (obj *Policy) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 75 |
-func (obj *RoleBinding) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 76 |
-func (obj *Role) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 77 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,352 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 6 |
- kruntime "k8s.io/kubernetes/pkg/runtime" |
|
| 7 |
-) |
|
| 8 |
- |
|
| 9 |
-// Authorization is calculated against |
|
| 10 |
-// 1. all deny RoleBinding PolicyRules in the master namespace - short circuit on match |
|
| 11 |
-// 2. all allow RoleBinding PolicyRules in the master namespace - short circuit on match |
|
| 12 |
-// 3. all deny RoleBinding PolicyRules in the namespace - short circuit on match |
|
| 13 |
-// 4. all allow RoleBinding PolicyRules in the namespace - short circuit on match |
|
| 14 |
-// 5. deny by default |
|
| 15 |
- |
|
| 16 |
-// PolicyRule holds information that describes a policy rule, but does not contain information |
|
| 17 |
-// about who the rule applies to or which namespace the rule applies to. |
|
| 18 |
-type PolicyRule struct {
|
|
| 19 |
- // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. |
|
| 20 |
- Verbs []string `json:"verbs"` |
|
| 21 |
- // AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder pair supports. |
|
| 22 |
- // If the Authorizer does not recognize how to handle the AttributeRestrictions, the Authorizer should report an error. |
|
| 23 |
- AttributeRestrictions kruntime.RawExtension `json:"attributeRestrictions,omitempty"` |
|
| 24 |
- // APIGroups is the name of the APIGroup that contains the resources. If this field is empty, then both kubernetes and origin API groups are assumed. |
|
| 25 |
- // That means that if an action is requested against one of the enumerated resources in either the kubernetes or the origin API group, the request |
|
| 26 |
- // will be allowed |
|
| 27 |
- APIGroups []string `json:"apiGroups"` |
|
| 28 |
- // ResourceKinds is a list of resources this rule applies to. ResourceAll represents all resources. |
|
| 29 |
- // DEPRECATED |
|
| 30 |
- ResourceKinds []string `json:"resourceKinds,omitempty"` |
|
| 31 |
- // Resources is a list of resources this rule applies to. ResourceAll represents all resources. |
|
| 32 |
- Resources []string `json:"resources"` |
|
| 33 |
- // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. |
|
| 34 |
- ResourceNames []string `json:"resourceNames,omitempty"` |
|
| 35 |
- // NonResourceURLsSlice is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path |
|
| 36 |
- // This name is intentionally different than the internal type so that the DefaultConvert works nicely and because the ordering may be different. |
|
| 37 |
- NonResourceURLsSlice []string `json:"nonResourceURLs,omitempty"` |
|
| 38 |
-} |
|
| 39 |
- |
|
| 40 |
-// IsPersonalSubjectAccessReview is a marker for PolicyRule.AttributeRestrictions that denotes that subjectaccessreviews on self should be allowed |
|
| 41 |
-type IsPersonalSubjectAccessReview struct {
|
|
| 42 |
- unversioned.TypeMeta `json:",inline"` |
|
| 43 |
-} |
|
| 44 |
- |
|
| 45 |
-// Role is a logical grouping of PolicyRules that can be referenced as a unit by RoleBindings. |
|
| 46 |
-type Role struct {
|
|
| 47 |
- unversioned.TypeMeta `json:",inline"` |
|
| 48 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 49 |
- |
|
| 50 |
- // Rules holds all the PolicyRules for this Role |
|
| 51 |
- Rules []PolicyRule `json:"rules"` |
|
| 52 |
-} |
|
| 53 |
- |
|
| 54 |
-// RoleBinding references a Role, but not contain it. It can reference any Role in the same namespace or in the global namespace. |
|
| 55 |
-// It adds who information via Users and Groups and namespace information by which namespace it exists in. RoleBindings in a given |
|
| 56 |
-// namespace only have effect in that namespace (excepting the master namespace which has power in all namespaces). |
|
| 57 |
-type RoleBinding struct {
|
|
| 58 |
- unversioned.TypeMeta `json:",inline"` |
|
| 59 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 60 |
- |
|
| 61 |
- // UserNames holds all the usernames directly bound to the role |
|
| 62 |
- UserNames []string `json:"userNames"` |
|
| 63 |
- // GroupNames holds all the groups directly bound to the role |
|
| 64 |
- GroupNames []string `json:"groupNames"` |
|
| 65 |
- // Subjects hold object references to authorize with this rule |
|
| 66 |
- Subjects []kapi.ObjectReference `json:"subjects"` |
|
| 67 |
- |
|
| 68 |
- // Since Policy is a singleton, this is sufficient knowledge to locate a role |
|
| 69 |
- // RoleRefs can only reference the current namespace and the global namespace |
|
| 70 |
- // If the RoleRef cannot be resolved, the Authorizer must return an error. |
|
| 71 |
- RoleRef kapi.ObjectReference `json:"roleRef"` |
|
| 72 |
-} |
|
| 73 |
- |
|
| 74 |
-// Policy is a object that holds all the Roles for a particular namespace. There is at most |
|
| 75 |
-// one Policy document per namespace. |
|
| 76 |
-type Policy struct {
|
|
| 77 |
- unversioned.TypeMeta `json:",inline"` |
|
| 78 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 79 |
- |
|
| 80 |
- // LastModified is the last time that any part of the Policy was created, updated, or deleted |
|
| 81 |
- LastModified unversioned.Time `json:"lastModified"` |
|
| 82 |
- |
|
| 83 |
- // Roles holds all the Roles held by this Policy, mapped by Role.Name |
|
| 84 |
- Roles []NamedRole `json:"roles"` |
|
| 85 |
-} |
|
| 86 |
- |
|
| 87 |
-// PolicyBinding is a object that holds all the RoleBindings for a particular namespace. There is |
|
| 88 |
-// one PolicyBinding document per referenced Policy namespace |
|
| 89 |
-type PolicyBinding struct {
|
|
| 90 |
- unversioned.TypeMeta `json:",inline"` |
|
| 91 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 92 |
- |
|
| 93 |
- // LastModified is the last time that any part of the PolicyBinding was created, updated, or deleted |
|
| 94 |
- LastModified unversioned.Time `json:"lastModified"` |
|
| 95 |
- |
|
| 96 |
- // PolicyRef is a reference to the Policy that contains all the Roles that this PolicyBinding's RoleBindings may reference |
|
| 97 |
- PolicyRef kapi.ObjectReference `json:"policyRef"` |
|
| 98 |
- // RoleBindings holds all the RoleBindings held by this PolicyBinding, mapped by RoleBinding.Name |
|
| 99 |
- RoleBindings []NamedRoleBinding `json:"roleBindings"` |
|
| 100 |
-} |
|
| 101 |
- |
|
| 102 |
-type NamedRole struct {
|
|
| 103 |
- Name string `json:"name"` |
|
| 104 |
- Role Role `json:"role"` |
|
| 105 |
-} |
|
| 106 |
- |
|
| 107 |
-type NamedRoleBinding struct {
|
|
| 108 |
- Name string `json:"name"` |
|
| 109 |
- RoleBinding RoleBinding `json:"roleBinding"` |
|
| 110 |
-} |
|
| 111 |
- |
|
| 112 |
-// SelfSubjectRulesReview is a resource you can create to determine which actions you can perform in a namespace |
|
| 113 |
-type SelfSubjectRulesReview struct {
|
|
| 114 |
- unversioned.TypeMeta `json:",inline"` |
|
| 115 |
- |
|
| 116 |
- // Spec adds information about how to conduct the check |
|
| 117 |
- Spec SelfSubjectRulesReviewSpec `json:"spec"` |
|
| 118 |
- |
|
| 119 |
- // Status is completed by the server to tell which permissions you have |
|
| 120 |
- Status SubjectRulesReviewStatus `json:"status,omitempty"` |
|
| 121 |
-} |
|
| 122 |
- |
|
| 123 |
-// SelfSubjectRulesReviewSpec adds information about how to conduct the check |
|
| 124 |
-type SelfSubjectRulesReviewSpec struct {
|
|
| 125 |
- // Scopes to use for the evaluation. Empty means "use the unscoped (full) permissions of the user/groups". |
|
| 126 |
- // Nil means "use the scopes on this request". |
|
| 127 |
- Scopes []string `json:"scopes"` |
|
| 128 |
-} |
|
| 129 |
- |
|
| 130 |
-// SubjectRulesReviewStatus is contains the result of a rules check |
|
| 131 |
-type SubjectRulesReviewStatus struct {
|
|
| 132 |
- // Rules is the list of rules (no particular sort) that are allowed for the subject |
|
| 133 |
- Rules []PolicyRule `json:"rules"` |
|
| 134 |
- // EvaluationError can appear in combination with Rules. It means some error happened during evaluation |
|
| 135 |
- // that may have prevented additional rules from being populated. |
|
| 136 |
- EvaluationError string `json:"evaluationError,omitempty"` |
|
| 137 |
-} |
|
| 138 |
- |
|
| 139 |
-// ResourceAccessReviewResponse describes who can perform the action |
|
| 140 |
-type ResourceAccessReviewResponse struct {
|
|
| 141 |
- unversioned.TypeMeta `json:",inline"` |
|
| 142 |
- |
|
| 143 |
- // Namespace is the namespace used for the access review |
|
| 144 |
- Namespace string `json:"namespace,omitempty"` |
|
| 145 |
- // Users is the list of users who can perform the action |
|
| 146 |
- UsersSlice []string `json:"users"` |
|
| 147 |
- // Groups is the list of groups who can perform the action |
|
| 148 |
- GroupsSlice []string `json:"groups"` |
|
| 149 |
-} |
|
| 150 |
- |
|
| 151 |
-// ResourceAccessReview is a means to request a list of which users and groups are authorized to perform the |
|
| 152 |
-// action specified by spec |
|
| 153 |
-type ResourceAccessReview struct {
|
|
| 154 |
- unversioned.TypeMeta `json:",inline"` |
|
| 155 |
- |
|
| 156 |
- // AuthorizationAttributes describes the action being tested |
|
| 157 |
- AuthorizationAttributes `json:",inline"` |
|
| 158 |
-} |
|
| 159 |
- |
|
| 160 |
-// SubjectAccessReviewResponse describes whether or not a user or group can perform an action |
|
| 161 |
-type SubjectAccessReviewResponse struct {
|
|
| 162 |
- unversioned.TypeMeta `json:",inline"` |
|
| 163 |
- |
|
| 164 |
- // Namespace is the namespace used for the access review |
|
| 165 |
- Namespace string `json:"namespace,omitempty"` |
|
| 166 |
- // Allowed is required. True if the action would be allowed, false otherwise. |
|
| 167 |
- Allowed bool `json:"allowed"` |
|
| 168 |
- // Reason is optional. It indicates why a request was allowed or denied. |
|
| 169 |
- Reason string `json:"reason,omitempty"` |
|
| 170 |
-} |
|
| 171 |
- |
|
| 172 |
-// SubjectAccessReview is an object for requesting information about whether a user or group can perform an action |
|
| 173 |
-type SubjectAccessReview struct {
|
|
| 174 |
- unversioned.TypeMeta `json:",inline"` |
|
| 175 |
- |
|
| 176 |
- // AuthorizationAttributes describes the action being tested |
|
| 177 |
- AuthorizationAttributes `json:",inline"` |
|
| 178 |
- // User is optional. If both User and Groups are empty, the current authenticated user is used. |
|
| 179 |
- User string `json:"user"` |
|
| 180 |
- // Groups is optional. Groups is the list of groups to which the User belongs. |
|
| 181 |
- GroupsSlice []string `json:"groups"` |
|
| 182 |
- // Scopes to use for the evaluation. Empty means "use the unscoped (full) permissions of the user/groups". |
|
| 183 |
- // Nil for a self-SAR, means "use the scopes on this request". |
|
| 184 |
- // Nil for a regular SAR, means the same as empty. |
|
| 185 |
- Scopes []string `json:"scopes"` |
|
| 186 |
-} |
|
| 187 |
- |
|
| 188 |
-// LocalResourceAccessReview is a means to request a list of which users and groups are authorized to perform the action specified by spec in a particular namespace |
|
| 189 |
-type LocalResourceAccessReview struct {
|
|
| 190 |
- unversioned.TypeMeta `json:",inline"` |
|
| 191 |
- |
|
| 192 |
- // AuthorizationAttributes describes the action being tested. The Namespace element is FORCED to the current namespace. |
|
| 193 |
- AuthorizationAttributes `json:",inline"` |
|
| 194 |
-} |
|
| 195 |
- |
|
| 196 |
-// LocalSubjectAccessReview is an object for requesting information about whether a user or group can perform an action in a particular namespace |
|
| 197 |
-type LocalSubjectAccessReview struct {
|
|
| 198 |
- unversioned.TypeMeta `json:",inline"` |
|
| 199 |
- |
|
| 200 |
- // AuthorizationAttributes describes the action being tested. The Namespace element is FORCED to the current namespace. |
|
| 201 |
- AuthorizationAttributes `json:",inline"` |
|
| 202 |
- // User is optional. If both User and Groups are empty, the current authenticated user is used. |
|
| 203 |
- User string `json:"user"` |
|
| 204 |
- // Groups is optional. Groups is the list of groups to which the User belongs. |
|
| 205 |
- GroupsSlice []string `json:"groups"` |
|
| 206 |
- // Scopes to use for the evaluation. Empty means "use the unscoped (full) permissions of the user/groups". |
|
| 207 |
- // Nil for a self-SAR, means "use the scopes on this request". |
|
| 208 |
- // Nil for a regular SAR, means the same as empty. |
|
| 209 |
- Scopes []string `json:"scopes"` |
|
| 210 |
-} |
|
| 211 |
- |
|
| 212 |
-type AuthorizationAttributes struct {
|
|
| 213 |
- // Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces |
|
| 214 |
- Namespace string `json:"namespace"` |
|
| 215 |
- // Verb is one of: get, list, watch, create, update, delete |
|
| 216 |
- Verb string `json:"verb"` |
|
| 217 |
- // Group is the API group of the resource |
|
| 218 |
- // Serialized as resourceAPIGroup to avoid confusion with the 'groups' field when inlined |
|
| 219 |
- Group string `json:"resourceAPIGroup"` |
|
| 220 |
- // Version is the API version of the resource |
|
| 221 |
- // Serialized as resourceAPIVersion to avoid confusion with TypeMeta.apiVersion and ObjectMeta.resourceVersion when inlined |
|
| 222 |
- Version string `json:"resourceAPIVersion"` |
|
| 223 |
- // Resource is one of the existing resource types |
|
| 224 |
- Resource string `json:"resource"` |
|
| 225 |
- // ResourceName is the name of the resource being requested for a "get" or deleted for a "delete" |
|
| 226 |
- ResourceName string `json:"resourceName"` |
|
| 227 |
- // Content is the actual content of the request for create and update |
|
| 228 |
- Content kruntime.RawExtension `json:"content,omitempty"` |
|
| 229 |
-} |
|
| 230 |
- |
|
| 231 |
-// PolicyList is a collection of Policies |
|
| 232 |
-type PolicyList struct {
|
|
| 233 |
- unversioned.TypeMeta `json:",inline"` |
|
| 234 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 235 |
- Items []Policy `json:"items"` |
|
| 236 |
-} |
|
| 237 |
- |
|
| 238 |
-// PolicyBindingList is a collection of PolicyBindings |
|
| 239 |
-type PolicyBindingList struct {
|
|
| 240 |
- unversioned.TypeMeta `json:",inline"` |
|
| 241 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 242 |
- Items []PolicyBinding `json:"items"` |
|
| 243 |
-} |
|
| 244 |
- |
|
| 245 |
-// RoleBindingList is a collection of RoleBindings |
|
| 246 |
-type RoleBindingList struct {
|
|
| 247 |
- unversioned.TypeMeta `json:",inline"` |
|
| 248 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 249 |
- Items []RoleBinding `json:"items"` |
|
| 250 |
-} |
|
| 251 |
- |
|
| 252 |
-// RoleList is a collection of Roles |
|
| 253 |
-type RoleList struct {
|
|
| 254 |
- unversioned.TypeMeta `json:",inline"` |
|
| 255 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 256 |
- Items []Role `json:"items"` |
|
| 257 |
-} |
|
| 258 |
- |
|
| 259 |
-// ClusterRole is a logical grouping of PolicyRules that can be referenced as a unit by ClusterRoleBindings. |
|
| 260 |
-type ClusterRole struct {
|
|
| 261 |
- unversioned.TypeMeta `json:",inline"` |
|
| 262 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 263 |
- |
|
| 264 |
- // Rules holds all the PolicyRules for this ClusterRole |
|
| 265 |
- Rules []PolicyRule `json:"rules"` |
|
| 266 |
-} |
|
| 267 |
- |
|
| 268 |
-// ClusterRoleBinding references a ClusterRole, but not contain it. It can reference any ClusterRole in the same namespace or in the global namespace. |
|
| 269 |
-// It adds who information via Users and Groups and namespace information by which namespace it exists in. ClusterRoleBindings in a given |
|
| 270 |
-// namespace only have effect in that namespace (excepting the master namespace which has power in all namespaces). |
|
| 271 |
-type ClusterRoleBinding struct {
|
|
| 272 |
- unversioned.TypeMeta `json:",inline"` |
|
| 273 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 274 |
- |
|
| 275 |
- // UserNames holds all the usernames directly bound to the role |
|
| 276 |
- UserNames []string `json:"userNames"` |
|
| 277 |
- // GroupNames holds all the groups directly bound to the role |
|
| 278 |
- GroupNames []string `json:"groupNames"` |
|
| 279 |
- // Subjects hold object references to authorize with this rule |
|
| 280 |
- Subjects []kapi.ObjectReference `json:"subjects"` |
|
| 281 |
- |
|
| 282 |
- // Since Policy is a singleton, this is sufficient knowledge to locate a role |
|
| 283 |
- // ClusterRoleRefs can only reference the current namespace and the global namespace |
|
| 284 |
- // If the ClusterRoleRef cannot be resolved, the Authorizer must return an error. |
|
| 285 |
- RoleRef kapi.ObjectReference `json:"roleRef"` |
|
| 286 |
-} |
|
| 287 |
- |
|
| 288 |
-// ClusterPolicy is a object that holds all the ClusterRoles for a particular namespace. There is at most |
|
| 289 |
-// one ClusterPolicy document per namespace. |
|
| 290 |
-type ClusterPolicy struct {
|
|
| 291 |
- unversioned.TypeMeta `json:",inline"` |
|
| 292 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 293 |
- |
|
| 294 |
- // LastModified is the last time that any part of the ClusterPolicy was created, updated, or deleted |
|
| 295 |
- LastModified unversioned.Time `json:"lastModified"` |
|
| 296 |
- |
|
| 297 |
- // ClusterRoles holds all the ClusterRoles held by this ClusterPolicy, mapped by ClusterRole.Name |
|
| 298 |
- Roles []NamedClusterRole `json:"roles"` |
|
| 299 |
-} |
|
| 300 |
- |
|
| 301 |
-// ClusterPolicyBinding is a object that holds all the ClusterRoleBindings for a particular namespace. There is |
|
| 302 |
-// one ClusterPolicyBinding document per referenced ClusterPolicy namespace |
|
| 303 |
-type ClusterPolicyBinding struct {
|
|
| 304 |
- unversioned.TypeMeta `json:",inline"` |
|
| 305 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 306 |
- |
|
| 307 |
- // LastModified is the last time that any part of the ClusterPolicyBinding was created, updated, or deleted |
|
| 308 |
- LastModified unversioned.Time `json:"lastModified"` |
|
| 309 |
- |
|
| 310 |
- // PolicyRef is a reference to the ClusterPolicy that contains all the ClusterRoles that this ClusterPolicyBinding's RoleBindings may reference |
|
| 311 |
- PolicyRef kapi.ObjectReference `json:"policyRef"` |
|
| 312 |
- // RoleBindings holds all the ClusterRoleBindings held by this ClusterPolicyBinding, mapped by ClusterRoleBinding.Name |
|
| 313 |
- RoleBindings []NamedClusterRoleBinding `json:"roleBindings"` |
|
| 314 |
-} |
|
| 315 |
- |
|
| 316 |
-type NamedClusterRole struct {
|
|
| 317 |
- Name string `json:"name"` |
|
| 318 |
- Role ClusterRole `json:"role"` |
|
| 319 |
-} |
|
| 320 |
- |
|
| 321 |
-type NamedClusterRoleBinding struct {
|
|
| 322 |
- Name string `json:"name"` |
|
| 323 |
- RoleBinding ClusterRoleBinding `json:"roleBinding"` |
|
| 324 |
-} |
|
| 325 |
- |
|
| 326 |
-// ClusterPolicyList is a collection of ClusterPolicies |
|
| 327 |
-type ClusterPolicyList struct {
|
|
| 328 |
- unversioned.TypeMeta `json:",inline"` |
|
| 329 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 330 |
- Items []ClusterPolicy `json:"items"` |
|
| 331 |
-} |
|
| 332 |
- |
|
| 333 |
-// ClusterPolicyBindingList is a collection of ClusterPolicyBindings |
|
| 334 |
-type ClusterPolicyBindingList struct {
|
|
| 335 |
- unversioned.TypeMeta `json:",inline"` |
|
| 336 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 337 |
- Items []ClusterPolicyBinding `json:"items"` |
|
| 338 |
-} |
|
| 339 |
- |
|
| 340 |
-// ClusterRoleBindingList is a collection of ClusterRoleBindings |
|
| 341 |
-type ClusterRoleBindingList struct {
|
|
| 342 |
- unversioned.TypeMeta `json:",inline"` |
|
| 343 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 344 |
- Items []ClusterRoleBinding `json:"items"` |
|
| 345 |
-} |
|
| 346 |
- |
|
| 347 |
-// ClusterRoleList is a collection of ClusterRoles |
|
| 348 |
-type ClusterRoleList struct {
|
|
| 349 |
- unversioned.TypeMeta `json:",inline"` |
|
| 350 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 351 |
- Items []ClusterRole `json:"items"` |
|
| 352 |
-} |
| ... | ... |
@@ -45,7 +45,7 @@ func TestIsBuildPod(t *testing.T) {
|
| 45 | 45 |
|
| 46 | 46 |
func TestGetBuild(t *testing.T) {
|
| 47 | 47 |
build := u.Build().WithDockerStrategy() |
| 48 |
- for _, version := range []string{"v1", "v1beta3"} {
|
|
| 48 |
+ for _, version := range []string{"v1"} {
|
|
| 49 | 49 |
pod := u.Pod().WithBuild(t, build.AsBuild(), version) |
| 50 | 50 |
resultBuild, resultVersion, err := GetBuild(pod.ToAttributes()) |
| 51 | 51 |
if err != nil {
|
| ... | ... |
@@ -62,7 +62,7 @@ func TestGetBuild(t *testing.T) {
|
| 62 | 62 |
|
| 63 | 63 |
func TestSetBuild(t *testing.T) {
|
| 64 | 64 |
build := u.Build().WithSourceStrategy() |
| 65 |
- for _, version := range []string{"v1", "v1beta3"} {
|
|
| 65 |
+ for _, version := range []string{"v1"} {
|
|
| 66 | 66 |
pod := u.Pod().WithEnvVar("BUILD", "foo")
|
| 67 | 67 |
groupVersion, err := unversioned.ParseGroupVersion(version) |
| 68 | 68 |
if err != nil {
|
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/openshift/origin/pkg/build/api" |
| 17 | 17 |
"github.com/openshift/origin/pkg/build/api/v1" |
| 18 |
- "github.com/openshift/origin/pkg/build/api/v1beta3" |
|
| 19 | 18 |
) |
| 20 | 19 |
|
| 21 | 20 |
const importPrefix = "github.com/openshift/origin/pkg/build/api" |
| ... | ... |
@@ -23,7 +22,7 @@ const importPrefix = "github.com/openshift/origin/pkg/build/api" |
| 23 | 23 |
var accessor = meta.NewAccessor() |
| 24 | 24 |
|
| 25 | 25 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 26 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 26 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
|
| 27 | 27 |
|
| 28 | 28 |
func init() {
|
| 29 | 29 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -81,8 +80,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 81 | 81 |
switch v {
|
| 82 | 82 |
case v1.SchemeGroupVersion: |
| 83 | 83 |
v1.AddToScheme(kapi.Scheme) |
| 84 |
- case v1beta3.SchemeGroupVersion: |
|
| 85 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 86 | 84 |
|
| 87 | 85 |
default: |
| 88 | 86 |
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
| ... | ... |
@@ -105,12 +102,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 105 | 105 |
MetadataAccessor: accessor, |
| 106 | 106 |
}, nil |
| 107 | 107 |
|
| 108 |
- case v1beta3.SchemeGroupVersion: |
|
| 109 |
- return &meta.VersionInterfaces{
|
|
| 110 |
- ObjectConvertor: kapi.Scheme, |
|
| 111 |
- MetadataAccessor: accessor, |
|
| 112 |
- }, nil |
|
| 113 |
- |
|
| 114 | 108 |
default: |
| 115 | 109 |
g, _ := registered.Group(api.GroupName) |
| 116 | 110 |
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
| 117 | 111 |
deleted file mode 100644 |
| ... | ... |
@@ -1,313 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "fmt" |
|
| 5 |
- |
|
| 6 |
- "k8s.io/kubernetes/pkg/conversion" |
|
| 7 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 8 |
- |
|
| 9 |
- newer "github.com/openshift/origin/pkg/build/api" |
|
| 10 |
- buildutil "github.com/openshift/origin/pkg/build/util" |
|
| 11 |
- imageapi "github.com/openshift/origin/pkg/image/api" |
|
| 12 |
-) |
|
| 13 |
- |
|
| 14 |
-func Convert_v1beta3_BuildConfig_To_api_BuildConfig(in *BuildConfig, out *newer.BuildConfig, s conversion.Scope) error {
|
|
| 15 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 16 |
- return err |
|
| 17 |
- } |
|
| 18 |
- |
|
| 19 |
- newTriggers := []newer.BuildTriggerPolicy{}
|
|
| 20 |
- // strip off any default imagechange triggers where the buildconfig's |
|
| 21 |
- // "from" is not an ImageStreamTag, because those triggers |
|
| 22 |
- // will never be invoked. |
|
| 23 |
- imageRef := buildutil.GetInputReference(out.Spec.Strategy) |
|
| 24 |
- hasIST := imageRef != nil && imageRef.Kind == "ImageStreamTag" |
|
| 25 |
- for _, trigger := range out.Spec.Triggers {
|
|
| 26 |
- if trigger.Type != newer.ImageChangeBuildTriggerType {
|
|
| 27 |
- newTriggers = append(newTriggers, trigger) |
|
| 28 |
- continue |
|
| 29 |
- } |
|
| 30 |
- if (trigger.ImageChange == nil || trigger.ImageChange.From == nil) && !hasIST {
|
|
| 31 |
- continue |
|
| 32 |
- } |
|
| 33 |
- newTriggers = append(newTriggers, trigger) |
|
| 34 |
- } |
|
| 35 |
- out.Spec.Triggers = newTriggers |
|
| 36 |
- return nil |
|
| 37 |
-} |
|
| 38 |
- |
|
| 39 |
-// empty conversion needed because the conversion generator can't handle unidirectional custom conversions |
|
| 40 |
-func Convert_api_BuildConfig_To_v1beta3_BuildConfig(in *newer.BuildConfig, out *BuildConfig, s conversion.Scope) error {
|
|
| 41 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 42 |
- return err |
|
| 43 |
- } |
|
| 44 |
- return nil |
|
| 45 |
-} |
|
| 46 |
- |
|
| 47 |
-func Convert_v1beta3_SourceBuildStrategy_To_api_SourceBuildStrategy(in *SourceBuildStrategy, out *newer.SourceBuildStrategy, s conversion.Scope) error {
|
|
| 48 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 49 |
- return err |
|
| 50 |
- } |
|
| 51 |
- switch in.From.Kind {
|
|
| 52 |
- case "ImageStream": |
|
| 53 |
- out.From.Kind = "ImageStreamTag" |
|
| 54 |
- out.From.Name = imageapi.JoinImageStreamTag(in.From.Name, "") |
|
| 55 |
- } |
|
| 56 |
- return nil |
|
| 57 |
-} |
|
| 58 |
- |
|
| 59 |
-// empty conversion needed because the conversion generator can't handle unidirectional custom conversions |
|
| 60 |
-func Convert_api_SourceBuildStrategy_To_v1beta3_SourceBuildStrategy(in *newer.SourceBuildStrategy, out *SourceBuildStrategy, s conversion.Scope) error {
|
|
| 61 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 62 |
- return err |
|
| 63 |
- } |
|
| 64 |
- return nil |
|
| 65 |
-} |
|
| 66 |
- |
|
| 67 |
-func Convert_v1beta3_DockerBuildStrategy_To_api_DockerBuildStrategy(in *DockerBuildStrategy, out *newer.DockerBuildStrategy, s conversion.Scope) error {
|
|
| 68 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 69 |
- return err |
|
| 70 |
- } |
|
| 71 |
- if in.From != nil {
|
|
| 72 |
- switch in.From.Kind {
|
|
| 73 |
- case "ImageStream": |
|
| 74 |
- out.From.Kind = "ImageStreamTag" |
|
| 75 |
- out.From.Name = imageapi.JoinImageStreamTag(in.From.Name, "") |
|
| 76 |
- } |
|
| 77 |
- } |
|
| 78 |
- return nil |
|
| 79 |
-} |
|
| 80 |
- |
|
| 81 |
-// empty conversion needed because the conversion generator can't handle unidirectional custom conversions |
|
| 82 |
-func Convert_api_DockerBuildStrategy_To_v1beta3_DockerBuildStrategy(in *newer.DockerBuildStrategy, out *DockerBuildStrategy, s conversion.Scope) error {
|
|
| 83 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 84 |
- return err |
|
| 85 |
- } |
|
| 86 |
- return nil |
|
| 87 |
-} |
|
| 88 |
- |
|
| 89 |
-func Convert_v1beta3_CustomBuildStrategy_To_api_CustomBuildStrategy(in *CustomBuildStrategy, out *newer.CustomBuildStrategy, s conversion.Scope) error {
|
|
| 90 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 91 |
- return err |
|
| 92 |
- } |
|
| 93 |
- switch in.From.Kind {
|
|
| 94 |
- case "ImageStream": |
|
| 95 |
- out.From.Kind = "ImageStreamTag" |
|
| 96 |
- out.From.Name = imageapi.JoinImageStreamTag(in.From.Name, "") |
|
| 97 |
- } |
|
| 98 |
- return nil |
|
| 99 |
-} |
|
| 100 |
- |
|
| 101 |
-// empty conversion needed because the conversion generator can't handle unidirectional custom conversions |
|
| 102 |
-func Convert_api_CustomBuildStrategy_To_v1beta3_CustomBuildStrategy(in *newer.CustomBuildStrategy, out *CustomBuildStrategy, s conversion.Scope) error {
|
|
| 103 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 104 |
- return err |
|
| 105 |
- } |
|
| 106 |
- return nil |
|
| 107 |
-} |
|
| 108 |
- |
|
| 109 |
-func Convert_v1beta3_BuildOutput_To_api_BuildOutput(in *BuildOutput, out *newer.BuildOutput, s conversion.Scope) error {
|
|
| 110 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 111 |
- return err |
|
| 112 |
- } |
|
| 113 |
- if in.To != nil && (in.To.Kind == "ImageStream" || len(in.To.Kind) == 0) {
|
|
| 114 |
- out.To.Kind = "ImageStreamTag" |
|
| 115 |
- out.To.Name = imageapi.JoinImageStreamTag(in.To.Name, "") |
|
| 116 |
- } |
|
| 117 |
- return nil |
|
| 118 |
-} |
|
| 119 |
- |
|
| 120 |
-// empty conversion needed because the conversion generator can't handle unidirectional custom conversions |
|
| 121 |
-func Convert_api_BuildOutput_To_v1beta3_BuildOutput(in *newer.BuildOutput, out *BuildOutput, s conversion.Scope) error {
|
|
| 122 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 123 |
- return err |
|
| 124 |
- } |
|
| 125 |
- return nil |
|
| 126 |
-} |
|
| 127 |
- |
|
| 128 |
-func Convert_v1beta3_BuildTriggerPolicy_To_api_BuildTriggerPolicy(in *BuildTriggerPolicy, out *newer.BuildTriggerPolicy, s conversion.Scope) error {
|
|
| 129 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 130 |
- return err |
|
| 131 |
- } |
|
| 132 |
- switch in.Type {
|
|
| 133 |
- case ImageChangeBuildTriggerType: |
|
| 134 |
- out.Type = newer.ImageChangeBuildTriggerType |
|
| 135 |
- case GenericWebHookBuildTriggerType: |
|
| 136 |
- out.Type = newer.GenericWebHookBuildTriggerType |
|
| 137 |
- case GitHubWebHookBuildTriggerType: |
|
| 138 |
- out.Type = newer.GitHubWebHookBuildTriggerType |
|
| 139 |
- } |
|
| 140 |
- return nil |
|
| 141 |
-} |
|
| 142 |
- |
|
| 143 |
-func Convert_api_BuildTriggerPolicy_To_v1beta3_BuildTriggerPolicy(in *newer.BuildTriggerPolicy, out *BuildTriggerPolicy, s conversion.Scope) error {
|
|
| 144 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 145 |
- return err |
|
| 146 |
- } |
|
| 147 |
- switch in.Type {
|
|
| 148 |
- case newer.ImageChangeBuildTriggerType: |
|
| 149 |
- out.Type = ImageChangeBuildTriggerType |
|
| 150 |
- case newer.GenericWebHookBuildTriggerType: |
|
| 151 |
- out.Type = GenericWebHookBuildTriggerType |
|
| 152 |
- case newer.GitHubWebHookBuildTriggerType: |
|
| 153 |
- out.Type = GitHubWebHookBuildTriggerType |
|
| 154 |
- } |
|
| 155 |
- return nil |
|
| 156 |
-} |
|
| 157 |
- |
|
| 158 |
-func Convert_v1beta3_SourceRevision_To_api_SourceRevision(in *SourceRevision, out *newer.SourceRevision, s conversion.Scope) error {
|
|
| 159 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 160 |
- return err |
|
| 161 |
- } |
|
| 162 |
- return nil |
|
| 163 |
-} |
|
| 164 |
- |
|
| 165 |
-func Convert_api_SourceRevision_To_v1beta3_SourceRevision(in *newer.SourceRevision, out *SourceRevision, s conversion.Scope) error {
|
|
| 166 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 167 |
- return err |
|
| 168 |
- } |
|
| 169 |
- out.Type = BuildSourceGit |
|
| 170 |
- return nil |
|
| 171 |
-} |
|
| 172 |
- |
|
| 173 |
-func Convert_v1beta3_BuildSource_To_api_BuildSource(in *BuildSource, out *newer.BuildSource, s conversion.Scope) error {
|
|
| 174 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 175 |
- return err |
|
| 176 |
- } |
|
| 177 |
- return nil |
|
| 178 |
-} |
|
| 179 |
- |
|
| 180 |
-func Convert_api_BuildSource_To_v1beta3_BuildSource(in *newer.BuildSource, out *BuildSource, s conversion.Scope) error {
|
|
| 181 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 182 |
- return err |
|
| 183 |
- } |
|
| 184 |
- switch {
|
|
| 185 |
- // it is legal for a buildsource to have both a git+dockerfile source, but in v1 that was represented |
|
| 186 |
- // as type git. |
|
| 187 |
- case in.Git != nil: |
|
| 188 |
- out.Type = BuildSourceGit |
|
| 189 |
- // it is legal for a buildsource to have both a binary+dockerfile source, but in v1 that was represented |
|
| 190 |
- // as type binary. |
|
| 191 |
- case in.Binary != nil: |
|
| 192 |
- out.Type = BuildSourceBinary |
|
| 193 |
- case in.Dockerfile != nil: |
|
| 194 |
- out.Type = BuildSourceDockerfile |
|
| 195 |
- } |
|
| 196 |
- return nil |
|
| 197 |
-} |
|
| 198 |
- |
|
| 199 |
-func Convert_v1beta3_BuildStrategy_To_api_BuildStrategy(in *BuildStrategy, out *newer.BuildStrategy, s conversion.Scope) error {
|
|
| 200 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 201 |
- return err |
|
| 202 |
- } |
|
| 203 |
- return nil |
|
| 204 |
-} |
|
| 205 |
- |
|
| 206 |
-func Convert_api_BuildStrategy_To_v1beta3_BuildStrategy(in *newer.BuildStrategy, out *BuildStrategy, s conversion.Scope) error {
|
|
| 207 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 208 |
- return err |
|
| 209 |
- } |
|
| 210 |
- switch {
|
|
| 211 |
- case in.SourceStrategy != nil: |
|
| 212 |
- out.Type = SourceBuildStrategyType |
|
| 213 |
- case in.DockerStrategy != nil: |
|
| 214 |
- out.Type = DockerBuildStrategyType |
|
| 215 |
- case in.CustomStrategy != nil: |
|
| 216 |
- out.Type = CustomBuildStrategyType |
|
| 217 |
- } |
|
| 218 |
- return nil |
|
| 219 |
-} |
|
| 220 |
- |
|
| 221 |
-func addConversionFuncs(scheme *runtime.Scheme) {
|
|
| 222 |
- err := scheme.AddDefaultingFuncs( |
|
| 223 |
- func(config *BuildConfigSpec) {
|
|
| 224 |
- if len(config.RunPolicy) == 0 {
|
|
| 225 |
- config.RunPolicy = BuildRunPolicySerial |
|
| 226 |
- } |
|
| 227 |
- }, |
|
| 228 |
- func(strategy *BuildStrategy) {
|
|
| 229 |
- if (strategy != nil) && (strategy.Type == DockerBuildStrategyType) {
|
|
| 230 |
- // initialize DockerStrategy to a default state if it's not set. |
|
| 231 |
- if strategy.DockerStrategy == nil {
|
|
| 232 |
- strategy.DockerStrategy = &DockerBuildStrategy{}
|
|
| 233 |
- } |
|
| 234 |
- } |
|
| 235 |
- }, |
|
| 236 |
- func(obj *SourceBuildStrategy) {
|
|
| 237 |
- if len(obj.From.Kind) == 0 {
|
|
| 238 |
- obj.From.Kind = "ImageStreamTag" |
|
| 239 |
- } |
|
| 240 |
- }, |
|
| 241 |
- func(obj *DockerBuildStrategy) {
|
|
| 242 |
- if obj.From != nil && len(obj.From.Kind) == 0 {
|
|
| 243 |
- obj.From.Kind = "ImageStreamTag" |
|
| 244 |
- } |
|
| 245 |
- }, |
|
| 246 |
- func(obj *CustomBuildStrategy) {
|
|
| 247 |
- if len(obj.From.Kind) == 0 {
|
|
| 248 |
- obj.From.Kind = "ImageStreamTag" |
|
| 249 |
- } |
|
| 250 |
- }, |
|
| 251 |
- func(obj *BuildTriggerPolicy) {
|
|
| 252 |
- if obj.Type == ImageChangeBuildTriggerType && obj.ImageChange == nil {
|
|
| 253 |
- obj.ImageChange = &ImageChangeTrigger{}
|
|
| 254 |
- } |
|
| 255 |
- }, |
|
| 256 |
- ) |
|
| 257 |
- if err != nil {
|
|
| 258 |
- panic(err) |
|
| 259 |
- } |
|
| 260 |
- |
|
| 261 |
- scheme.AddConversionFuncs( |
|
| 262 |
- Convert_v1beta3_BuildConfig_To_api_BuildConfig, |
|
| 263 |
- Convert_api_BuildConfig_To_v1beta3_BuildConfig, |
|
| 264 |
- Convert_v1beta3_SourceBuildStrategy_To_api_SourceBuildStrategy, |
|
| 265 |
- Convert_api_SourceBuildStrategy_To_v1beta3_SourceBuildStrategy, |
|
| 266 |
- Convert_v1beta3_DockerBuildStrategy_To_api_DockerBuildStrategy, |
|
| 267 |
- Convert_api_DockerBuildStrategy_To_v1beta3_DockerBuildStrategy, |
|
| 268 |
- Convert_v1beta3_CustomBuildStrategy_To_api_CustomBuildStrategy, |
|
| 269 |
- Convert_api_CustomBuildStrategy_To_v1beta3_CustomBuildStrategy, |
|
| 270 |
- Convert_v1beta3_BuildOutput_To_api_BuildOutput, |
|
| 271 |
- Convert_api_BuildOutput_To_v1beta3_BuildOutput, |
|
| 272 |
- Convert_v1beta3_BuildTriggerPolicy_To_api_BuildTriggerPolicy, |
|
| 273 |
- Convert_api_BuildTriggerPolicy_To_v1beta3_BuildTriggerPolicy, |
|
| 274 |
- Convert_v1beta3_SourceRevision_To_api_SourceRevision, |
|
| 275 |
- Convert_api_SourceRevision_To_v1beta3_SourceRevision, |
|
| 276 |
- Convert_v1beta3_BuildSource_To_api_BuildSource, |
|
| 277 |
- Convert_api_BuildSource_To_v1beta3_BuildSource, |
|
| 278 |
- Convert_v1beta3_BuildStrategy_To_api_BuildStrategy, |
|
| 279 |
- Convert_api_BuildStrategy_To_v1beta3_BuildStrategy, |
|
| 280 |
- ) |
|
| 281 |
- |
|
| 282 |
- // Add field conversion funcs. |
|
| 283 |
- err = scheme.AddFieldLabelConversionFunc("v1beta3", "Build",
|
|
| 284 |
- func(label, value string) (string, string, error) {
|
|
| 285 |
- switch label {
|
|
| 286 |
- case "name": |
|
| 287 |
- return "metadata.name", value, nil |
|
| 288 |
- case "status": |
|
| 289 |
- return "status", value, nil |
|
| 290 |
- case "podName": |
|
| 291 |
- return "podName", value, nil |
|
| 292 |
- default: |
|
| 293 |
- return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 294 |
- } |
|
| 295 |
- }) |
|
| 296 |
- if err != nil {
|
|
| 297 |
- // If one of the conversion functions is malformed, detect it immediately. |
|
| 298 |
- panic(err) |
|
| 299 |
- } |
|
| 300 |
- err = scheme.AddFieldLabelConversionFunc("v1beta3", "BuildConfig",
|
|
| 301 |
- func(label, value string) (string, string, error) {
|
|
| 302 |
- switch label {
|
|
| 303 |
- case "name": |
|
| 304 |
- return "metadata.name", value, nil |
|
| 305 |
- default: |
|
| 306 |
- return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 307 |
- } |
|
| 308 |
- }) |
|
| 309 |
- if err != nil {
|
|
| 310 |
- // If one of the conversion functions is malformed, detect it immediately. |
|
| 311 |
- panic(err) |
|
| 312 |
- } |
|
| 313 |
-} |
| 314 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,311 +0,0 @@ |
| 1 |
-package v1beta3_test |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "testing" |
|
| 5 |
- |
|
| 6 |
- knewer "k8s.io/kubernetes/pkg/api" |
|
| 7 |
- kolder "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 8 |
- |
|
| 9 |
- newer "github.com/openshift/origin/pkg/build/api" |
|
| 10 |
- _ "github.com/openshift/origin/pkg/build/api/install" |
|
| 11 |
- older "github.com/openshift/origin/pkg/build/api/v1beta3" |
|
| 12 |
-) |
|
| 13 |
- |
|
| 14 |
-var Convert = knewer.Scheme.Convert |
|
| 15 |
- |
|
| 16 |
-func TestBuildConfigConversion(t *testing.T) {
|
|
| 17 |
- buildConfigs := []*older.BuildConfig{
|
|
| 18 |
- {
|
|
| 19 |
- ObjectMeta: kolder.ObjectMeta{Name: "config-id", Namespace: "namespace"},
|
|
| 20 |
- Spec: older.BuildConfigSpec{
|
|
| 21 |
- CommonSpec: older.CommonSpec{
|
|
| 22 |
- Source: older.BuildSource{
|
|
| 23 |
- Type: older.BuildSourceGit, |
|
| 24 |
- Git: &older.GitBuildSource{
|
|
| 25 |
- URI: "http://github.com/my/repository", |
|
| 26 |
- }, |
|
| 27 |
- ContextDir: "context", |
|
| 28 |
- }, |
|
| 29 |
- Strategy: older.BuildStrategy{
|
|
| 30 |
- Type: older.DockerBuildStrategyType, |
|
| 31 |
- DockerStrategy: &older.DockerBuildStrategy{
|
|
| 32 |
- From: &kolder.ObjectReference{
|
|
| 33 |
- Kind: "ImageStream", |
|
| 34 |
- Name: "fromstream", |
|
| 35 |
- }, |
|
| 36 |
- }, |
|
| 37 |
- }, |
|
| 38 |
- Output: older.BuildOutput{
|
|
| 39 |
- To: &kolder.ObjectReference{
|
|
| 40 |
- Kind: "ImageStream", |
|
| 41 |
- Name: "outputstream", |
|
| 42 |
- }, |
|
| 43 |
- }, |
|
| 44 |
- }, |
|
| 45 |
- Triggers: []older.BuildTriggerPolicy{
|
|
| 46 |
- {
|
|
| 47 |
- Type: older.ImageChangeBuildTriggerType, |
|
| 48 |
- ImageChange: &older.ImageChangeTrigger{},
|
|
| 49 |
- }, |
|
| 50 |
- {
|
|
| 51 |
- Type: older.GitHubWebHookBuildTriggerType, |
|
| 52 |
- }, |
|
| 53 |
- {
|
|
| 54 |
- Type: older.GenericWebHookBuildTriggerType, |
|
| 55 |
- }, |
|
| 56 |
- }, |
|
| 57 |
- }, |
|
| 58 |
- }, |
|
| 59 |
- {
|
|
| 60 |
- ObjectMeta: kolder.ObjectMeta{Name: "config-id", Namespace: "namespace"},
|
|
| 61 |
- Spec: older.BuildConfigSpec{
|
|
| 62 |
- CommonSpec: older.CommonSpec{
|
|
| 63 |
- Source: older.BuildSource{
|
|
| 64 |
- Type: older.BuildSourceGit, |
|
| 65 |
- Git: &older.GitBuildSource{
|
|
| 66 |
- URI: "http://github.com/my/repository", |
|
| 67 |
- }, |
|
| 68 |
- ContextDir: "context", |
|
| 69 |
- }, |
|
| 70 |
- Strategy: older.BuildStrategy{
|
|
| 71 |
- Type: older.SourceBuildStrategyType, |
|
| 72 |
- SourceStrategy: &older.SourceBuildStrategy{
|
|
| 73 |
- From: kolder.ObjectReference{
|
|
| 74 |
- Kind: "ImageStream", |
|
| 75 |
- Name: "fromstream", |
|
| 76 |
- }, |
|
| 77 |
- }, |
|
| 78 |
- }, |
|
| 79 |
- Output: older.BuildOutput{
|
|
| 80 |
- To: &kolder.ObjectReference{
|
|
| 81 |
- Kind: "ImageStream", |
|
| 82 |
- Name: "outputstream", |
|
| 83 |
- }, |
|
| 84 |
- }, |
|
| 85 |
- }, |
|
| 86 |
- Triggers: []older.BuildTriggerPolicy{
|
|
| 87 |
- {
|
|
| 88 |
- Type: older.ImageChangeBuildTriggerType, |
|
| 89 |
- ImageChange: &older.ImageChangeTrigger{},
|
|
| 90 |
- }, |
|
| 91 |
- {
|
|
| 92 |
- Type: older.GitHubWebHookBuildTriggerType, |
|
| 93 |
- }, |
|
| 94 |
- {
|
|
| 95 |
- Type: older.GenericWebHookBuildTriggerType, |
|
| 96 |
- }, |
|
| 97 |
- }, |
|
| 98 |
- }, |
|
| 99 |
- }, |
|
| 100 |
- {
|
|
| 101 |
- ObjectMeta: kolder.ObjectMeta{Name: "config-id", Namespace: "namespace"},
|
|
| 102 |
- Spec: older.BuildConfigSpec{
|
|
| 103 |
- CommonSpec: older.CommonSpec{
|
|
| 104 |
- Source: older.BuildSource{
|
|
| 105 |
- Type: older.BuildSourceGit, |
|
| 106 |
- Git: &older.GitBuildSource{
|
|
| 107 |
- URI: "http://github.com/my/repository", |
|
| 108 |
- }, |
|
| 109 |
- ContextDir: "context", |
|
| 110 |
- }, |
|
| 111 |
- Strategy: older.BuildStrategy{
|
|
| 112 |
- Type: older.CustomBuildStrategyType, |
|
| 113 |
- CustomStrategy: &older.CustomBuildStrategy{
|
|
| 114 |
- From: kolder.ObjectReference{
|
|
| 115 |
- Kind: "ImageStream", |
|
| 116 |
- Name: "fromstream", |
|
| 117 |
- }, |
|
| 118 |
- }, |
|
| 119 |
- }, |
|
| 120 |
- Output: older.BuildOutput{
|
|
| 121 |
- To: &kolder.ObjectReference{
|
|
| 122 |
- Kind: "ImageStream", |
|
| 123 |
- Name: "outputstream", |
|
| 124 |
- }, |
|
| 125 |
- }, |
|
| 126 |
- }, |
|
| 127 |
- Triggers: []older.BuildTriggerPolicy{
|
|
| 128 |
- {
|
|
| 129 |
- Type: older.ImageChangeBuildTriggerType, |
|
| 130 |
- ImageChange: &older.ImageChangeTrigger{},
|
|
| 131 |
- }, |
|
| 132 |
- {
|
|
| 133 |
- Type: older.GitHubWebHookBuildTriggerType, |
|
| 134 |
- }, |
|
| 135 |
- {
|
|
| 136 |
- Type: older.GenericWebHookBuildTriggerType, |
|
| 137 |
- }, |
|
| 138 |
- }, |
|
| 139 |
- }, |
|
| 140 |
- }, |
|
| 141 |
- } |
|
| 142 |
- |
|
| 143 |
- for _, bc := range buildConfigs {
|
|
| 144 |
- |
|
| 145 |
- var internalbuild newer.BuildConfig |
|
| 146 |
- |
|
| 147 |
- Convert(bc, &internalbuild) |
|
| 148 |
- switch bc.Spec.Strategy.Type {
|
|
| 149 |
- case older.SourceBuildStrategyType: |
|
| 150 |
- if internalbuild.Spec.Strategy.SourceStrategy.From.Kind != "ImageStreamTag" {
|
|
| 151 |
- t.Errorf("Expected From Kind %s, got %s", "ImageStreamTag", internalbuild.Spec.Strategy.SourceStrategy.From.Kind)
|
|
| 152 |
- } |
|
| 153 |
- case older.DockerBuildStrategyType: |
|
| 154 |
- if internalbuild.Spec.Strategy.DockerStrategy.From.Kind != "ImageStreamTag" {
|
|
| 155 |
- t.Errorf("Expected From Kind %s, got %s", "ImageStreamTag", internalbuild.Spec.Strategy.DockerStrategy.From.Kind)
|
|
| 156 |
- } |
|
| 157 |
- case older.CustomBuildStrategyType: |
|
| 158 |
- if internalbuild.Spec.Strategy.CustomStrategy.From.Kind != "ImageStreamTag" {
|
|
| 159 |
- t.Errorf("Expected From Kind %s, got %s", "ImageStreamTag", internalbuild.Spec.Strategy.CustomStrategy.From.Kind)
|
|
| 160 |
- } |
|
| 161 |
- } |
|
| 162 |
- if internalbuild.Spec.Output.To.Kind != "ImageStreamTag" {
|
|
| 163 |
- t.Errorf("Expected Output Kind %s, got %s", "ImageStreamTag", internalbuild.Spec.Output.To.Kind)
|
|
| 164 |
- } |
|
| 165 |
- var foundImageChange, foundGitHub, foundGeneric bool |
|
| 166 |
- for _, trigger := range internalbuild.Spec.Triggers {
|
|
| 167 |
- switch trigger.Type {
|
|
| 168 |
- case newer.ImageChangeBuildTriggerType: |
|
| 169 |
- foundImageChange = true |
|
| 170 |
- |
|
| 171 |
- case newer.GenericWebHookBuildTriggerType: |
|
| 172 |
- foundGeneric = true |
|
| 173 |
- |
|
| 174 |
- case newer.GitHubWebHookBuildTriggerType: |
|
| 175 |
- foundGitHub = true |
|
| 176 |
- } |
|
| 177 |
- } |
|
| 178 |
- if !foundImageChange {
|
|
| 179 |
- t.Errorf("ImageChangeTriggerType not converted correctly: %v", internalbuild.Spec.Triggers)
|
|
| 180 |
- } |
|
| 181 |
- if !foundGitHub {
|
|
| 182 |
- t.Errorf("GitHubWebHookTriggerType not converted correctly: %v", internalbuild.Spec.Triggers)
|
|
| 183 |
- } |
|
| 184 |
- if !foundGeneric {
|
|
| 185 |
- t.Errorf("GenericWebHookTriggerType not converted correctly: %v", internalbuild.Spec.Triggers)
|
|
| 186 |
- } |
|
| 187 |
- } |
|
| 188 |
-} |
|
| 189 |
- |
|
| 190 |
-func TestBuildTriggerPolicyOldToNewConversion(t *testing.T) {
|
|
| 191 |
- testCases := map[string]struct {
|
|
| 192 |
- Olds []older.BuildTriggerType |
|
| 193 |
- ExpectedBuildTriggerType newer.BuildTriggerType |
|
| 194 |
- }{
|
|
| 195 |
- "ImageChange": {
|
|
| 196 |
- Olds: []older.BuildTriggerType{
|
|
| 197 |
- older.ImageChangeBuildTriggerType, |
|
| 198 |
- older.BuildTriggerType(newer.ImageChangeBuildTriggerType), |
|
| 199 |
- }, |
|
| 200 |
- ExpectedBuildTriggerType: newer.ImageChangeBuildTriggerType, |
|
| 201 |
- }, |
|
| 202 |
- "Generic": {
|
|
| 203 |
- Olds: []older.BuildTriggerType{
|
|
| 204 |
- older.GenericWebHookBuildTriggerType, |
|
| 205 |
- older.BuildTriggerType(newer.GenericWebHookBuildTriggerType), |
|
| 206 |
- }, |
|
| 207 |
- ExpectedBuildTriggerType: newer.GenericWebHookBuildTriggerType, |
|
| 208 |
- }, |
|
| 209 |
- "GitHub": {
|
|
| 210 |
- Olds: []older.BuildTriggerType{
|
|
| 211 |
- older.GitHubWebHookBuildTriggerType, |
|
| 212 |
- older.BuildTriggerType(newer.GitHubWebHookBuildTriggerType), |
|
| 213 |
- }, |
|
| 214 |
- ExpectedBuildTriggerType: newer.GitHubWebHookBuildTriggerType, |
|
| 215 |
- }, |
|
| 216 |
- } |
|
| 217 |
- for s, testCase := range testCases {
|
|
| 218 |
- expected := testCase.ExpectedBuildTriggerType |
|
| 219 |
- for _, old := range testCase.Olds {
|
|
| 220 |
- var actual newer.BuildTriggerPolicy |
|
| 221 |
- oldVersion := older.BuildTriggerPolicy{
|
|
| 222 |
- Type: old, |
|
| 223 |
- } |
|
| 224 |
- err := Convert(&oldVersion, &actual) |
|
| 225 |
- if err != nil {
|
|
| 226 |
- t.Fatalf("%s (%s -> %s): unexpected error: %v", s, old, expected, err)
|
|
| 227 |
- } |
|
| 228 |
- if actual.Type != testCase.ExpectedBuildTriggerType {
|
|
| 229 |
- t.Errorf("%s (%s -> %s): expected %v, actual %v", s, old, expected, expected, actual.Type)
|
|
| 230 |
- } |
|
| 231 |
- } |
|
| 232 |
- } |
|
| 233 |
-} |
|
| 234 |
- |
|
| 235 |
-func TestBuildTriggerPolicyNewToOldConversion(t *testing.T) {
|
|
| 236 |
- testCases := map[string]struct {
|
|
| 237 |
- New newer.BuildTriggerType |
|
| 238 |
- ExpectedBuildTriggerType older.BuildTriggerType |
|
| 239 |
- }{
|
|
| 240 |
- "ImageChange": {
|
|
| 241 |
- New: newer.ImageChangeBuildTriggerType, |
|
| 242 |
- ExpectedBuildTriggerType: older.ImageChangeBuildTriggerType, |
|
| 243 |
- }, |
|
| 244 |
- "Generic": {
|
|
| 245 |
- New: newer.GenericWebHookBuildTriggerType, |
|
| 246 |
- ExpectedBuildTriggerType: older.GenericWebHookBuildTriggerType, |
|
| 247 |
- }, |
|
| 248 |
- "GitHub": {
|
|
| 249 |
- New: newer.GitHubWebHookBuildTriggerType, |
|
| 250 |
- ExpectedBuildTriggerType: older.GitHubWebHookBuildTriggerType, |
|
| 251 |
- }, |
|
| 252 |
- } |
|
| 253 |
- for s, testCase := range testCases {
|
|
| 254 |
- var actual older.BuildTriggerPolicy |
|
| 255 |
- newVersion := newer.BuildTriggerPolicy{
|
|
| 256 |
- Type: testCase.New, |
|
| 257 |
- } |
|
| 258 |
- err := Convert(&newVersion, &actual) |
|
| 259 |
- if err != nil {
|
|
| 260 |
- t.Fatalf("%s: unexpected error: %v", s, err)
|
|
| 261 |
- } |
|
| 262 |
- if actual.Type != testCase.ExpectedBuildTriggerType {
|
|
| 263 |
- t.Errorf("%s: expected %v, actual %v", s, testCase.ExpectedBuildTriggerType, actual.Type)
|
|
| 264 |
- } |
|
| 265 |
- } |
|
| 266 |
-} |
|
| 267 |
- |
|
| 268 |
-func TestInvalidImageChangeTriggerRemoval(t *testing.T) {
|
|
| 269 |
- buildConfig := older.BuildConfig{
|
|
| 270 |
- ObjectMeta: kolder.ObjectMeta{Name: "config-id", Namespace: "namespace"},
|
|
| 271 |
- Spec: older.BuildConfigSpec{
|
|
| 272 |
- CommonSpec: older.CommonSpec{
|
|
| 273 |
- Strategy: older.BuildStrategy{
|
|
| 274 |
- Type: older.DockerBuildStrategyType, |
|
| 275 |
- DockerStrategy: &older.DockerBuildStrategy{
|
|
| 276 |
- From: &kolder.ObjectReference{
|
|
| 277 |
- Kind: "DockerImage", |
|
| 278 |
- Name: "fromimage", |
|
| 279 |
- }, |
|
| 280 |
- }, |
|
| 281 |
- }, |
|
| 282 |
- }, |
|
| 283 |
- Triggers: []older.BuildTriggerPolicy{
|
|
| 284 |
- {
|
|
| 285 |
- Type: older.ImageChangeBuildTriggerType, |
|
| 286 |
- ImageChange: &older.ImageChangeTrigger{},
|
|
| 287 |
- }, |
|
| 288 |
- {
|
|
| 289 |
- Type: older.ImageChangeBuildTriggerType, |
|
| 290 |
- ImageChange: &older.ImageChangeTrigger{
|
|
| 291 |
- From: &kolder.ObjectReference{
|
|
| 292 |
- Kind: "ImageStreamTag", |
|
| 293 |
- Name: "imagestream", |
|
| 294 |
- }, |
|
| 295 |
- }, |
|
| 296 |
- }, |
|
| 297 |
- }, |
|
| 298 |
- }, |
|
| 299 |
- } |
|
| 300 |
- |
|
| 301 |
- var internalBC newer.BuildConfig |
|
| 302 |
- |
|
| 303 |
- Convert(&buildConfig, &internalBC) |
|
| 304 |
- if len(internalBC.Spec.Triggers) != 1 {
|
|
| 305 |
- t.Errorf("Expected 1 trigger, got %d", len(internalBC.Spec.Triggers))
|
|
| 306 |
- } |
|
| 307 |
- if internalBC.Spec.Triggers[0].ImageChange.From == nil {
|
|
| 308 |
- t.Errorf("Expected remaining trigger to have a From value")
|
|
| 309 |
- } |
|
| 310 |
- |
|
| 311 |
-} |
| 312 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,39 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-const GroupName = "" |
|
| 9 |
- |
|
| 10 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 11 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 12 |
- |
|
| 13 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 14 |
- addKnownTypes(scheme) |
|
| 15 |
- addConversionFuncs(scheme) |
|
| 16 |
-} |
|
| 17 |
- |
|
| 18 |
-// Adds the list of known types to api.Scheme. |
|
| 19 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 20 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 21 |
- &Build{},
|
|
| 22 |
- &BuildList{},
|
|
| 23 |
- &BuildConfig{},
|
|
| 24 |
- &BuildConfigList{},
|
|
| 25 |
- &BuildLog{},
|
|
| 26 |
- &BuildRequest{},
|
|
| 27 |
- &BuildLogOptions{},
|
|
| 28 |
- &BinaryBuildRequestOptions{},
|
|
| 29 |
- ) |
|
| 30 |
-} |
|
| 31 |
- |
|
| 32 |
-func (obj *Build) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 33 |
-func (obj *BuildList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 34 |
-func (obj *BuildConfig) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 35 |
-func (obj *BuildConfigList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 36 |
-func (obj *BuildLog) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 37 |
-func (obj *BuildRequest) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 38 |
-func (obj *BuildLogOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 39 |
-func (obj *BinaryBuildRequestOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 40 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,806 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "time" |
|
| 5 |
- |
|
| 6 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 7 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 8 |
-) |
|
| 9 |
- |
|
| 10 |
-// Build encapsulates the inputs needed to produce a new deployable image, as well as |
|
| 11 |
-// the status of the execution and a reference to the Pod which executed the build. |
|
| 12 |
-type Build struct {
|
|
| 13 |
- unversioned.TypeMeta `json:",inline"` |
|
| 14 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 15 |
- |
|
| 16 |
- // Spec is all the inputs used to execute the build. |
|
| 17 |
- Spec BuildSpec `json:"spec,omitempty"` |
|
| 18 |
- |
|
| 19 |
- // Status is the current status of the build. |
|
| 20 |
- Status BuildStatus `json:"status,omitempty"` |
|
| 21 |
-} |
|
| 22 |
- |
|
| 23 |
-// BuildSpec has the information to represent a build and also additional |
|
| 24 |
-// information about a build |
|
| 25 |
-type BuildSpec struct {
|
|
| 26 |
- // CommonSpec is the information that represents a build |
|
| 27 |
- CommonSpec `json:",inline"` |
|
| 28 |
- |
|
| 29 |
- // triggeredBy describes which triggers started the most recent update to the |
|
| 30 |
- // build configuration and contains information about those triggers. |
|
| 31 |
- TriggeredBy []BuildTriggerCause `json:"triggeredBy"` |
|
| 32 |
-} |
|
| 33 |
- |
|
| 34 |
-// CommonSpec encapsulates all the inputs necessary to represent a build. |
|
| 35 |
-type CommonSpec struct {
|
|
| 36 |
- // serviceAccount is the name of the ServiceAccount to use to run the pod |
|
| 37 |
- // created by this build. |
|
| 38 |
- // The pod will be allowed to use secrets referenced by the ServiceAccount |
|
| 39 |
- ServiceAccount string `json:"serviceAccount,omitempty"` |
|
| 40 |
- |
|
| 41 |
- // source describes the SCM in use. |
|
| 42 |
- Source BuildSource `json:"source,omitempty"` |
|
| 43 |
- |
|
| 44 |
- // revision is the information from the source for a specific repo snapshot. |
|
| 45 |
- // This is optional. |
|
| 46 |
- Revision *SourceRevision `json:"revision,omitempty"` |
|
| 47 |
- |
|
| 48 |
- // strategy defines how to perform a build. |
|
| 49 |
- Strategy BuildStrategy `json:"strategy"` |
|
| 50 |
- |
|
| 51 |
- // output describes the Docker image the Strategy should produce. |
|
| 52 |
- Output BuildOutput `json:"output,omitempty"` |
|
| 53 |
- |
|
| 54 |
- // resources computes resource requirements to execute the build. |
|
| 55 |
- Resources kapi.ResourceRequirements `json:"resources,omitempty"` |
|
| 56 |
- |
|
| 57 |
- // postCommit is a build hook executed after the build output image is |
|
| 58 |
- // committed, before it is pushed to a registry. |
|
| 59 |
- PostCommit BuildPostCommitSpec `json:"postCommit,omitempty"` |
|
| 60 |
- |
|
| 61 |
- // completionDeadlineSeconds is an optional duration in seconds, counted from |
|
| 62 |
- // the time when a build pod gets scheduled in the system, that the build may |
|
| 63 |
- // be active on a node before the system actively tries to terminate the |
|
| 64 |
- // build; value must be positive integer |
|
| 65 |
- CompletionDeadlineSeconds *int64 `json:"completionDeadlineSeconds,omitempty"` |
|
| 66 |
-} |
|
| 67 |
- |
|
| 68 |
-// BuildTriggerCause holds information about a triggered build. It is used for |
|
| 69 |
-// displaying build trigger data for each build and build configuration in oc |
|
| 70 |
-// describe. It is also used to describe which triggers led to the most recent |
|
| 71 |
-// update in the build configuration. |
|
| 72 |
-type BuildTriggerCause struct {
|
|
| 73 |
- // message is used to store a human readable message for why the build was |
|
| 74 |
- // triggered. E.g.: "Manually triggered by user", "Configuration change",etc. |
|
| 75 |
- Message string `json:"message,omitempty"` |
|
| 76 |
- |
|
| 77 |
- // genericWebHook represents data for a generic webhook that fired a specific |
|
| 78 |
- // build. |
|
| 79 |
- GenericWebHook *GenericWebHookCause `json:"genericWebHook,omitempty"` |
|
| 80 |
- |
|
| 81 |
- // gitHubWebHook represents data for a GitHub webhook that fired a |
|
| 82 |
- //specific build. |
|
| 83 |
- GitHubWebHook *GitHubWebHookCause `json:"githubWebHook,omitempty"` |
|
| 84 |
- |
|
| 85 |
- // imageChangeBuild stores information about an imagechange event |
|
| 86 |
- // that triggered a new build. |
|
| 87 |
- ImageChangeBuild *ImageChangeCause `json:"imageChangeBuild,omitempty"` |
|
| 88 |
-} |
|
| 89 |
- |
|
| 90 |
-// GenericWebHookCause holds information about a generic WebHook that |
|
| 91 |
-// triggered a build. |
|
| 92 |
-type GenericWebHookCause struct {
|
|
| 93 |
- // revision is an optional field that stores the git source revision |
|
| 94 |
- // information of the generic webhook trigger when it is available. |
|
| 95 |
- Revision *SourceRevision `json:"revision,omitempty"` |
|
| 96 |
- |
|
| 97 |
- // secret is the obfuscated webhook secret that triggered a build. |
|
| 98 |
- Secret string `json:"secret,omitempty"` |
|
| 99 |
-} |
|
| 100 |
- |
|
| 101 |
-// GitHubWebHookCause has information about a GitHub webhook that triggered a |
|
| 102 |
-// build. |
|
| 103 |
-type GitHubWebHookCause struct {
|
|
| 104 |
- // revision is the git source revision information of the trigger. |
|
| 105 |
- Revision *SourceRevision `json:"revision,omitempty"` |
|
| 106 |
- |
|
| 107 |
- // secret is the obfuscated webhook secret that triggered a build. |
|
| 108 |
- Secret string `json:"secret,omitempty"` |
|
| 109 |
-} |
|
| 110 |
- |
|
| 111 |
-// ImageChangeCause contains information about the image that triggered a |
|
| 112 |
-// build. |
|
| 113 |
-type ImageChangeCause struct {
|
|
| 114 |
- // imageID is the ID of the image that triggered a a new build. |
|
| 115 |
- ImageID string `json:"imageID,omitempty"` |
|
| 116 |
- |
|
| 117 |
- // fromRef contains detailed information about an image that triggered a |
|
| 118 |
- // build. |
|
| 119 |
- FromRef *kapi.ObjectReference `json:"fromRef,omitempty"` |
|
| 120 |
-} |
|
| 121 |
- |
|
| 122 |
-// BuildStatus contains the status of a build |
|
| 123 |
-type BuildStatus struct {
|
|
| 124 |
- // Phase is the point in the build lifecycle. |
|
| 125 |
- Phase BuildPhase `json:"phase"` |
|
| 126 |
- |
|
| 127 |
- // Cancelled describes if a cancel event was triggered for the build. |
|
| 128 |
- Cancelled bool `json:"cancelled,omitempty"` |
|
| 129 |
- |
|
| 130 |
- // Reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI. |
|
| 131 |
- Reason StatusReason `json:"reason,omitempty"` |
|
| 132 |
- |
|
| 133 |
- // Message is a human-readable message indicating details about why the build has this status. |
|
| 134 |
- Message string `json:"message,omitempty"` |
|
| 135 |
- |
|
| 136 |
- // StartTimestamp is a timestamp representing the server time when this Build started |
|
| 137 |
- // running in a Pod. |
|
| 138 |
- // It is represented in RFC3339 form and is in UTC. |
|
| 139 |
- StartTimestamp *unversioned.Time `json:"startTimestamp,omitempty"` |
|
| 140 |
- |
|
| 141 |
- // CompletionTimestamp is a timestamp representing the server time when this Build was |
|
| 142 |
- // finished, whether that build failed or succeeded. It reflects the time at which |
|
| 143 |
- // the Pod running the Build terminated. |
|
| 144 |
- // It is represented in RFC3339 form and is in UTC. |
|
| 145 |
- CompletionTimestamp *unversioned.Time `json:"completionTimestamp,omitempty"` |
|
| 146 |
- |
|
| 147 |
- // Duration contains time.Duration object describing build time. |
|
| 148 |
- Duration time.Duration `json:"duration,omitempty"` |
|
| 149 |
- |
|
| 150 |
- // OutputDockerImageReference contains a reference to the Docker image that |
|
| 151 |
- // will be built by this build. It's value is computed from |
|
| 152 |
- // Build.Spec.Output.To, and should include the registry address, so that |
|
| 153 |
- // it can be used to push and pull the image. |
|
| 154 |
- OutputDockerImageReference string `json:"outputDockerImageReference,omitempty"` |
|
| 155 |
- |
|
| 156 |
- // Config is an ObjectReference to the BuildConfig this Build is based on. |
|
| 157 |
- Config *kapi.ObjectReference `json:"config,omitempty"` |
|
| 158 |
-} |
|
| 159 |
- |
|
| 160 |
-// BuildPhase represents the status of a build at a point in time. |
|
| 161 |
-type BuildPhase string |
|
| 162 |
- |
|
| 163 |
-// Valid values for BuildPhase. |
|
| 164 |
-const ( |
|
| 165 |
- // BuildPhaseNew is automatically assigned to a newly created build. |
|
| 166 |
- BuildPhaseNew BuildPhase = "New" |
|
| 167 |
- |
|
| 168 |
- // BuildPhasePending indicates that a pod name has been assigned and a build is |
|
| 169 |
- // about to start running. |
|
| 170 |
- BuildPhasePending BuildPhase = "Pending" |
|
| 171 |
- |
|
| 172 |
- // BuildPhaseRunning indicates that a pod has been created and a build is running. |
|
| 173 |
- BuildPhaseRunning BuildPhase = "Running" |
|
| 174 |
- |
|
| 175 |
- // BuildPhaseComplete indicates that a build has been successful. |
|
| 176 |
- BuildPhaseComplete BuildPhase = "Complete" |
|
| 177 |
- |
|
| 178 |
- // BuildPhaseFailed indicates that a build has executed and failed. |
|
| 179 |
- BuildPhaseFailed BuildPhase = "Failed" |
|
| 180 |
- |
|
| 181 |
- // BuildPhaseError indicates that an error prevented the build from executing. |
|
| 182 |
- BuildPhaseError BuildPhase = "Error" |
|
| 183 |
- |
|
| 184 |
- // BuildPhaseCancelled indicates that a running/pending build was stopped from executing. |
|
| 185 |
- BuildPhaseCancelled BuildPhase = "Cancelled" |
|
| 186 |
-) |
|
| 187 |
- |
|
| 188 |
-// StatusReason is a brief CamelCase string that describes a temporary or |
|
| 189 |
-// permanent build error condition, meant for machine parsing and tidy display |
|
| 190 |
-// in the CLI. |
|
| 191 |
-type StatusReason string |
|
| 192 |
- |
|
| 193 |
-// BuildSourceType is the type of SCM used. |
|
| 194 |
-type BuildSourceType string |
|
| 195 |
- |
|
| 196 |
-// Valid values for BuildSourceType. |
|
| 197 |
-const ( |
|
| 198 |
- //BuildSourceGit instructs a build to use a Git source control repository as the build input. |
|
| 199 |
- BuildSourceGit BuildSourceType = "Git" |
|
| 200 |
- // BuildSourceDockerfile uses a Dockerfile as the start of a build |
|
| 201 |
- BuildSourceDockerfile BuildSourceType = "Dockerfile" |
|
| 202 |
- // BuildSourceBinary indicates the build will accept a Binary file as input. |
|
| 203 |
- BuildSourceBinary BuildSourceType = "Binary" |
|
| 204 |
- // BuildSourceImage indicates the build will accept an image as input |
|
| 205 |
- BuildSourceImage BuildSourceType = "Image" |
|
| 206 |
-) |
|
| 207 |
- |
|
| 208 |
-// BuildSource is the SCM used for the build. |
|
| 209 |
-type BuildSource struct {
|
|
| 210 |
- // Type of build input to accept |
|
| 211 |
- Type BuildSourceType `json:"type"` |
|
| 212 |
- |
|
| 213 |
- // Binary builds accept a binary as their input. The binary is generally assumed to be a tar, |
|
| 214 |
- // gzipped tar, or zip file depending on the strategy. For Docker builds, this is the build |
|
| 215 |
- // context and an optional Dockerfile may be specified to override any Dockerfile in the |
|
| 216 |
- // build context. For Source builds, this is assumed to be an archive as described above. For |
|
| 217 |
- // Source and Docker builds, if binary.asFile is set the build will receive a directory with |
|
| 218 |
- // a single file. contextDir may be used when an archive is provided. Custom builds will |
|
| 219 |
- // receive this binary as input on STDIN. |
|
| 220 |
- Binary *BinaryBuildSource `json:"binary,omitempty"` |
|
| 221 |
- |
|
| 222 |
- // Dockerfile is the raw contents of a Dockerfile which should be built. When this option is |
|
| 223 |
- // specified, the From and Env on the Docker build strategy are applied on top of this file. |
|
| 224 |
- Dockerfile *string `json:"dockerfile,omitempty"` |
|
| 225 |
- |
|
| 226 |
- // Git contains optional information about git build source. |
|
| 227 |
- Git *GitBuildSource `json:"git,omitempty"` |
|
| 228 |
- |
|
| 229 |
- // Images describes a set of images to be used to provide source for the build |
|
| 230 |
- Images []ImageSource `json:"images,omitempty"` |
|
| 231 |
- |
|
| 232 |
- // Specify the sub-directory where the source code for the application exists. |
|
| 233 |
- // This allows to have buildable sources in directory other than root of |
|
| 234 |
- // repository. |
|
| 235 |
- ContextDir string `json:"contextDir,omitempty"` |
|
| 236 |
- |
|
| 237 |
- // SourceSecret is the name of a Secret that would be used for setting |
|
| 238 |
- // up the authentication for cloning private repository. |
|
| 239 |
- // The secret contains valid credentials for remote repository, where the |
|
| 240 |
- // data's key represent the authentication method to be used and value is |
|
| 241 |
- // the base64 encoded credentials. Supported auth methods are: ssh-privatekey. |
|
| 242 |
- SourceSecret *kapi.LocalObjectReference `json:"sourceSecret,omitempty"` |
|
| 243 |
- |
|
| 244 |
- // Secrets represents a list of secrets and their destinations that will |
|
| 245 |
- // be used only for the build. |
|
| 246 |
- Secrets []SecretBuildSource `json:"secrets"` |
|
| 247 |
-} |
|
| 248 |
- |
|
| 249 |
-// ImageSource describes an image that is used as source for the build |
|
| 250 |
-type ImageSource struct {
|
|
| 251 |
- // From is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to |
|
| 252 |
- // copy source from. |
|
| 253 |
- From kapi.ObjectReference `json:"from"` |
|
| 254 |
- |
|
| 255 |
- // Paths is a list of source and destination paths to copy from the image. |
|
| 256 |
- Paths []ImageSourcePath `json:"paths"` |
|
| 257 |
- |
|
| 258 |
- // PullSecret is a reference to a secret to be used to pull the image from a registry |
|
| 259 |
- // If the image is pulled from the OpenShift registry, this field does not need to be set. |
|
| 260 |
- PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty"` |
|
| 261 |
-} |
|
| 262 |
- |
|
| 263 |
-// ImageSourcePath describes a path to be copied from a source image and its destination within the build directory. |
|
| 264 |
-type ImageSourcePath struct {
|
|
| 265 |
- // SourcePath is the absolute path of the file or directory inside the image to |
|
| 266 |
- // copy to the build directory. |
|
| 267 |
- SourcePath string `json:"sourcePath"` |
|
| 268 |
- |
|
| 269 |
- // DestinationDir is the relative directory within the build directory |
|
| 270 |
- // where files copied from the image are placed. |
|
| 271 |
- DestinationDir string `json:"destinationDir"` |
|
| 272 |
-} |
|
| 273 |
- |
|
| 274 |
-// SecretBuildSource describes a secret and its destination directory that will be |
|
| 275 |
-// used only at the build time. The content of the secret referenced here will |
|
| 276 |
-// be copied into the destination directory instead of mounting. |
|
| 277 |
-type SecretBuildSource struct {
|
|
| 278 |
- // Secret is a reference to an existing secret that you want to use in your |
|
| 279 |
- // build. |
|
| 280 |
- Secret kapi.LocalObjectReference `json:"secret"` |
|
| 281 |
- |
|
| 282 |
- // DestinationDir is the directory where the files from the secret should be |
|
| 283 |
- // available for the build time. |
|
| 284 |
- // For the Source build strategy, these will be injected into a container |
|
| 285 |
- // where the assemble script runs. Later, when the script finishes, all files |
|
| 286 |
- // injected will be truncated to zero length. |
|
| 287 |
- // For the Docker build strategy, these will be copied into the build |
|
| 288 |
- // directory, where the Dockerfile is located, so users can ADD or COPY them |
|
| 289 |
- // during docker build. |
|
| 290 |
- DestinationDir string `json:"destinationDir,omitempty"` |
|
| 291 |
-} |
|
| 292 |
- |
|
| 293 |
-type BinaryBuildSource struct {
|
|
| 294 |
- // AsFile indicates that the provided binary input should be considered a single file |
|
| 295 |
- // within the build input. For example, specifying "webapp.war" would place the provided |
|
| 296 |
- // binary as `/webapp.war` for the builder. If left empty, the Docker and Source build |
|
| 297 |
- // strategies assume this file is a zip, tar, or tar.gz file and extract it as the source. |
|
| 298 |
- // The custom strategy receives this binary as standard input. This filename may not |
|
| 299 |
- // contain slashes or be '..' or '.'. |
|
| 300 |
- AsFile string `json:"asFile,omitempty"` |
|
| 301 |
-} |
|
| 302 |
- |
|
| 303 |
-// SourceRevision is the revision or commit information from the source for the build |
|
| 304 |
-type SourceRevision struct {
|
|
| 305 |
- Type BuildSourceType `json:"type"` |
|
| 306 |
- Git *GitSourceRevision `json:"git,omitempty"` |
|
| 307 |
-} |
|
| 308 |
- |
|
| 309 |
-// GitSourceRevision is the commit information from a git source for a build |
|
| 310 |
-type GitSourceRevision struct {
|
|
| 311 |
- // Commit is the commit hash identifying a specific commit |
|
| 312 |
- Commit string `json:"commit,omitempty"` |
|
| 313 |
- |
|
| 314 |
- // Author is the author of a specific commit |
|
| 315 |
- Author SourceControlUser `json:"author,omitempty"` |
|
| 316 |
- |
|
| 317 |
- // Committer is the committer of a specific commit |
|
| 318 |
- Committer SourceControlUser `json:"committer,omitempty"` |
|
| 319 |
- |
|
| 320 |
- // Message is the description of a specific commit |
|
| 321 |
- Message string `json:"message,omitempty"` |
|
| 322 |
-} |
|
| 323 |
- |
|
| 324 |
-// GitBuildSource defines the parameters of a Git SCM |
|
| 325 |
-type GitBuildSource struct {
|
|
| 326 |
- // URI points to the source that will be built. The structure of the source |
|
| 327 |
- // will depend on the type of build to run |
|
| 328 |
- URI string `json:"uri"` |
|
| 329 |
- |
|
| 330 |
- // Ref is the branch/tag/ref to build. |
|
| 331 |
- Ref string `json:"ref,omitempty"` |
|
| 332 |
- |
|
| 333 |
- // HTTPProxy is a proxy used to reach the git repository over http |
|
| 334 |
- HTTPProxy *string `json:"httpProxy,omitempty"` |
|
| 335 |
- |
|
| 336 |
- // HTTPSProxy is a proxy used to reach the git repository over https |
|
| 337 |
- HTTPSProxy *string `json:"httpsProxy,omitempty"` |
|
| 338 |
-} |
|
| 339 |
- |
|
| 340 |
-// SourceControlUser defines the identity of a user of source control |
|
| 341 |
-type SourceControlUser struct {
|
|
| 342 |
- Name string `json:"name,omitempty"` |
|
| 343 |
- Email string `json:"email,omitempty"` |
|
| 344 |
-} |
|
| 345 |
- |
|
| 346 |
-// BuildStrategy contains the details of how to perform a build. |
|
| 347 |
-type BuildStrategy struct {
|
|
| 348 |
- // Type is the kind of build strategy. |
|
| 349 |
- Type BuildStrategyType `json:"type"` |
|
| 350 |
- |
|
| 351 |
- // DockerStrategy holds the parameters to the Docker build strategy. |
|
| 352 |
- DockerStrategy *DockerBuildStrategy `json:"dockerStrategy,omitempty"` |
|
| 353 |
- |
|
| 354 |
- // SourceStrategy holds the parameters to the Source build strategy. |
|
| 355 |
- SourceStrategy *SourceBuildStrategy `json:"sourceStrategy,omitempty"` |
|
| 356 |
- |
|
| 357 |
- // CustomStrategy holds the parameters to the Custom build strategy |
|
| 358 |
- CustomStrategy *CustomBuildStrategy `json:"customStrategy,omitempty"` |
|
| 359 |
-} |
|
| 360 |
- |
|
| 361 |
-// BuildStrategyType describes a particular way of performing a build. |
|
| 362 |
-type BuildStrategyType string |
|
| 363 |
- |
|
| 364 |
-// Valid values for BuildStrategyType. |
|
| 365 |
-const ( |
|
| 366 |
- // DockerBuildStrategyType performs builds using a Dockerfile. |
|
| 367 |
- DockerBuildStrategyType BuildStrategyType = "Docker" |
|
| 368 |
- |
|
| 369 |
- // SourceBuildStrategyType performs builds build using Source To Images with a Git repository |
|
| 370 |
- // and a builder image. |
|
| 371 |
- SourceBuildStrategyType BuildStrategyType = "Source" |
|
| 372 |
- |
|
| 373 |
- // CustomBuildStrategyType performs builds using custom builder Docker image. |
|
| 374 |
- CustomBuildStrategyType BuildStrategyType = "Custom" |
|
| 375 |
-) |
|
| 376 |
- |
|
| 377 |
-// CustomBuildStrategy defines input parameters specific to Custom build. |
|
| 378 |
-type CustomBuildStrategy struct {
|
|
| 379 |
- // From is reference to an ImageStreamTag, or ImageStreamImage from which |
|
| 380 |
- // the docker image should be pulled |
|
| 381 |
- From kapi.ObjectReference `json:"from"` |
|
| 382 |
- |
|
| 383 |
- // PullSecret is the name of a Secret that would be used for setting up |
|
| 384 |
- // the authentication for pulling the Docker images from the private Docker |
|
| 385 |
- // registries |
|
| 386 |
- PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty"` |
|
| 387 |
- |
|
| 388 |
- // Additional environment variables you want to pass into a builder container |
|
| 389 |
- Env []kapi.EnvVar `json:"env,omitempty"` |
|
| 390 |
- |
|
| 391 |
- // ExposeDockerSocket will allow running Docker commands (and build Docker images) from |
|
| 392 |
- // inside the Docker container. |
|
| 393 |
- // TODO: Allow admins to enforce 'false' for this option |
|
| 394 |
- ExposeDockerSocket bool `json:"exposeDockerSocket,omitempty"` |
|
| 395 |
- |
|
| 396 |
- // ForcePull describes if the controller should configure the build pod to always pull the images |
|
| 397 |
- // for the builder or only pull if it is not present locally |
|
| 398 |
- ForcePull bool `json:"forcePull,omitempty"` |
|
| 399 |
- |
|
| 400 |
- // Secrets is a list of additional secrets that will be included in the build pod |
|
| 401 |
- Secrets []SecretSpec `json:"secrets,omitempty"` |
|
| 402 |
- |
|
| 403 |
- // BuildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder |
|
| 404 |
- BuildAPIVersion string `json:"buildAPIVersion,omitempty"` |
|
| 405 |
-} |
|
| 406 |
- |
|
| 407 |
-// DockerBuildStrategy defines input parameters specific to Docker build. |
|
| 408 |
-type DockerBuildStrategy struct {
|
|
| 409 |
- // From is reference to an ImageStreamTag, or ImageStreamImage from which |
|
| 410 |
- // the docker image should be pulled |
|
| 411 |
- // the resulting image will be used in the FROM line of the Dockerfile for this build. |
|
| 412 |
- From *kapi.ObjectReference `json:"from,omitempty"` |
|
| 413 |
- |
|
| 414 |
- // PullSecret is the name of a Secret that would be used for setting up |
|
| 415 |
- // the authentication for pulling the Docker images from the private Docker |
|
| 416 |
- // registries |
|
| 417 |
- PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty"` |
|
| 418 |
- |
|
| 419 |
- // NoCache if set to true indicates that the docker build must be executed with the |
|
| 420 |
- // --no-cache=true flag |
|
| 421 |
- NoCache bool `json:"noCache,omitempty"` |
|
| 422 |
- |
|
| 423 |
- // Env contains additional environment variables you want to pass into a builder container |
|
| 424 |
- Env []kapi.EnvVar `json:"env,omitempty"` |
|
| 425 |
- |
|
| 426 |
- // ForcePull describes if the builder should pull the images from registry prior to building. |
|
| 427 |
- ForcePull bool `json:"forcePull,omitempty"` |
|
| 428 |
- |
|
| 429 |
- // DockerfilePath is the path of the Dockerfile that will be used to build the Docker image, |
|
| 430 |
- // relative to the root of the context (contextDir). |
|
| 431 |
- DockerfilePath string `json:"dockerfilePath,omitempty"` |
|
| 432 |
-} |
|
| 433 |
- |
|
| 434 |
-// SourceBuildStrategy defines input parameters specific to an Source build. |
|
| 435 |
-type SourceBuildStrategy struct {
|
|
| 436 |
- // From is reference to an ImageStreamTag, or ImageStreamImage from which |
|
| 437 |
- // the docker image should be pulled |
|
| 438 |
- From kapi.ObjectReference `json:"from"` |
|
| 439 |
- |
|
| 440 |
- // PullSecret is the name of a Secret that would be used for setting up |
|
| 441 |
- // the authentication for pulling the Docker images from the private Docker |
|
| 442 |
- // registries |
|
| 443 |
- PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty"` |
|
| 444 |
- |
|
| 445 |
- // Additional environment variables you want to pass into a builder container |
|
| 446 |
- Env []kapi.EnvVar `json:"env,omitempty"` |
|
| 447 |
- |
|
| 448 |
- // Scripts is the location of Source scripts |
|
| 449 |
- Scripts string `json:"scripts,omitempty"` |
|
| 450 |
- |
|
| 451 |
- // Incremental flag forces the Source build to do incremental builds if true. |
|
| 452 |
- Incremental bool `json:"incremental,omitempty"` |
|
| 453 |
- |
|
| 454 |
- // ForcePull describes if the builder should pull the images from registry prior to building. |
|
| 455 |
- ForcePull bool `json:"forcePull,omitempty"` |
|
| 456 |
-} |
|
| 457 |
- |
|
| 458 |
-// A BuildPostCommitSpec holds a build post commit hook specification. The hook |
|
| 459 |
-// executes a command in a temporary container running the build output image, |
|
| 460 |
-// immediately after the last layer of the image is committed and before the |
|
| 461 |
-// image is pushed to a registry. The command is executed with the current |
|
| 462 |
-// working directory ($PWD) set to the image's WORKDIR. |
|
| 463 |
-// |
|
| 464 |
-// The build will be marked as failed if the hook execution fails. It will fail |
|
| 465 |
-// if the script or command return a non-zero exit code, or if there is any |
|
| 466 |
-// other error related to starting the temporary container. |
|
| 467 |
-// |
|
| 468 |
-// There are five different ways to configure the hook. As an example, all forms |
|
| 469 |
-// below are equivalent and will execute `rake test --verbose`. |
|
| 470 |
-// |
|
| 471 |
-// 1. Shell script: |
|
| 472 |
-// |
|
| 473 |
-// BuildPostCommitSpec{
|
|
| 474 |
-// Script: "rake test --verbose", |
|
| 475 |
-// } |
|
| 476 |
-// |
|
| 477 |
-// The above is a convenient form which is equivalent to: |
|
| 478 |
-// |
|
| 479 |
-// BuildPostCommitSpec{
|
|
| 480 |
-// Command: []string{"/bin/sh", "-ic"},
|
|
| 481 |
-// Args: []string{"rake test --verbose"},
|
|
| 482 |
-// } |
|
| 483 |
-// |
|
| 484 |
-// 2. Command as the image entrypoint: |
|
| 485 |
-// |
|
| 486 |
-// BuildPostCommitSpec{
|
|
| 487 |
-// Command: []string{"rake", "test", "--verbose"},
|
|
| 488 |
-// } |
|
| 489 |
-// |
|
| 490 |
-// Command overrides the image entrypoint in the exec form, as documented in |
|
| 491 |
-// Docker: https://docs.docker.com/engine/reference/builder/#entrypoint. |
|
| 492 |
-// |
|
| 493 |
-// 3. Pass arguments to the default entrypoint: |
|
| 494 |
-// |
|
| 495 |
-// BuildPostCommitSpec{
|
|
| 496 |
-// Args: []string{"rake", "test", "--verbose"},
|
|
| 497 |
-// } |
|
| 498 |
-// |
|
| 499 |
-// This form is only useful if the image entrypoint can handle arguments. |
|
| 500 |
-// |
|
| 501 |
-// 4. Shell script with arguments: |
|
| 502 |
-// |
|
| 503 |
-// BuildPostCommitSpec{
|
|
| 504 |
-// Script: "rake test $1", |
|
| 505 |
-// Args: []string{"--verbose"},
|
|
| 506 |
-// } |
|
| 507 |
-// |
|
| 508 |
-// This form is useful if you need to pass arguments that would otherwise be |
|
| 509 |
-// hard to quote properly in the shell script. In the script, $0 will be |
|
| 510 |
-// "/bin/sh" and $1, $2, etc, are the positional arguments from Args. |
|
| 511 |
-// |
|
| 512 |
-// 5. Command with arguments: |
|
| 513 |
-// |
|
| 514 |
-// BuildPostCommitSpec{
|
|
| 515 |
-// Command: []string{"rake", "test"},
|
|
| 516 |
-// Args: []string{"--verbose"},
|
|
| 517 |
-// } |
|
| 518 |
-// |
|
| 519 |
-// This form is equivalent to appending the arguments to the Command slice. |
|
| 520 |
-// |
|
| 521 |
-// It is invalid to provide both Script and Command simultaneously. If none of |
|
| 522 |
-// the fields are specified, the hook is not executed. |
|
| 523 |
-type BuildPostCommitSpec struct {
|
|
| 524 |
- // Command is the command to run. It may not be specified with Script. |
|
| 525 |
- // This might be needed if the image doesn't have `/bin/sh`, or if you |
|
| 526 |
- // do not want to use a shell. In all other cases, using Script might be |
|
| 527 |
- // more convenient. |
|
| 528 |
- Command []string `json:"command,omitempty"` |
|
| 529 |
- // Args is a list of arguments that are provided to either Command, |
|
| 530 |
- // Script or the Docker image's default entrypoint. The arguments are |
|
| 531 |
- // placed immediately after the command to be run. |
|
| 532 |
- Args []string `json:"args,omitempty"` |
|
| 533 |
- // Script is a shell script to be run with `/bin/sh -ic`. It may not be |
|
| 534 |
- // specified with Command. Use Script when a shell script is appropriate |
|
| 535 |
- // to execute the post build hook, for example for running unit tests |
|
| 536 |
- // with `rake test`. If you need control over the image entrypoint, or |
|
| 537 |
- // if the image does not have `/bin/sh`, use Command and/or Args. |
|
| 538 |
- // The `-i` flag is needed to support CentOS and RHEL images that use |
|
| 539 |
- // Software Collections (SCL), in order to have the appropriate |
|
| 540 |
- // collections enabled in the shell. E.g., in the Ruby image, this is |
|
| 541 |
- // necessary to make `ruby`, `bundle` and other binaries available in |
|
| 542 |
- // the PATH. |
|
| 543 |
- Script string `json:"script,omitempty"` |
|
| 544 |
-} |
|
| 545 |
- |
|
| 546 |
-// BuildOutput is input to a build strategy and describes the Docker image that the strategy |
|
| 547 |
-// should produce. |
|
| 548 |
-type BuildOutput struct {
|
|
| 549 |
- // To defines an optional ImageStream to push the output of this build to. The namespace |
|
| 550 |
- // may be empty, in which case the ImageStream will be looked for in the namespace of |
|
| 551 |
- // the build. Kind must be one of 'ImageStreamImage', 'ImageStreamTag' or 'DockerImage'. |
|
| 552 |
- // This value will be used to look up a Docker image repository to push to. |
|
| 553 |
- To *kapi.ObjectReference `json:"to,omitempty"` |
|
| 554 |
- |
|
| 555 |
- // PushSecret is the name of a Secret that would be used for setting |
|
| 556 |
- // up the authentication for executing the Docker push to authentication |
|
| 557 |
- // enabled Docker Registry (or Docker Hub). |
|
| 558 |
- PushSecret *kapi.LocalObjectReference `json:"pushSecret,omitempty"` |
|
| 559 |
-} |
|
| 560 |
- |
|
| 561 |
-// BuildConfig is a template which can be used to create new builds. |
|
| 562 |
-type BuildConfig struct {
|
|
| 563 |
- unversioned.TypeMeta `json:",inline"` |
|
| 564 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 565 |
- |
|
| 566 |
- // Spec holds all the input necessary to produce a new build, and the conditions when |
|
| 567 |
- // to trigger them. |
|
| 568 |
- Spec BuildConfigSpec `json:"spec"` |
|
| 569 |
- // Status holds any relevant information about a build config |
|
| 570 |
- Status BuildConfigStatus `json:"status"` |
|
| 571 |
-} |
|
| 572 |
- |
|
| 573 |
-// BuildConfigSpec describes when and how builds are created |
|
| 574 |
-type BuildConfigSpec struct {
|
|
| 575 |
- |
|
| 576 |
- // triggers determine how new Builds can be launched from a BuildConfig. If no triggers |
|
| 577 |
- // are defined, a new build can only occur as a result of an explicit client build creation. |
|
| 578 |
- Triggers []BuildTriggerPolicy `json:"triggers"` |
|
| 579 |
- |
|
| 580 |
- // RunPolicy describes how the new build created from this build |
|
| 581 |
- // configuration will be scheduled for execution. |
|
| 582 |
- // This is optional, if not specified we default to "Serial". |
|
| 583 |
- RunPolicy BuildRunPolicy `json:"runPolicy,omitempty"` |
|
| 584 |
- |
|
| 585 |
- // CommonSpec is the desired build specification |
|
| 586 |
- CommonSpec `json:",inline"` |
|
| 587 |
-} |
|
| 588 |
- |
|
| 589 |
-// BuildRunPolicy defines the behaviour of how the new builds are executed |
|
| 590 |
-// from the existing build configuration. |
|
| 591 |
-type BuildRunPolicy string |
|
| 592 |
- |
|
| 593 |
-const ( |
|
| 594 |
- // BuildRunPolicyParallel schedules new builds immediately after they are |
|
| 595 |
- // created. Builds will be executed in parallel. |
|
| 596 |
- BuildRunPolicyParallel BuildRunPolicy = "Parallel" |
|
| 597 |
- |
|
| 598 |
- // BuildRunPolicySerial schedules new builds to execute in a sequence as |
|
| 599 |
- // they are created. Every build gets queued up and will execute when the |
|
| 600 |
- // previous build completes. This is the default policy. |
|
| 601 |
- BuildRunPolicySerial BuildRunPolicy = "Serial" |
|
| 602 |
- |
|
| 603 |
- // BuildRunPolicySerialLatestOnly schedules only the latest build to execute, |
|
| 604 |
- // cancelling all the previously queued build. |
|
| 605 |
- BuildRunPolicySerialLatestOnly BuildRunPolicy = "SerialLatestOnly" |
|
| 606 |
-) |
|
| 607 |
- |
|
| 608 |
-// BuildConfigStatus contains current state of the build config object. |
|
| 609 |
-type BuildConfigStatus struct {
|
|
| 610 |
- // LastVersion is used to inform about number of last triggered build. |
|
| 611 |
- LastVersion int64 `json:"lastVersion"` |
|
| 612 |
-} |
|
| 613 |
- |
|
| 614 |
-// WebHookTrigger is a trigger that gets invoked using a webhook type of post |
|
| 615 |
-type WebHookTrigger struct {
|
|
| 616 |
- // Secret used to validate requests. |
|
| 617 |
- Secret string `json:"secret,omitempty"` |
|
| 618 |
-} |
|
| 619 |
- |
|
| 620 |
-// ImageChangeTrigger allows builds to be triggered when an ImageStream changes |
|
| 621 |
-type ImageChangeTrigger struct {
|
|
| 622 |
- // LastTriggeredImageID is used internally by the ImageChangeController to save last |
|
| 623 |
- // used image ID for build |
|
| 624 |
- LastTriggeredImageID string `json:"lastTriggeredImageID,omitempty"` |
|
| 625 |
- |
|
| 626 |
- // From is a reference to an ImageStreamTag that will trigger a build when updated |
|
| 627 |
- // It is optional. If no From is specified, the From image from the build strategy |
|
| 628 |
- // will be used. Only one ImageChangeTrigger with an empty From reference is allowed in |
|
| 629 |
- // a build configuration. |
|
| 630 |
- From *kapi.ObjectReference `json:"from,omitempty"` |
|
| 631 |
-} |
|
| 632 |
- |
|
| 633 |
-// BuildTriggerPolicy describes a policy for a single trigger that results in a new Build. |
|
| 634 |
-type BuildTriggerPolicy struct {
|
|
| 635 |
- // Type is the type of build trigger |
|
| 636 |
- Type BuildTriggerType `json:"type"` |
|
| 637 |
- |
|
| 638 |
- // GitHubWebHook contains the parameters for a GitHub webhook type of trigger |
|
| 639 |
- GitHubWebHook *WebHookTrigger `json:"github,omitempty"` |
|
| 640 |
- |
|
| 641 |
- // GenericWebHook contains the parameters for a Generic webhook type of trigger |
|
| 642 |
- GenericWebHook *WebHookTrigger `json:"generic,omitempty"` |
|
| 643 |
- |
|
| 644 |
- // ImageChange contains parameters for an ImageChange type of trigger |
|
| 645 |
- ImageChange *ImageChangeTrigger `json:"imageChange,omitempty"` |
|
| 646 |
-} |
|
| 647 |
- |
|
| 648 |
-// BuildTriggerType refers to a specific BuildTriggerPolicy implementation. |
|
| 649 |
-type BuildTriggerType string |
|
| 650 |
- |
|
| 651 |
-const ( |
|
| 652 |
- // GitHubWebHookBuildTriggerType represents a trigger that launches builds on |
|
| 653 |
- // GitHub webhook invocations |
|
| 654 |
- GitHubWebHookBuildTriggerType BuildTriggerType = "github" |
|
| 655 |
- |
|
| 656 |
- // GenericWebHookBuildTriggerType represents a trigger that launches builds on |
|
| 657 |
- // generic webhook invocations |
|
| 658 |
- GenericWebHookBuildTriggerType BuildTriggerType = "generic" |
|
| 659 |
- |
|
| 660 |
- // ImageChangeBuildTriggerType represents a trigger that launches builds on |
|
| 661 |
- // availability of a new version of an image |
|
| 662 |
- ImageChangeBuildTriggerType BuildTriggerType = "imageChange" |
|
| 663 |
- |
|
| 664 |
- // ConfigChangeBuildTriggerType will trigger a build on an initial build config creation |
|
| 665 |
- // WARNING: In the future the behavior will change to trigger a build on any config change |
|
| 666 |
- ConfigChangeBuildTriggerType BuildTriggerType = "ConfigChange" |
|
| 667 |
-) |
|
| 668 |
- |
|
| 669 |
-// BuildList is a collection of Builds. |
|
| 670 |
-type BuildList struct {
|
|
| 671 |
- unversioned.TypeMeta `json:",inline"` |
|
| 672 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 673 |
- Items []Build `json:"items"` |
|
| 674 |
-} |
|
| 675 |
- |
|
| 676 |
-// BuildConfigList is a collection of BuildConfigs. |
|
| 677 |
-type BuildConfigList struct {
|
|
| 678 |
- unversioned.TypeMeta `json:",inline"` |
|
| 679 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 680 |
- Items []BuildConfig `json:"items"` |
|
| 681 |
-} |
|
| 682 |
- |
|
| 683 |
-// GenericWebHookEvent is the payload expected for a generic webhook post |
|
| 684 |
-type GenericWebHookEvent struct {
|
|
| 685 |
- // Type is the type of source repository |
|
| 686 |
- Type BuildSourceType `json:"type,omitempty"` |
|
| 687 |
- |
|
| 688 |
- // Git is the git information if the Type is BuildSourceGit |
|
| 689 |
- Git *GitInfo `json:"git,omitempty"` |
|
| 690 |
-} |
|
| 691 |
- |
|
| 692 |
-// GitInfo is the aggregated git information for a generic webhook post |
|
| 693 |
-type GitInfo struct {
|
|
| 694 |
- GitBuildSource `json:",inline"` |
|
| 695 |
- GitSourceRevision `json:",inline"` |
|
| 696 |
-} |
|
| 697 |
- |
|
| 698 |
-// BuildLog is the (unused) resource associated with the build log redirector |
|
| 699 |
-type BuildLog struct {
|
|
| 700 |
- unversioned.TypeMeta `json:",inline"` |
|
| 701 |
-} |
|
| 702 |
- |
|
| 703 |
-// BuildRequest is the resource used to pass parameters to build generator |
|
| 704 |
-type BuildRequest struct {
|
|
| 705 |
- unversioned.TypeMeta `json:",inline"` |
|
| 706 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 707 |
- |
|
| 708 |
- // Revision is the information from the source for a specific repo snapshot. |
|
| 709 |
- Revision *SourceRevision `json:"revision,omitempty"` |
|
| 710 |
- |
|
| 711 |
- // TriggeredByImage is the Image that triggered this build. |
|
| 712 |
- TriggeredByImage *kapi.ObjectReference `json:"triggeredByImage,omitempty"` |
|
| 713 |
- |
|
| 714 |
- // From is the reference to the ImageStreamTag that triggered the build. |
|
| 715 |
- From *kapi.ObjectReference `json:"from,omitempty"` |
|
| 716 |
- |
|
| 717 |
- // Binary indicates a request to build from a binary provided to the builder |
|
| 718 |
- Binary *BinaryBuildSource `json:"binary,omitempty"` |
|
| 719 |
- |
|
| 720 |
- // LastVersion (optional) is the LastVersion of the BuildConfig that was used |
|
| 721 |
- // to generate the build. If the BuildConfig in the generator doesn't match, a build will |
|
| 722 |
- // not be generated. |
|
| 723 |
- LastVersion *int64 `json:"lastVersion,omitempty"` |
|
| 724 |
- |
|
| 725 |
- // Env contains additional environment variables you want to pass into a builder container |
|
| 726 |
- Env []kapi.EnvVar `json:"env,omitempty"` |
|
| 727 |
- |
|
| 728 |
- // TriggeredBy describes which triggers started the most recent update to the |
|
| 729 |
- // buildconfig and contains information about those triggers. |
|
| 730 |
- TriggeredBy []BuildTriggerCause `json:"triggeredBy"` |
|
| 731 |
-} |
|
| 732 |
- |
|
| 733 |
-// BinaryBuildRequestOptions are the options required to fully speficy a binary build request |
|
| 734 |
-type BinaryBuildRequestOptions struct {
|
|
| 735 |
- unversioned.TypeMeta `json:",inline"` |
|
| 736 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 737 |
- |
|
| 738 |
- AsFile string `json:"asFile,omitempty"` |
|
| 739 |
- |
|
| 740 |
- // Commit is the value identifying a specific commit |
|
| 741 |
- Commit string `json:"revision.commit,omitempty"` |
|
| 742 |
- |
|
| 743 |
- // Message is the description of a specific commit |
|
| 744 |
- Message string `json:"revision.message,omitempty"` |
|
| 745 |
- |
|
| 746 |
- // AuthorName of the source control user |
|
| 747 |
- AuthorName string `json:"revision.authorName,omitempty"` |
|
| 748 |
- |
|
| 749 |
- // AuthorEmail of the source control user |
|
| 750 |
- AuthorEmail string `json:"revision.authorEmail,omitempty"` |
|
| 751 |
- |
|
| 752 |
- // CommitterName of the source control user |
|
| 753 |
- CommitterName string `json:"revision.committerName,omitempty"` |
|
| 754 |
- |
|
| 755 |
- // CommitterEmail of the source control user |
|
| 756 |
- CommitterEmail string `json:"revision.committerEmail,omitempty"` |
|
| 757 |
-} |
|
| 758 |
- |
|
| 759 |
-// BuildLogOptions is the REST options for a build log |
|
| 760 |
-type BuildLogOptions struct {
|
|
| 761 |
- unversioned.TypeMeta |
|
| 762 |
- |
|
| 763 |
- // The container for which to stream logs. Defaults to only container if there is one container in the pod. |
|
| 764 |
- Container string `json:"container,omitempty"` |
|
| 765 |
- // Follow if true indicates that the build log should be streamed until |
|
| 766 |
- // the build terminates. |
|
| 767 |
- Follow bool `json:"follow,omitempty"` |
|
| 768 |
- // Return previous build logs. Defaults to false. |
|
| 769 |
- Previous bool `json:"previous,omitempty"` |
|
| 770 |
- // A relative time in seconds before the current time from which to show logs. If this value |
|
| 771 |
- // precedes the time a pod was started, only logs since the pod start will be returned. |
|
| 772 |
- // If this value is in the future, no logs will be returned. |
|
| 773 |
- // Only one of sinceSeconds or sinceTime may be specified. |
|
| 774 |
- SinceSeconds *int64 `json:"sinceSeconds,omitempty"` |
|
| 775 |
- // An RFC3339 timestamp from which to show logs. If this value |
|
| 776 |
- // precedes the time a pod was started, only logs since the pod start will be returned. |
|
| 777 |
- // If this value is in the future, no logs will be returned. |
|
| 778 |
- // Only one of sinceSeconds or sinceTime may be specified. |
|
| 779 |
- SinceTime *unversioned.Time `json:"sinceTime,omitempty"` |
|
| 780 |
- // If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line |
|
| 781 |
- // of log output. Defaults to false. |
|
| 782 |
- Timestamps bool `json:"timestamps,omitempty"` |
|
| 783 |
- // If set, the number of lines from the end of the logs to show. If not specified, |
|
| 784 |
- // logs are shown from the creation of the container or sinceSeconds or sinceTime |
|
| 785 |
- TailLines *int64 `json:"tailLines,omitempty"` |
|
| 786 |
- // If set, the number of bytes to read from the server before terminating the |
|
| 787 |
- // log output. This may not display a complete final line of logging, and may return |
|
| 788 |
- // slightly more or slightly less than the specified limit. |
|
| 789 |
- LimitBytes *int64 `json:"limitBytes,omitempty"` |
|
| 790 |
- |
|
| 791 |
- // NoWait if true causes the call to return immediately even if the build |
|
| 792 |
- // is not available yet. Otherwise the server will wait until the build has started. |
|
| 793 |
- NoWait bool `json:"nowait,omitempty"` |
|
| 794 |
- |
|
| 795 |
- // Version of the build for which to view logs. |
|
| 796 |
- Version *int64 `json:"version,omitempty"` |
|
| 797 |
-} |
|
| 798 |
- |
|
| 799 |
-// SecretSpec specifies a secret to be included in a build pod and its corresponding mount point |
|
| 800 |
-type SecretSpec struct {
|
|
| 801 |
- // SecretSource is a reference to the secret |
|
| 802 |
- SecretSource kapi.LocalObjectReference `json:"secretSource"` |
|
| 803 |
- |
|
| 804 |
- // MountPath is the path at which to mount the secret |
|
| 805 |
- MountPath string `json:"mountPath"` |
|
| 806 |
-} |
| ... | ... |
@@ -17,11 +17,6 @@ type DiscoveryClient struct {
|
| 17 | 17 |
|
| 18 | 18 |
// ServerResourcesForGroupVersion returns the supported resources for a group and version. |
| 19 | 19 |
func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (resources *unversioned.APIResourceList, err error) {
|
| 20 |
- // we don't expose this version |
|
| 21 |
- if groupVersion == "v1beta3" {
|
|
| 22 |
- return &unversioned.APIResourceList{}, nil
|
|
| 23 |
- } |
|
| 24 |
- |
|
| 25 | 20 |
parentList, err := d.DiscoveryClient.ServerResourcesForGroupVersion(groupVersion) |
| 26 | 21 |
if err != nil {
|
| 27 | 22 |
return parentList, err |
| ... | ... |
@@ -44,10 +44,7 @@ to generate the API structure for a template to which you can add parameters and |
| 44 | 44 |
%[1]s export service --as-template=test |
| 45 | 45 |
|
| 46 | 46 |
# export to JSON |
| 47 |
- %[1]s export service -o json |
|
| 48 |
- |
|
| 49 |
- # convert a file on disk to the latest API version (in YAML, the default) |
|
| 50 |
- %[1]s export -f a_v1beta3_service.json --output-version=v1 --exact` |
|
| 47 |
+ %[1]s export service -o json` |
|
| 51 | 48 |
) |
| 52 | 49 |
|
| 53 | 50 |
func NewCmdExport(fullName string, f *clientcmd.Factory, in io.Reader, out io.Writer) *cobra.Command {
|
| ... | ... |
@@ -612,8 +612,8 @@ saved copy to include the latest resource version.` |
| 612 | 612 |
# Use an alternative editor |
| 613 | 613 |
OC_EDITOR="nano" %[1]s edit dc/my-deployment |
| 614 | 614 |
|
| 615 |
- # Edit the service 'docker-registry' in JSON using the v1beta3 API format: |
|
| 616 |
- %[1]s edit svc/docker-registry --output-version=v1beta3 -o json` |
|
| 615 |
+ # Edit the service 'docker-registry' in JSON using the v1 API format: |
|
| 616 |
+ %[1]s edit svc/docker-registry --output-version=v1 -o json` |
|
| 617 | 617 |
) |
| 618 | 618 |
|
| 619 | 619 |
// NewCmdEdit is a wrapper for the Kubernetes cli edit command |
| ... | ... |
@@ -234,7 +234,7 @@ func TestProjectStatus(t *testing.T) {
|
| 234 | 234 |
"sinatra-app-example-b deploys", |
| 235 | 235 |
"on docker.io/centos/ruby-22-centos7:latest", |
| 236 | 236 |
"build #1 running for about a minute", |
| 237 |
- "- 7a4f354: Prepare v1beta3 Template types (Roy Programmer <someguy@outhere.com>)", |
|
| 237 |
+ "- 7a4f354: Prepare v1 Template types (Roy Programmer <someguy@outhere.com>)", |
|
| 238 | 238 |
"View details with 'oc describe <resource>/<name>' or list everything with 'oc get all'.", |
| 239 | 239 |
}, |
| 240 | 240 |
Time: mustParseTime("2015-04-06T21:20:03Z"),
|
| ... | ... |
@@ -7,7 +7,7 @@ items: |
| 7 | 7 |
name: ruby-hello-world |
| 8 | 8 |
namespace: default |
| 9 | 9 |
resourceVersion: "1125" |
| 10 |
- selfLink: /osapi/v1beta3/namespaces/default/buildconfigs/ruby-hello-world |
|
| 10 |
+ selfLink: /osapi/v1/namespaces/default/buildconfigs/ruby-hello-world |
|
| 11 | 11 |
uid: 4a10e762-3064-11e5-8da2-080027c5bfa9 |
| 12 | 12 |
spec: |
| 13 | 13 |
output: |
| ... | ... |
@@ -49,7 +49,7 @@ items: |
| 49 | 49 |
name: ruby-sample-build |
| 50 | 50 |
namespace: test |
| 51 | 51 |
resourceVersion: "9848" |
| 52 |
- selfLink: /osapi/v1beta3/namespaces/test/buildconfigs/ruby-sample-build |
|
| 52 |
+ selfLink: /osapi/v1/namespaces/test/buildconfigs/ruby-sample-build |
|
| 53 | 53 |
uid: 5f52f442-31d7-11e5-868e-080027c5bfa9 |
| 54 | 54 |
spec: |
| 55 | 55 |
output: |
| ... | ... |
@@ -88,7 +88,7 @@ items: |
| 88 | 88 |
name: ruby-sample-build-invalidtag |
| 89 | 89 |
namespace: test |
| 90 | 90 |
resourceVersion: "1605" |
| 91 |
- selfLink: /osapi/v1beta3/namespaces/test/buildconfigs/ruby-sample-build-invalidtag |
|
| 91 |
+ selfLink: /osapi/v1/namespaces/test/buildconfigs/ruby-sample-build-invalidtag |
|
| 92 | 92 |
uid: 4a633dd5-306a-11e5-8da2-080027c5bfa9 |
| 93 | 93 |
spec: |
| 94 | 94 |
output: |
| ... | ... |
@@ -120,7 +120,7 @@ items: |
| 120 | 120 |
name: ruby-sample-build-validtag |
| 121 | 121 |
namespace: test |
| 122 | 122 |
resourceVersion: "1604" |
| 123 |
- selfLink: /osapi/v1beta3/namespaces/test/buildconfigs/ruby-sample-build-validtag |
|
| 123 |
+ selfLink: /osapi/v1/namespaces/test/buildconfigs/ruby-sample-build-validtag |
|
| 124 | 124 |
uid: 4a623b89-306a-11e5-8da2-080027c5bfa9 |
| 125 | 125 |
spec: |
| 126 | 126 |
output: |
| ... | ... |
@@ -7,7 +7,7 @@ items: |
| 7 | 7 |
name: ruby-hello-world |
| 8 | 8 |
namespace: test |
| 9 | 9 |
resourceVersion: "1125" |
| 10 |
- selfLink: /osapi/v1beta3/namespaces/test/buildconfigs/ruby-hello-world |
|
| 10 |
+ selfLink: /osapi/v1/namespaces/test/buildconfigs/ruby-hello-world |
|
| 11 | 11 |
uid: 4a10e762-3064-11e5-8da2-080027c5bfa9 |
| 12 | 12 |
spec: |
| 13 | 13 |
output: |
| ... | ... |
@@ -47,7 +47,7 @@ items: |
| 47 | 47 |
name: ruby-sample-build |
| 48 | 48 |
namespace: test |
| 49 | 49 |
resourceVersion: "9848" |
| 50 |
- selfLink: /osapi/v1beta3/namespaces/test/buildconfigs/ruby-sample-build |
|
| 50 |
+ selfLink: /osapi/v1/namespaces/test/buildconfigs/ruby-sample-build |
|
| 51 | 51 |
uid: 5f52f442-31d7-11e5-868e-080027c5bfa9 |
| 52 | 52 |
spec: |
| 53 | 53 |
output: |
| ... | ... |
@@ -84,7 +84,7 @@ items: |
| 84 | 84 |
name: ruby-sample-build-invalidtag |
| 85 | 85 |
namespace: test |
| 86 | 86 |
resourceVersion: "1605" |
| 87 |
- selfLink: /osapi/v1beta3/namespaces/test/buildconfigs/ruby-sample-build-invalidtag |
|
| 87 |
+ selfLink: /osapi/v1/namespaces/test/buildconfigs/ruby-sample-build-invalidtag |
|
| 88 | 88 |
uid: 4a633dd5-306a-11e5-8da2-080027c5bfa9 |
| 89 | 89 |
spec: |
| 90 | 90 |
output: |
| ... | ... |
@@ -116,7 +116,7 @@ items: |
| 116 | 116 |
name: ruby-sample-build-validtag |
| 117 | 117 |
namespace: test |
| 118 | 118 |
resourceVersion: "1604" |
| 119 |
- selfLink: /osapi/v1beta3/namespaces/test/buildconfigs/ruby-sample-build-validtag |
|
| 119 |
+ selfLink: /osapi/v1/namespaces/test/buildconfigs/ruby-sample-build-validtag |
|
| 120 | 120 |
uid: 4a623b89-306a-11e5-8da2-080027c5bfa9 |
| 121 | 121 |
spec: |
| 122 | 122 |
output: |
| ... | ... |
@@ -328,7 +328,7 @@ func (KubeletConnectionInfo) SwaggerDoc() map[string]string {
|
| 328 | 328 |
|
| 329 | 329 |
var map_KubernetesMasterConfig = map[string]string{
|
| 330 | 330 |
"": "KubernetesMasterConfig holds the necessary configuration options for the Kubernetes master", |
| 331 |
- "apiLevels": "APILevels is a list of API levels that should be enabled on startup: v1beta3 and v1 as examples", |
|
| 331 |
+ "apiLevels": "APILevels is a list of API levels that should be enabled on startup: v1 as examples", |
|
| 332 | 332 |
"disabledAPIGroupVersions": "DisabledAPIGroupVersions is a map of groups to the versions (or *) that should be disabled.", |
| 333 | 333 |
"masterIP": "MasterIP is the public IP address of kubernetes stuff. If empty, the first result from net.InterfaceAddrs will be used.", |
| 334 | 334 |
"masterCount": "MasterCount is the number of expected masters that should be running. This value defaults to 1 and may be set to a positive integer, or if set to -1, indicates this is part of a cluster.", |
| ... | ... |
@@ -427,7 +427,7 @@ var map_MasterConfig = map[string]string{
|
| 427 | 427 |
"": "MasterConfig holds the necessary configuration options for the OpenShift master", |
| 428 | 428 |
"servingInfo": "ServingInfo describes how to start serving", |
| 429 | 429 |
"corsAllowedOrigins": "CORSAllowedOrigins", |
| 430 |
- "apiLevels": "APILevels is a list of API levels that should be enabled on startup: v1beta3 and v1 as examples", |
|
| 430 |
+ "apiLevels": "APILevels is a list of API levels that should be enabled on startup: v1 as examples", |
|
| 431 | 431 |
"masterPublicURL": "MasterPublicURL is how clients can access the OpenShift API server", |
| 432 | 432 |
"controllers": "Controllers is a list of the controllers that should be started. If set to \"none\", no controllers will start automatically. The default value is \"*\" which will start all controllers. When using \"*\", you may exclude controllers by prepending a \"-\" in front of their name. No other values are recognized at this time.", |
| 433 | 433 |
"pauseControllers": "PauseControllers instructs the master to not automatically start controllers, but instead to wait until a notification to the server is received before launching them.", |
| ... | ... |
@@ -154,7 +154,7 @@ type MasterConfig struct {
|
| 154 | 154 |
// CORSAllowedOrigins |
| 155 | 155 |
CORSAllowedOrigins []string `json:"corsAllowedOrigins"` |
| 156 | 156 |
|
| 157 |
- // APILevels is a list of API levels that should be enabled on startup: v1beta3 and v1 as examples |
|
| 157 |
+ // APILevels is a list of API levels that should be enabled on startup: v1 as examples |
|
| 158 | 158 |
APILevels []string `json:"apiLevels"` |
| 159 | 159 |
|
| 160 | 160 |
// MasterPublicURL is how clients can access the OpenShift API server |
| ... | ... |
@@ -926,7 +926,7 @@ type EtcdConfig struct {
|
| 926 | 926 |
|
| 927 | 927 |
// KubernetesMasterConfig holds the necessary configuration options for the Kubernetes master |
| 928 | 928 |
type KubernetesMasterConfig struct {
|
| 929 |
- // APILevels is a list of API levels that should be enabled on startup: v1beta3 and v1 as examples |
|
| 929 |
+ // APILevels is a list of API levels that should be enabled on startup: v1 as examples |
|
| 930 | 930 |
APILevels []string `json:"apiLevels"` |
| 931 | 931 |
// DisabledAPIGroupVersions is a map of groups to the versions (or *) that should be disabled. |
| 932 | 932 |
DisabledAPIGroupVersions map[string][]string `json:"disabledAPIGroupVersions"` |
| ... | ... |
@@ -116,20 +116,17 @@ import ( |
| 116 | 116 |
) |
| 117 | 117 |
|
| 118 | 118 |
const ( |
| 119 |
- LegacyOpenShiftAPIPrefix = "/osapi" // TODO: make configurable |
|
| 120 |
- OpenShiftAPIPrefix = "/oapi" // TODO: make configurable |
|
| 121 |
- KubernetesAPIPrefix = "/api" // TODO: make configurable |
|
| 122 |
- KubernetesAPIGroupPrefix = "/apis" // TODO: make configurable |
|
| 123 |
- OpenShiftAPIV1Beta3 = "v1beta3" |
|
| 124 |
- OpenShiftAPIV1 = "v1" |
|
| 125 |
- OpenShiftAPIPrefixV1Beta3 = LegacyOpenShiftAPIPrefix + "/" + OpenShiftAPIV1Beta3 |
|
| 126 |
- OpenShiftAPIPrefixV1 = OpenShiftAPIPrefix + "/" + OpenShiftAPIV1 |
|
| 127 |
- swaggerAPIPrefix = "/swaggerapi/" |
|
| 119 |
+ LegacyOpenShiftAPIPrefix = "/osapi" // TODO: make configurable |
|
| 120 |
+ OpenShiftAPIPrefix = "/oapi" // TODO: make configurable |
|
| 121 |
+ KubernetesAPIPrefix = "/api" // TODO: make configurable |
|
| 122 |
+ KubernetesAPIGroupPrefix = "/apis" // TODO: make configurable |
|
| 123 |
+ OpenShiftAPIV1 = "v1" |
|
| 124 |
+ OpenShiftAPIPrefixV1 = OpenShiftAPIPrefix + "/" + OpenShiftAPIV1 |
|
| 125 |
+ swaggerAPIPrefix = "/swaggerapi/" |
|
| 128 | 126 |
) |
| 129 | 127 |
|
| 130 | 128 |
var ( |
| 131 |
- excludedV1Beta3Types = sets.NewString() |
|
| 132 |
- excludedV1Types = excludedV1Beta3Types |
|
| 129 |
+ excludedV1Types = sets.NewString() |
|
| 133 | 130 |
|
| 134 | 131 |
// TODO: correctly solve identifying requests by type |
| 135 | 132 |
longRunningRE = regexp.MustCompile("watch|proxy|logs?|exec|portforward|attach")
|
| ... | ... |
@@ -328,8 +325,6 @@ func (c *MasterConfig) InstallProtectedAPI(container *restful.Container) ([]stri |
| 328 | 328 |
switch service.RootPath() {
|
| 329 | 329 |
case "/": |
| 330 | 330 |
root = service |
| 331 |
- case OpenShiftAPIPrefixV1Beta3: |
|
| 332 |
- service.Doc("OpenShift REST API, version v1beta3").ApiVersion("v1beta3")
|
|
| 333 | 331 |
case OpenShiftAPIPrefixV1: |
| 334 | 332 |
service.Doc("OpenShift REST API, version v1").ApiVersion("v1")
|
| 335 | 333 |
} |
| ... | ... |
@@ -8,7 +8,7 @@ import ( |
| 8 | 8 |
|
| 9 | 9 |
func TestInitializeOpenshiftAPIVersionRouteHandler(t *testing.T) {
|
| 10 | 10 |
service := new(restful.WebService) |
| 11 |
- initAPIVersionRoute(service, "osapi", "v1beta3") |
|
| 11 |
+ initAPIVersionRoute(service, "oapi", "v1") |
|
| 12 | 12 |
|
| 13 | 13 |
if len(service.Routes()) != 1 {
|
| 14 | 14 |
t.Fatalf("Exp. the OSAPI route but found none")
|
| ... | ... |
@@ -6,11 +6,11 @@ import ( |
| 6 | 6 |
"reflect" |
| 7 | 7 |
"testing" |
| 8 | 8 |
|
| 9 |
+ "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 9 | 10 |
"k8s.io/kubernetes/pkg/client/restclient" |
| 10 | 11 |
"k8s.io/kubernetes/pkg/util/sets" |
| 11 | 12 |
|
| 12 | 13 |
"github.com/openshift/origin/pkg/api/v1" |
| 13 |
- "github.com/openshift/origin/pkg/api/v1beta3" |
|
| 14 | 14 |
"github.com/openshift/origin/pkg/client" |
| 15 | 15 |
) |
| 16 | 16 |
|
| ... | ... |
@@ -98,14 +98,10 @@ func TestClientConfigForVersion(t *testing.T) {
|
| 98 | 98 |
t.Fatalf("Expected not be called again getting a config from cache, was called %d additional times", called)
|
| 99 | 99 |
} |
| 100 | 100 |
|
| 101 |
- // Call for unsupported version, negotiate to supported version |
|
| 101 |
+ // Call for removed version, return error |
|
| 102 | 102 |
called = 0 |
| 103 |
- v1beta3Config, err := clients.ClientConfigForVersion(&v1beta3.SchemeGroupVersion) |
|
| 104 |
- if err != nil {
|
|
| 105 |
- t.Fatalf("Unexpected error: %v", err)
|
|
| 106 |
- } |
|
| 107 |
- if v1beta3Config.GroupVersion.String() != "v1" {
|
|
| 108 |
- t.Fatalf("Expected to negotiate v1 for v1beta3 config, got %v", v1beta3Config.GroupVersion.String())
|
|
| 103 |
+ if _, err := clients.ClientConfigForVersion(&unversioned.GroupVersion{Version: "v1beta3"}); err == nil {
|
|
| 104 |
+ t.Fatalf("Unexpected non-error: %v", err)
|
|
| 109 | 105 |
} |
| 110 | 106 |
if called != 1 {
|
| 111 | 107 |
t.Fatalf("Expected to be called once getting a config for a new version, was called %d times", called)
|
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/openshift/origin/pkg/deploy/api" |
| 17 | 17 |
"github.com/openshift/origin/pkg/deploy/api/v1" |
| 18 |
- "github.com/openshift/origin/pkg/deploy/api/v1beta3" |
|
| 19 | 18 |
) |
| 20 | 19 |
|
| 21 | 20 |
const importPrefix = "github.com/openshift/origin/pkg/deploy/api" |
| ... | ... |
@@ -23,7 +22,7 @@ const importPrefix = "github.com/openshift/origin/pkg/deploy/api" |
| 23 | 23 |
var accessor = meta.NewAccessor() |
| 24 | 24 |
|
| 25 | 25 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 26 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 26 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
|
| 27 | 27 |
|
| 28 | 28 |
func init() {
|
| 29 | 29 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -81,8 +80,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 81 | 81 |
switch v {
|
| 82 | 82 |
case v1.SchemeGroupVersion: |
| 83 | 83 |
v1.AddToScheme(kapi.Scheme) |
| 84 |
- case v1beta3.SchemeGroupVersion: |
|
| 85 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 86 | 84 |
|
| 87 | 85 |
default: |
| 88 | 86 |
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
| ... | ... |
@@ -105,12 +102,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 105 | 105 |
MetadataAccessor: accessor, |
| 106 | 106 |
}, nil |
| 107 | 107 |
|
| 108 |
- case v1beta3.SchemeGroupVersion: |
|
| 109 |
- return &meta.VersionInterfaces{
|
|
| 110 |
- ObjectConvertor: kapi.Scheme, |
|
| 111 |
- MetadataAccessor: accessor, |
|
| 112 |
- }, nil |
|
| 113 |
- |
|
| 114 | 108 |
default: |
| 115 | 109 |
g, _ := registered.Group(api.GroupName) |
| 116 | 110 |
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
| 117 | 111 |
deleted file mode 100644 |
| ... | ... |
@@ -1,137 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "fmt" |
|
| 5 |
- "math" |
|
| 6 |
- "strings" |
|
| 7 |
- |
|
| 8 |
- "k8s.io/kubernetes/pkg/conversion" |
|
| 9 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 10 |
- "k8s.io/kubernetes/pkg/util/intstr" |
|
| 11 |
- |
|
| 12 |
- newer "github.com/openshift/origin/pkg/deploy/api" |
|
| 13 |
- imageapi "github.com/openshift/origin/pkg/image/api" |
|
| 14 |
-) |
|
| 15 |
- |
|
| 16 |
-func Convert_v1beta3_DeploymentTriggerImageChangeParams_To_api_DeploymentTriggerImageChangeParams(in *DeploymentTriggerImageChangeParams, out *newer.DeploymentTriggerImageChangeParams, s conversion.Scope) error {
|
|
| 17 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 18 |
- return err |
|
| 19 |
- } |
|
| 20 |
- switch in.From.Kind {
|
|
| 21 |
- case "ImageStreamTag": |
|
| 22 |
- case "ImageStream", "ImageRepository": |
|
| 23 |
- out.From.Kind = "ImageStreamTag" |
|
| 24 |
- if !strings.Contains(out.From.Name, ":") {
|
|
| 25 |
- out.From.Name = imageapi.JoinImageStreamTag(out.From.Name, imageapi.DefaultImageTag) |
|
| 26 |
- } |
|
| 27 |
- default: |
|
| 28 |
- // Will be handled by validation |
|
| 29 |
- } |
|
| 30 |
- return nil |
|
| 31 |
-} |
|
| 32 |
- |
|
| 33 |
-func Convert_api_DeploymentTriggerImageChangeParams_To_v1beta3_DeploymentTriggerImageChangeParams(in *newer.DeploymentTriggerImageChangeParams, out *DeploymentTriggerImageChangeParams, s conversion.Scope) error {
|
|
| 34 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 35 |
- return err |
|
| 36 |
- } |
|
| 37 |
- switch in.From.Kind {
|
|
| 38 |
- case "ImageStreamTag": |
|
| 39 |
- case "ImageStream", "ImageRepository": |
|
| 40 |
- out.From.Kind = "ImageStreamTag" |
|
| 41 |
- if !strings.Contains(out.From.Name, ":") {
|
|
| 42 |
- out.From.Name = imageapi.JoinImageStreamTag(out.From.Name, imageapi.DefaultImageTag) |
|
| 43 |
- } |
|
| 44 |
- default: |
|
| 45 |
- // Will be handled by validation |
|
| 46 |
- } |
|
| 47 |
- return nil |
|
| 48 |
-} |
|
| 49 |
- |
|
| 50 |
-func Convert_v1beta3_RollingDeploymentStrategyParams_To_api_RollingDeploymentStrategyParams(in *RollingDeploymentStrategyParams, out *newer.RollingDeploymentStrategyParams, s conversion.Scope) error {
|
|
| 51 |
- out.UpdatePeriodSeconds = in.UpdatePeriodSeconds |
|
| 52 |
- out.IntervalSeconds = in.IntervalSeconds |
|
| 53 |
- out.TimeoutSeconds = in.TimeoutSeconds |
|
| 54 |
- out.UpdatePercent = in.UpdatePercent |
|
| 55 |
- |
|
| 56 |
- if in.Pre != nil {
|
|
| 57 |
- if err := s.Convert(&in.Pre, &out.Pre, 0); err != nil {
|
|
| 58 |
- return err |
|
| 59 |
- } |
|
| 60 |
- } |
|
| 61 |
- if in.Post != nil {
|
|
| 62 |
- if err := s.Convert(&in.Post, &out.Post, 0); err != nil {
|
|
| 63 |
- return err |
|
| 64 |
- } |
|
| 65 |
- } |
|
| 66 |
- |
|
| 67 |
- if in.UpdatePercent != nil {
|
|
| 68 |
- pct := intstr.FromString(fmt.Sprintf("%d%%", int(math.Abs(float64(*in.UpdatePercent)))))
|
|
| 69 |
- if *in.UpdatePercent > 0 {
|
|
| 70 |
- out.MaxSurge = pct |
|
| 71 |
- } else {
|
|
| 72 |
- out.MaxUnavailable = pct |
|
| 73 |
- } |
|
| 74 |
- } else {
|
|
| 75 |
- if err := s.Convert(in.MaxUnavailable, &out.MaxUnavailable, 0); err != nil {
|
|
| 76 |
- return err |
|
| 77 |
- } |
|
| 78 |
- if err := s.Convert(in.MaxSurge, &out.MaxSurge, 0); err != nil {
|
|
| 79 |
- return err |
|
| 80 |
- } |
|
| 81 |
- } |
|
| 82 |
- return nil |
|
| 83 |
-} |
|
| 84 |
- |
|
| 85 |
-func Convert_api_RollingDeploymentStrategyParams_To_v1beta3_RollingDeploymentStrategyParams(in *newer.RollingDeploymentStrategyParams, out *RollingDeploymentStrategyParams, s conversion.Scope) error {
|
|
| 86 |
- out.UpdatePeriodSeconds = in.UpdatePeriodSeconds |
|
| 87 |
- out.IntervalSeconds = in.IntervalSeconds |
|
| 88 |
- out.TimeoutSeconds = in.TimeoutSeconds |
|
| 89 |
- out.UpdatePercent = in.UpdatePercent |
|
| 90 |
- |
|
| 91 |
- if in.Pre != nil {
|
|
| 92 |
- if err := s.Convert(&in.Pre, &out.Pre, 0); err != nil {
|
|
| 93 |
- return err |
|
| 94 |
- } |
|
| 95 |
- } |
|
| 96 |
- if in.Post != nil {
|
|
| 97 |
- if err := s.Convert(&in.Post, &out.Post, 0); err != nil {
|
|
| 98 |
- return err |
|
| 99 |
- } |
|
| 100 |
- } |
|
| 101 |
- |
|
| 102 |
- if out.MaxUnavailable == nil {
|
|
| 103 |
- out.MaxUnavailable = &intstr.IntOrString{}
|
|
| 104 |
- } |
|
| 105 |
- if out.MaxSurge == nil {
|
|
| 106 |
- out.MaxSurge = &intstr.IntOrString{}
|
|
| 107 |
- } |
|
| 108 |
- if in.UpdatePercent != nil {
|
|
| 109 |
- pct := intstr.FromString(fmt.Sprintf("%d%%", int(math.Abs(float64(*in.UpdatePercent)))))
|
|
| 110 |
- if *in.UpdatePercent > 0 {
|
|
| 111 |
- out.MaxSurge = &pct |
|
| 112 |
- } else {
|
|
| 113 |
- out.MaxUnavailable = &pct |
|
| 114 |
- } |
|
| 115 |
- } else {
|
|
| 116 |
- if err := s.Convert(&in.MaxUnavailable, out.MaxUnavailable, 0); err != nil {
|
|
| 117 |
- return err |
|
| 118 |
- } |
|
| 119 |
- if err := s.Convert(&in.MaxSurge, out.MaxSurge, 0); err != nil {
|
|
| 120 |
- return err |
|
| 121 |
- } |
|
| 122 |
- } |
|
| 123 |
- return nil |
|
| 124 |
-} |
|
| 125 |
- |
|
| 126 |
-func addConversionFuncs(scheme *runtime.Scheme) {
|
|
| 127 |
- err := scheme.AddConversionFuncs( |
|
| 128 |
- Convert_v1beta3_DeploymentTriggerImageChangeParams_To_api_DeploymentTriggerImageChangeParams, |
|
| 129 |
- Convert_api_DeploymentTriggerImageChangeParams_To_v1beta3_DeploymentTriggerImageChangeParams, |
|
| 130 |
- |
|
| 131 |
- Convert_v1beta3_RollingDeploymentStrategyParams_To_api_RollingDeploymentStrategyParams, |
|
| 132 |
- Convert_api_RollingDeploymentStrategyParams_To_v1beta3_RollingDeploymentStrategyParams, |
|
| 133 |
- ) |
|
| 134 |
- if err != nil {
|
|
| 135 |
- panic(err) |
|
| 136 |
- } |
|
| 137 |
-} |
| 138 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,215 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "reflect" |
|
| 5 |
- "testing" |
|
| 6 |
- |
|
| 7 |
- kapi "k8s.io/kubernetes/pkg/api" |
|
| 8 |
- kapiv1beta3 "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 9 |
- "k8s.io/kubernetes/pkg/util/diff" |
|
| 10 |
- "k8s.io/kubernetes/pkg/util/intstr" |
|
| 11 |
- |
|
| 12 |
- newer "github.com/openshift/origin/pkg/deploy/api" |
|
| 13 |
-) |
|
| 14 |
- |
|
| 15 |
-func TestTriggerRoundTrip(t *testing.T) {
|
|
| 16 |
- tests := []struct {
|
|
| 17 |
- testName string |
|
| 18 |
- kind, name string |
|
| 19 |
- }{
|
|
| 20 |
- {
|
|
| 21 |
- testName: "ImageStream -> ImageStreamTag", |
|
| 22 |
- kind: "ImageStream", |
|
| 23 |
- name: "golang", |
|
| 24 |
- }, |
|
| 25 |
- {
|
|
| 26 |
- testName: "ImageStreamTag -> ImageStreamTag", |
|
| 27 |
- kind: "ImageStreamTag", |
|
| 28 |
- name: "golang:latest", |
|
| 29 |
- }, |
|
| 30 |
- {
|
|
| 31 |
- testName: "ImageRepository -> ImageStreamTag", |
|
| 32 |
- kind: "ImageRepository", |
|
| 33 |
- name: "golang", |
|
| 34 |
- }, |
|
| 35 |
- } |
|
| 36 |
- |
|
| 37 |
- for _, test := range tests {
|
|
| 38 |
- p := DeploymentTriggerImageChangeParams{
|
|
| 39 |
- From: kapiv1beta3.ObjectReference{
|
|
| 40 |
- Kind: test.kind, |
|
| 41 |
- Name: test.name, |
|
| 42 |
- }, |
|
| 43 |
- } |
|
| 44 |
- out := &newer.DeploymentTriggerImageChangeParams{}
|
|
| 45 |
- if err := kapi.Scheme.Convert(&p, out); err != nil {
|
|
| 46 |
- t.Errorf("%s: unexpected error: %v", test.testName, err)
|
|
| 47 |
- } |
|
| 48 |
- if out.From.Name != "golang:latest" {
|
|
| 49 |
- t.Errorf("%s: unexpected name: %s", test.testName, out.From.Name)
|
|
| 50 |
- } |
|
| 51 |
- if out.From.Kind != "ImageStreamTag" {
|
|
| 52 |
- t.Errorf("%s: unexpected kind: %s", test.testName, out.From.Kind)
|
|
| 53 |
- } |
|
| 54 |
- } |
|
| 55 |
-} |
|
| 56 |
- |
|
| 57 |
-func Test_convert_v1beta3_RollingDeploymentStrategyParams_To_api_RollingDeploymentStrategyParams(t *testing.T) {
|
|
| 58 |
- tests := []struct {
|
|
| 59 |
- in *RollingDeploymentStrategyParams |
|
| 60 |
- out *newer.RollingDeploymentStrategyParams |
|
| 61 |
- }{
|
|
| 62 |
- {
|
|
| 63 |
- in: &RollingDeploymentStrategyParams{
|
|
| 64 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 65 |
- IntervalSeconds: newInt64(6), |
|
| 66 |
- TimeoutSeconds: newInt64(7), |
|
| 67 |
- UpdatePercent: newInt32(-25), |
|
| 68 |
- Pre: &LifecycleHook{
|
|
| 69 |
- FailurePolicy: LifecycleHookFailurePolicyIgnore, |
|
| 70 |
- }, |
|
| 71 |
- Post: &LifecycleHook{
|
|
| 72 |
- FailurePolicy: LifecycleHookFailurePolicyAbort, |
|
| 73 |
- }, |
|
| 74 |
- }, |
|
| 75 |
- out: &newer.RollingDeploymentStrategyParams{
|
|
| 76 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 77 |
- IntervalSeconds: newInt64(6), |
|
| 78 |
- TimeoutSeconds: newInt64(7), |
|
| 79 |
- UpdatePercent: newInt32(-25), |
|
| 80 |
- MaxSurge: intstr.FromInt(0), |
|
| 81 |
- MaxUnavailable: intstr.FromString("25%"),
|
|
| 82 |
- Pre: &newer.LifecycleHook{
|
|
| 83 |
- FailurePolicy: newer.LifecycleHookFailurePolicyIgnore, |
|
| 84 |
- }, |
|
| 85 |
- Post: &newer.LifecycleHook{
|
|
| 86 |
- FailurePolicy: newer.LifecycleHookFailurePolicyAbort, |
|
| 87 |
- }, |
|
| 88 |
- }, |
|
| 89 |
- }, |
|
| 90 |
- {
|
|
| 91 |
- in: &RollingDeploymentStrategyParams{
|
|
| 92 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 93 |
- IntervalSeconds: newInt64(6), |
|
| 94 |
- TimeoutSeconds: newInt64(7), |
|
| 95 |
- UpdatePercent: newInt32(25), |
|
| 96 |
- }, |
|
| 97 |
- out: &newer.RollingDeploymentStrategyParams{
|
|
| 98 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 99 |
- IntervalSeconds: newInt64(6), |
|
| 100 |
- TimeoutSeconds: newInt64(7), |
|
| 101 |
- UpdatePercent: newInt32(25), |
|
| 102 |
- MaxSurge: intstr.FromString("25%"),
|
|
| 103 |
- MaxUnavailable: intstr.FromInt(0), |
|
| 104 |
- }, |
|
| 105 |
- }, |
|
| 106 |
- {
|
|
| 107 |
- in: &RollingDeploymentStrategyParams{
|
|
| 108 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 109 |
- IntervalSeconds: newInt64(6), |
|
| 110 |
- TimeoutSeconds: newInt64(7), |
|
| 111 |
- MaxSurge: newIntOrString(intstr.FromInt(10)), |
|
| 112 |
- MaxUnavailable: newIntOrString(intstr.FromInt(20)), |
|
| 113 |
- }, |
|
| 114 |
- out: &newer.RollingDeploymentStrategyParams{
|
|
| 115 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 116 |
- IntervalSeconds: newInt64(6), |
|
| 117 |
- TimeoutSeconds: newInt64(7), |
|
| 118 |
- MaxSurge: intstr.FromInt(10), |
|
| 119 |
- MaxUnavailable: intstr.FromInt(20), |
|
| 120 |
- }, |
|
| 121 |
- }, |
|
| 122 |
- } |
|
| 123 |
- |
|
| 124 |
- for _, test := range tests {
|
|
| 125 |
- out := &newer.RollingDeploymentStrategyParams{}
|
|
| 126 |
- if err := kapi.Scheme.Convert(test.in, out); err != nil {
|
|
| 127 |
- t.Errorf("unexpected error: %v", err)
|
|
| 128 |
- } |
|
| 129 |
- if !reflect.DeepEqual(out, test.out) {
|
|
| 130 |
- t.Errorf("got different than expected:\nA:\t%#v\nB:\t%#v\n\nDiff:\n%s\n\n%s", out, test.out, diff.ObjectDiff(test.out, out), diff.ObjectGoPrintSideBySide(test.out, out))
|
|
| 131 |
- } |
|
| 132 |
- } |
|
| 133 |
-} |
|
| 134 |
- |
|
| 135 |
-func Test_convert_api_RollingDeploymentStrategyParams_To_v1beta3_RollingDeploymentStrategyParams(t *testing.T) {
|
|
| 136 |
- tests := []struct {
|
|
| 137 |
- in *newer.RollingDeploymentStrategyParams |
|
| 138 |
- out *RollingDeploymentStrategyParams |
|
| 139 |
- }{
|
|
| 140 |
- {
|
|
| 141 |
- in: &newer.RollingDeploymentStrategyParams{
|
|
| 142 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 143 |
- IntervalSeconds: newInt64(6), |
|
| 144 |
- TimeoutSeconds: newInt64(7), |
|
| 145 |
- UpdatePercent: newInt32(-25), |
|
| 146 |
- MaxSurge: intstr.FromInt(0), |
|
| 147 |
- MaxUnavailable: intstr.FromString("25%"),
|
|
| 148 |
- }, |
|
| 149 |
- out: &RollingDeploymentStrategyParams{
|
|
| 150 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 151 |
- IntervalSeconds: newInt64(6), |
|
| 152 |
- TimeoutSeconds: newInt64(7), |
|
| 153 |
- UpdatePercent: newInt32(-25), |
|
| 154 |
- MaxSurge: newIntOrString(intstr.FromInt(0)), |
|
| 155 |
- MaxUnavailable: newIntOrString(intstr.FromString("25%")),
|
|
| 156 |
- }, |
|
| 157 |
- }, |
|
| 158 |
- {
|
|
| 159 |
- in: &newer.RollingDeploymentStrategyParams{
|
|
| 160 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 161 |
- IntervalSeconds: newInt64(6), |
|
| 162 |
- TimeoutSeconds: newInt64(7), |
|
| 163 |
- UpdatePercent: newInt32(25), |
|
| 164 |
- MaxSurge: intstr.FromString("25%"),
|
|
| 165 |
- MaxUnavailable: intstr.FromInt(0), |
|
| 166 |
- }, |
|
| 167 |
- out: &RollingDeploymentStrategyParams{
|
|
| 168 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 169 |
- IntervalSeconds: newInt64(6), |
|
| 170 |
- TimeoutSeconds: newInt64(7), |
|
| 171 |
- UpdatePercent: newInt32(25), |
|
| 172 |
- MaxSurge: newIntOrString(intstr.FromString("25%")),
|
|
| 173 |
- MaxUnavailable: newIntOrString(intstr.FromInt(0)), |
|
| 174 |
- }, |
|
| 175 |
- }, |
|
| 176 |
- {
|
|
| 177 |
- in: &newer.RollingDeploymentStrategyParams{
|
|
| 178 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 179 |
- IntervalSeconds: newInt64(6), |
|
| 180 |
- TimeoutSeconds: newInt64(7), |
|
| 181 |
- MaxSurge: intstr.FromInt(10), |
|
| 182 |
- MaxUnavailable: intstr.FromInt(20), |
|
| 183 |
- }, |
|
| 184 |
- out: &RollingDeploymentStrategyParams{
|
|
| 185 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 186 |
- IntervalSeconds: newInt64(6), |
|
| 187 |
- TimeoutSeconds: newInt64(7), |
|
| 188 |
- MaxSurge: newIntOrString(intstr.FromInt(10)), |
|
| 189 |
- MaxUnavailable: newIntOrString(intstr.FromInt(20)), |
|
| 190 |
- }, |
|
| 191 |
- }, |
|
| 192 |
- } |
|
| 193 |
- |
|
| 194 |
- for _, test := range tests {
|
|
| 195 |
- out := &RollingDeploymentStrategyParams{}
|
|
| 196 |
- if err := kapi.Scheme.Convert(test.in, out); err != nil {
|
|
| 197 |
- t.Errorf("unexpected error: %v", err)
|
|
| 198 |
- } |
|
| 199 |
- if !reflect.DeepEqual(out, test.out) {
|
|
| 200 |
- t.Errorf("got different than expected:\nA:\t%#v\nB:\t%#v\n\nDiff:\n%s\n\n%s", out, test.out, diff.ObjectDiff(test.out, out), diff.ObjectGoPrintSideBySide(test.out, out))
|
|
| 201 |
- } |
|
| 202 |
- } |
|
| 203 |
-} |
|
| 204 |
- |
|
| 205 |
-func newInt64(val int64) *int64 {
|
|
| 206 |
- return &val |
|
| 207 |
-} |
|
| 208 |
- |
|
| 209 |
-func newInt32(val int32) *int32 {
|
|
| 210 |
- return &val |
|
| 211 |
-} |
|
| 212 |
- |
|
| 213 |
-func newIntOrString(ios intstr.IntOrString) *intstr.IntOrString {
|
|
| 214 |
- return &ios |
|
| 215 |
-} |
| 216 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,81 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 5 |
- "k8s.io/kubernetes/pkg/util/intstr" |
|
| 6 |
- |
|
| 7 |
- deployapi "github.com/openshift/origin/pkg/deploy/api" |
|
| 8 |
-) |
|
| 9 |
- |
|
| 10 |
-func addDefaultingFuncs(scheme *runtime.Scheme) {
|
|
| 11 |
- mkintp := func(i int64) *int64 {
|
|
| 12 |
- return &i |
|
| 13 |
- } |
|
| 14 |
- |
|
| 15 |
- err := scheme.AddDefaultingFuncs( |
|
| 16 |
- func(obj *DeploymentConfigSpec) {
|
|
| 17 |
- if obj.Triggers == nil {
|
|
| 18 |
- obj.Triggers = []DeploymentTriggerPolicy{
|
|
| 19 |
- {Type: DeploymentTriggerOnConfigChange},
|
|
| 20 |
- } |
|
| 21 |
- } |
|
| 22 |
- if len(obj.Selector) == 0 && obj.Template != nil {
|
|
| 23 |
- obj.Selector = obj.Template.Labels |
|
| 24 |
- } |
|
| 25 |
- }, |
|
| 26 |
- func(obj *DeploymentStrategy) {
|
|
| 27 |
- if len(obj.Type) == 0 {
|
|
| 28 |
- obj.Type = DeploymentStrategyTypeRolling |
|
| 29 |
- } |
|
| 30 |
- |
|
| 31 |
- if obj.Type == DeploymentStrategyTypeRolling && obj.RollingParams == nil {
|
|
| 32 |
- obj.RollingParams = &RollingDeploymentStrategyParams{
|
|
| 33 |
- IntervalSeconds: mkintp(deployapi.DefaultRollingIntervalSeconds), |
|
| 34 |
- UpdatePeriodSeconds: mkintp(deployapi.DefaultRollingUpdatePeriodSeconds), |
|
| 35 |
- TimeoutSeconds: mkintp(deployapi.DefaultRollingTimeoutSeconds), |
|
| 36 |
- } |
|
| 37 |
- } |
|
| 38 |
- if obj.Type == DeploymentStrategyTypeRecreate && obj.RecreateParams == nil {
|
|
| 39 |
- obj.RecreateParams = &RecreateDeploymentStrategyParams{}
|
|
| 40 |
- } |
|
| 41 |
- }, |
|
| 42 |
- func(obj *RecreateDeploymentStrategyParams) {
|
|
| 43 |
- if obj.TimeoutSeconds == nil {
|
|
| 44 |
- obj.TimeoutSeconds = mkintp(deployapi.DefaultRollingTimeoutSeconds) |
|
| 45 |
- } |
|
| 46 |
- }, |
|
| 47 |
- func(obj *RollingDeploymentStrategyParams) {
|
|
| 48 |
- if obj.IntervalSeconds == nil {
|
|
| 49 |
- obj.IntervalSeconds = mkintp(deployapi.DefaultRollingIntervalSeconds) |
|
| 50 |
- } |
|
| 51 |
- |
|
| 52 |
- if obj.UpdatePeriodSeconds == nil {
|
|
| 53 |
- obj.UpdatePeriodSeconds = mkintp(deployapi.DefaultRollingUpdatePeriodSeconds) |
|
| 54 |
- } |
|
| 55 |
- |
|
| 56 |
- if obj.TimeoutSeconds == nil {
|
|
| 57 |
- obj.TimeoutSeconds = mkintp(deployapi.DefaultRollingTimeoutSeconds) |
|
| 58 |
- } |
|
| 59 |
- |
|
| 60 |
- if obj.UpdatePercent == nil {
|
|
| 61 |
- // Apply defaults. |
|
| 62 |
- if obj.MaxUnavailable == nil {
|
|
| 63 |
- maxUnavailable := intstr.FromString("25%")
|
|
| 64 |
- obj.MaxUnavailable = &maxUnavailable |
|
| 65 |
- } |
|
| 66 |
- if obj.MaxSurge == nil {
|
|
| 67 |
- maxSurge := intstr.FromString("25%")
|
|
| 68 |
- obj.MaxSurge = &maxSurge |
|
| 69 |
- } |
|
| 70 |
- } |
|
| 71 |
- }, |
|
| 72 |
- func(obj *DeploymentTriggerImageChangeParams) {
|
|
| 73 |
- if len(obj.From.Kind) == 0 {
|
|
| 74 |
- obj.From.Kind = "ImageStreamTag" |
|
| 75 |
- } |
|
| 76 |
- }, |
|
| 77 |
- ) |
|
| 78 |
- if err != nil {
|
|
| 79 |
- panic(err) |
|
| 80 |
- } |
|
| 81 |
-} |
| 82 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,219 +0,0 @@ |
| 1 |
-package v1beta3_test |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "reflect" |
|
| 5 |
- "testing" |
|
| 6 |
- |
|
| 7 |
- kapi "k8s.io/kubernetes/pkg/api" |
|
| 8 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 9 |
- "k8s.io/kubernetes/pkg/util/diff" |
|
| 10 |
- "k8s.io/kubernetes/pkg/util/intstr" |
|
| 11 |
- |
|
| 12 |
- v1 "github.com/openshift/origin/pkg/api/v1beta3" |
|
| 13 |
- deployapi "github.com/openshift/origin/pkg/deploy/api" |
|
| 14 |
- _ "github.com/openshift/origin/pkg/deploy/api/install" |
|
| 15 |
- deployv1 "github.com/openshift/origin/pkg/deploy/api/v1beta3" |
|
| 16 |
-) |
|
| 17 |
- |
|
| 18 |
-func TestDefaults(t *testing.T) {
|
|
| 19 |
- defaultIntOrString := intstr.FromString("25%")
|
|
| 20 |
- differentIntOrString := intstr.FromInt(5) |
|
| 21 |
- tests := map[string]struct {
|
|
| 22 |
- original *deployv1.DeploymentConfig |
|
| 23 |
- expected *deployv1.DeploymentConfig |
|
| 24 |
- }{
|
|
| 25 |
- "empty dc": {
|
|
| 26 |
- original: &deployv1.DeploymentConfig{},
|
|
| 27 |
- expected: &deployv1.DeploymentConfig{
|
|
| 28 |
- Spec: deployv1.DeploymentConfigSpec{
|
|
| 29 |
- Strategy: deployv1.DeploymentStrategy{
|
|
| 30 |
- Type: deployv1.DeploymentStrategyTypeRolling, |
|
| 31 |
- RollingParams: &deployv1.RollingDeploymentStrategyParams{
|
|
| 32 |
- UpdatePeriodSeconds: newInt64(deployapi.DefaultRollingUpdatePeriodSeconds), |
|
| 33 |
- IntervalSeconds: newInt64(deployapi.DefaultRollingIntervalSeconds), |
|
| 34 |
- TimeoutSeconds: newInt64(deployapi.DefaultRollingTimeoutSeconds), |
|
| 35 |
- MaxSurge: &defaultIntOrString, |
|
| 36 |
- MaxUnavailable: &defaultIntOrString, |
|
| 37 |
- }, |
|
| 38 |
- }, |
|
| 39 |
- Triggers: []deployv1.DeploymentTriggerPolicy{
|
|
| 40 |
- {
|
|
| 41 |
- Type: deployv1.DeploymentTriggerOnConfigChange, |
|
| 42 |
- }, |
|
| 43 |
- }, |
|
| 44 |
- }, |
|
| 45 |
- }, |
|
| 46 |
- }, |
|
| 47 |
- "recreate": {
|
|
| 48 |
- original: &deployv1.DeploymentConfig{
|
|
| 49 |
- Spec: deployv1.DeploymentConfigSpec{
|
|
| 50 |
- Strategy: deployv1.DeploymentStrategy{
|
|
| 51 |
- Type: deployv1.DeploymentStrategyTypeRecreate, |
|
| 52 |
- RollingParams: &deployv1.RollingDeploymentStrategyParams{
|
|
| 53 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 54 |
- IntervalSeconds: newInt64(6), |
|
| 55 |
- TimeoutSeconds: newInt64(7), |
|
| 56 |
- MaxSurge: &differentIntOrString, |
|
| 57 |
- MaxUnavailable: &differentIntOrString, |
|
| 58 |
- }, |
|
| 59 |
- }, |
|
| 60 |
- Triggers: []deployv1.DeploymentTriggerPolicy{
|
|
| 61 |
- {
|
|
| 62 |
- Type: deployv1.DeploymentTriggerOnImageChange, |
|
| 63 |
- }, |
|
| 64 |
- }, |
|
| 65 |
- }, |
|
| 66 |
- }, |
|
| 67 |
- expected: &deployv1.DeploymentConfig{
|
|
| 68 |
- Spec: deployv1.DeploymentConfigSpec{
|
|
| 69 |
- Strategy: deployv1.DeploymentStrategy{
|
|
| 70 |
- Type: deployv1.DeploymentStrategyTypeRecreate, |
|
| 71 |
- RecreateParams: &deployv1.RecreateDeploymentStrategyParams{
|
|
| 72 |
- TimeoutSeconds: newInt64(deployapi.DefaultRollingTimeoutSeconds), |
|
| 73 |
- }, |
|
| 74 |
- RollingParams: &deployv1.RollingDeploymentStrategyParams{
|
|
| 75 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 76 |
- IntervalSeconds: newInt64(6), |
|
| 77 |
- TimeoutSeconds: newInt64(7), |
|
| 78 |
- MaxSurge: &differentIntOrString, |
|
| 79 |
- MaxUnavailable: &differentIntOrString, |
|
| 80 |
- }, |
|
| 81 |
- }, |
|
| 82 |
- Triggers: []deployv1.DeploymentTriggerPolicy{
|
|
| 83 |
- {
|
|
| 84 |
- Type: deployv1.DeploymentTriggerOnImageChange, |
|
| 85 |
- }, |
|
| 86 |
- }, |
|
| 87 |
- }, |
|
| 88 |
- }, |
|
| 89 |
- }, |
|
| 90 |
- "rolling": {
|
|
| 91 |
- original: &deployv1.DeploymentConfig{
|
|
| 92 |
- Spec: deployv1.DeploymentConfigSpec{
|
|
| 93 |
- Strategy: deployv1.DeploymentStrategy{
|
|
| 94 |
- Type: deployv1.DeploymentStrategyTypeRolling, |
|
| 95 |
- RollingParams: &deployv1.RollingDeploymentStrategyParams{
|
|
| 96 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 97 |
- IntervalSeconds: newInt64(6), |
|
| 98 |
- TimeoutSeconds: newInt64(7), |
|
| 99 |
- UpdatePercent: newInt32(50), |
|
| 100 |
- }, |
|
| 101 |
- }, |
|
| 102 |
- Triggers: []deployv1.DeploymentTriggerPolicy{
|
|
| 103 |
- {
|
|
| 104 |
- Type: deployv1.DeploymentTriggerOnImageChange, |
|
| 105 |
- }, |
|
| 106 |
- }, |
|
| 107 |
- }, |
|
| 108 |
- }, |
|
| 109 |
- expected: &deployv1.DeploymentConfig{
|
|
| 110 |
- Spec: deployv1.DeploymentConfigSpec{
|
|
| 111 |
- Strategy: deployv1.DeploymentStrategy{
|
|
| 112 |
- Type: deployv1.DeploymentStrategyTypeRolling, |
|
| 113 |
- RollingParams: &deployv1.RollingDeploymentStrategyParams{
|
|
| 114 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 115 |
- IntervalSeconds: newInt64(6), |
|
| 116 |
- TimeoutSeconds: newInt64(7), |
|
| 117 |
- UpdatePercent: newInt32(50), |
|
| 118 |
- MaxSurge: newIntOrString(intstr.FromString("50%")),
|
|
| 119 |
- MaxUnavailable: newIntOrString(intstr.FromInt(0)), |
|
| 120 |
- }, |
|
| 121 |
- }, |
|
| 122 |
- Triggers: []deployv1.DeploymentTriggerPolicy{
|
|
| 123 |
- {
|
|
| 124 |
- Type: deployv1.DeploymentTriggerOnImageChange, |
|
| 125 |
- }, |
|
| 126 |
- }, |
|
| 127 |
- }, |
|
| 128 |
- }, |
|
| 129 |
- }, |
|
| 130 |
- "rolling-2": {
|
|
| 131 |
- original: &deployv1.DeploymentConfig{
|
|
| 132 |
- Spec: deployv1.DeploymentConfigSpec{
|
|
| 133 |
- Strategy: deployv1.DeploymentStrategy{
|
|
| 134 |
- Type: deployv1.DeploymentStrategyTypeRolling, |
|
| 135 |
- RollingParams: &deployv1.RollingDeploymentStrategyParams{
|
|
| 136 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 137 |
- IntervalSeconds: newInt64(6), |
|
| 138 |
- TimeoutSeconds: newInt64(7), |
|
| 139 |
- UpdatePercent: newInt32(-50), |
|
| 140 |
- }, |
|
| 141 |
- }, |
|
| 142 |
- Triggers: []deployv1.DeploymentTriggerPolicy{
|
|
| 143 |
- {
|
|
| 144 |
- Type: deployv1.DeploymentTriggerOnImageChange, |
|
| 145 |
- }, |
|
| 146 |
- }, |
|
| 147 |
- }, |
|
| 148 |
- }, |
|
| 149 |
- expected: &deployv1.DeploymentConfig{
|
|
| 150 |
- Spec: deployv1.DeploymentConfigSpec{
|
|
| 151 |
- Strategy: deployv1.DeploymentStrategy{
|
|
| 152 |
- Type: deployv1.DeploymentStrategyTypeRolling, |
|
| 153 |
- RollingParams: &deployv1.RollingDeploymentStrategyParams{
|
|
| 154 |
- UpdatePeriodSeconds: newInt64(5), |
|
| 155 |
- IntervalSeconds: newInt64(6), |
|
| 156 |
- TimeoutSeconds: newInt64(7), |
|
| 157 |
- UpdatePercent: newInt32(-50), |
|
| 158 |
- MaxSurge: newIntOrString(intstr.FromInt(0)), |
|
| 159 |
- MaxUnavailable: newIntOrString(intstr.FromString("50%")),
|
|
| 160 |
- }, |
|
| 161 |
- }, |
|
| 162 |
- Triggers: []deployv1.DeploymentTriggerPolicy{
|
|
| 163 |
- {
|
|
| 164 |
- Type: deployv1.DeploymentTriggerOnImageChange, |
|
| 165 |
- }, |
|
| 166 |
- }, |
|
| 167 |
- }, |
|
| 168 |
- }, |
|
| 169 |
- }, |
|
| 170 |
- } |
|
| 171 |
- |
|
| 172 |
- for name, test := range tests {
|
|
| 173 |
- t.Logf("%s", name)
|
|
| 174 |
- original := test.original |
|
| 175 |
- expected := test.expected |
|
| 176 |
- obj2 := roundTrip(t, runtime.Object(original)) |
|
| 177 |
- got, ok := obj2.(*deployv1.DeploymentConfig) |
|
| 178 |
- if !ok {
|
|
| 179 |
- t.Errorf("unexpected object: %v", got)
|
|
| 180 |
- t.FailNow() |
|
| 181 |
- } |
|
| 182 |
- if !reflect.DeepEqual(got.Spec, expected.Spec) {
|
|
| 183 |
- t.Errorf("got different than expected:\nA:\t%#v\nB:\t%#v\n\nDiff:\n%s\n\n%s", got, expected, diff.ObjectDiff(expected, got), diff.ObjectGoPrintSideBySide(expected, got))
|
|
| 184 |
- |
|
| 185 |
- } |
|
| 186 |
- } |
|
| 187 |
-} |
|
| 188 |
- |
|
| 189 |
-func roundTrip(t *testing.T, obj runtime.Object) runtime.Object {
|
|
| 190 |
- data, err := runtime.Encode(kapi.Codecs.LegacyCodec(v1.SchemeGroupVersion), obj) |
|
| 191 |
- if err != nil {
|
|
| 192 |
- t.Errorf("%v\n %#v", err, obj)
|
|
| 193 |
- return nil |
|
| 194 |
- } |
|
| 195 |
- obj2, err := runtime.Decode(kapi.Codecs.UniversalDecoder(), data) |
|
| 196 |
- if err != nil {
|
|
| 197 |
- t.Errorf("%v\nData: %s\nSource: %#v", err, string(data), obj)
|
|
| 198 |
- return nil |
|
| 199 |
- } |
|
| 200 |
- obj3 := reflect.New(reflect.TypeOf(obj).Elem()).Interface().(runtime.Object) |
|
| 201 |
- err = kapi.Scheme.Convert(obj2, obj3) |
|
| 202 |
- if err != nil {
|
|
| 203 |
- t.Errorf("%v\nSource: %#v", err, obj2)
|
|
| 204 |
- return nil |
|
| 205 |
- } |
|
| 206 |
- return obj3 |
|
| 207 |
-} |
|
| 208 |
- |
|
| 209 |
-func newInt64(val int64) *int64 {
|
|
| 210 |
- return &val |
|
| 211 |
-} |
|
| 212 |
- |
|
| 213 |
-func newInt32(val int32) *int32 {
|
|
| 214 |
- return &val |
|
| 215 |
-} |
|
| 216 |
- |
|
| 217 |
-func newIntOrString(ios intstr.IntOrString) *intstr.IntOrString {
|
|
| 218 |
- return &ios |
|
| 219 |
-} |
| 220 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,34 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-const GroupName = "" |
|
| 9 |
- |
|
| 10 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 11 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 12 |
- |
|
| 13 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 14 |
- addKnownTypes(scheme) |
|
| 15 |
- addDefaultingFuncs(scheme) |
|
| 16 |
- addConversionFuncs(scheme) |
|
| 17 |
-} |
|
| 18 |
- |
|
| 19 |
-// Adds the list of known types to api.Scheme. |
|
| 20 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 21 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 22 |
- &DeploymentConfig{},
|
|
| 23 |
- &DeploymentConfigList{},
|
|
| 24 |
- &DeploymentConfigRollback{},
|
|
| 25 |
- &DeploymentLog{},
|
|
| 26 |
- &DeploymentLogOptions{},
|
|
| 27 |
- ) |
|
| 28 |
-} |
|
| 29 |
- |
|
| 30 |
-func (obj *DeploymentConfig) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 31 |
-func (obj *DeploymentConfigList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 32 |
-func (obj *DeploymentConfigRollback) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 33 |
-func (obj *DeploymentLog) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 34 |
-func (obj *DeploymentLogOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 35 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,456 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 6 |
- "k8s.io/kubernetes/pkg/util/intstr" |
|
| 7 |
-) |
|
| 8 |
- |
|
| 9 |
-// DeploymentPhase describes the possible states a deployment can be in. |
|
| 10 |
-type DeploymentPhase string |
|
| 11 |
- |
|
| 12 |
-const ( |
|
| 13 |
- // DeploymentPhaseNew means the deployment has been accepted but not yet acted upon. |
|
| 14 |
- DeploymentPhaseNew DeploymentPhase = "New" |
|
| 15 |
- // DeploymentPhasePending means the deployment been handed over to a deployment strategy, |
|
| 16 |
- // but the strategy has not yet declared the deployment to be running. |
|
| 17 |
- DeploymentPhasePending DeploymentPhase = "Pending" |
|
| 18 |
- // DeploymentPhaseRunning means the deployment strategy has reported the deployment as |
|
| 19 |
- // being in-progress. |
|
| 20 |
- DeploymentPhaseRunning DeploymentPhase = "Running" |
|
| 21 |
- // DeploymentPhaseComplete means the deployment finished without an error. |
|
| 22 |
- DeploymentPhaseComplete DeploymentPhase = "Complete" |
|
| 23 |
- // DeploymentPhaseFailed means the deployment finished with an error. |
|
| 24 |
- DeploymentPhaseFailed DeploymentPhase = "Failed" |
|
| 25 |
-) |
|
| 26 |
- |
|
| 27 |
-// DeploymentStrategy describes how to perform a deployment. |
|
| 28 |
-type DeploymentStrategy struct {
|
|
| 29 |
- // Type is the name of a deployment strategy. |
|
| 30 |
- Type DeploymentStrategyType `json:"type,omitempty"` |
|
| 31 |
- |
|
| 32 |
- // CustomParams are the input to the Custom deployment strategy. |
|
| 33 |
- CustomParams *CustomDeploymentStrategyParams `json:"customParams,omitempty"` |
|
| 34 |
- // RecreateParams are the input to the Recreate deployment strategy. |
|
| 35 |
- RecreateParams *RecreateDeploymentStrategyParams `json:"recreateParams,omitempty"` |
|
| 36 |
- // RollingParams are the input to the Rolling deployment strategy. |
|
| 37 |
- RollingParams *RollingDeploymentStrategyParams `json:"rollingParams,omitempty"` |
|
| 38 |
- |
|
| 39 |
- // Compute resource requirements to execute the deployment |
|
| 40 |
- Resources kapi.ResourceRequirements `json:"resources,omitempty"` |
|
| 41 |
- // Labels is a set of key, value pairs added to custom deployer and lifecycle pre/post hook pods. |
|
| 42 |
- Labels map[string]string `json:"labels,omitempty"` |
|
| 43 |
- // Annotations is a set of key, value pairs added to custom deployer and lifecycle pre/post hook pods. |
|
| 44 |
- Annotations map[string]string `json:"annotations,omitempty"` |
|
| 45 |
-} |
|
| 46 |
- |
|
| 47 |
-// DeploymentStrategyType refers to a specific DeploymentStrategy implementation. |
|
| 48 |
-type DeploymentStrategyType string |
|
| 49 |
- |
|
| 50 |
-const ( |
|
| 51 |
- // DeploymentStrategyTypeRecreate is a simple strategy suitable as a default. |
|
| 52 |
- DeploymentStrategyTypeRecreate DeploymentStrategyType = "Recreate" |
|
| 53 |
- // DeploymentStrategyTypeCustom is a user defined strategy. |
|
| 54 |
- DeploymentStrategyTypeCustom DeploymentStrategyType = "Custom" |
|
| 55 |
- // DeploymentStrategyTypeRolling uses the Kubernetes RollingUpdater. |
|
| 56 |
- DeploymentStrategyTypeRolling DeploymentStrategyType = "Rolling" |
|
| 57 |
-) |
|
| 58 |
- |
|
| 59 |
-// CustomParams are the input to the Custom deployment strategy. |
|
| 60 |
-type CustomDeploymentStrategyParams struct {
|
|
| 61 |
- // Image specifies a Docker image which can carry out a deployment. |
|
| 62 |
- Image string `json:"image,omitempty"` |
|
| 63 |
- // Environment holds the environment which will be given to the container for Image. |
|
| 64 |
- Environment []kapi.EnvVar `json:"environment,omitempty"` |
|
| 65 |
- // Command is optional and overrides CMD in the container Image. |
|
| 66 |
- Command []string `json:"command,omitempty"` |
|
| 67 |
-} |
|
| 68 |
- |
|
| 69 |
-// RecreateDeploymentStrategyParams are the input to the Recreate deployment |
|
| 70 |
-// strategy. |
|
| 71 |
-type RecreateDeploymentStrategyParams struct {
|
|
| 72 |
- // TimeoutSeconds is the time to wait for updates before giving up. If the |
|
| 73 |
- // value is nil, a default will be used. |
|
| 74 |
- TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty"` |
|
| 75 |
- // Pre is a lifecycle hook which is executed before the strategy manipulates |
|
| 76 |
- // the deployment. All LifecycleHookFailurePolicy values are supported. |
|
| 77 |
- Pre *LifecycleHook `json:"pre,omitempty"` |
|
| 78 |
- // Mid is a lifecycle hook which is executed while the deployment is scaled down to zero before the first new |
|
| 79 |
- // pod is created. All LifecycleHookFailurePolicy values are supported. |
|
| 80 |
- Mid *LifecycleHook `json:"mid,omitempty"` |
|
| 81 |
- // Post is a lifecycle hook which is executed after the strategy has |
|
| 82 |
- // finished all deployment logic. The LifecycleHookFailurePolicyAbort policy |
|
| 83 |
- // is NOT supported. |
|
| 84 |
- Post *LifecycleHook `json:"post,omitempty"` |
|
| 85 |
-} |
|
| 86 |
- |
|
| 87 |
-// LifecycleHook defines a specific deployment lifecycle action. Only one type of action may be specified at any time. |
|
| 88 |
-type LifecycleHook struct {
|
|
| 89 |
- // FailurePolicy specifies what action to take if the hook fails. |
|
| 90 |
- FailurePolicy LifecycleHookFailurePolicy `json:"failurePolicy"` |
|
| 91 |
- |
|
| 92 |
- // ExecNewPod specifies the options for a lifecycle hook backed by a pod. |
|
| 93 |
- ExecNewPod *ExecNewPodHook `json:"execNewPod,omitempty"` |
|
| 94 |
- |
|
| 95 |
- // TagImages instructs the deployer to tag the current image referenced under a container onto an image stream tag if the deployment succeeds. |
|
| 96 |
- TagImages []TagImageHook `json:"tagImages,omitempty"` |
|
| 97 |
-} |
|
| 98 |
- |
|
| 99 |
-// HandlerFailurePolicy describes possibles actions to take if a hook fails. |
|
| 100 |
-type LifecycleHookFailurePolicy string |
|
| 101 |
- |
|
| 102 |
-const ( |
|
| 103 |
- // LifecycleHookFailurePolicyRetry means retry the hook until it succeeds. |
|
| 104 |
- LifecycleHookFailurePolicyRetry LifecycleHookFailurePolicy = "Retry" |
|
| 105 |
- // LifecycleHookFailurePolicyAbort means abort the deployment (if possible). |
|
| 106 |
- LifecycleHookFailurePolicyAbort LifecycleHookFailurePolicy = "Abort" |
|
| 107 |
- // LifecycleHookFailurePolicyIgnore means ignore failure and continue the deployment. |
|
| 108 |
- LifecycleHookFailurePolicyIgnore LifecycleHookFailurePolicy = "Ignore" |
|
| 109 |
-) |
|
| 110 |
- |
|
| 111 |
-// ExecNewPodHook is a hook implementation which runs a command in a new pod |
|
| 112 |
-// based on the specified container which is assumed to be part of the |
|
| 113 |
-// deployment template. |
|
| 114 |
-type ExecNewPodHook struct {
|
|
| 115 |
- // Command is the action command and its arguments. |
|
| 116 |
- Command []string `json:"command"` |
|
| 117 |
- // Env is a set of environment variables to supply to the hook pod's container. |
|
| 118 |
- Env []kapi.EnvVar `json:"env,omitempty"` |
|
| 119 |
- // ContainerName is the name of a container in the deployment pod template |
|
| 120 |
- // whose Docker image will be used for the hook pod's container. |
|
| 121 |
- ContainerName string `json:"containerName"` |
|
| 122 |
- // Volumes is a list of named volumes from the pod template which should be |
|
| 123 |
- // copied to the hook pod. Volumes names not found in pod spec are ignored. |
|
| 124 |
- // An empty list means no volumes will be copied. |
|
| 125 |
- Volumes []string `json:"volumes,omitempty"` |
|
| 126 |
-} |
|
| 127 |
- |
|
| 128 |
-// TagImageHook is a request to tag the image in a particular container onto an ImageStreamTag. |
|
| 129 |
-type TagImageHook struct {
|
|
| 130 |
- // ContainerName is the name of a container in the deployment config whose image value will be used as the source of the tag |
|
| 131 |
- ContainerName string `json:"containerName"` |
|
| 132 |
- // To is the target ImageStreamTag to set the image of |
|
| 133 |
- To kapi.ObjectReference `json:"to"` |
|
| 134 |
-} |
|
| 135 |
- |
|
| 136 |
-// RollingDeploymentStrategyParams are the input to the Rolling deployment |
|
| 137 |
-// strategy. |
|
| 138 |
-type RollingDeploymentStrategyParams struct {
|
|
| 139 |
- // UpdatePeriodSeconds is the time to wait between individual pod updates. |
|
| 140 |
- // If the value is nil, a default will be used. |
|
| 141 |
- UpdatePeriodSeconds *int64 `json:"updatePeriodSeconds,omitempty"` |
|
| 142 |
- // IntervalSeconds is the time to wait between polling deployment status |
|
| 143 |
- // after update. If the value is nil, a default will be used. |
|
| 144 |
- IntervalSeconds *int64 `json:"intervalSeconds,omitempty"` |
|
| 145 |
- // TimeoutSeconds is the time to wait for updates before giving up. If the |
|
| 146 |
- // value is nil, a default will be used. |
|
| 147 |
- TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty"` |
|
| 148 |
- // MaxUnavailable is the maximum number of pods that can be unavailable |
|
| 149 |
- // during the update. Value can be an absolute number (ex: 5) or a |
|
| 150 |
- // percentage of total pods at the start of update (ex: 10%). Absolute |
|
| 151 |
- // number is calculated from percentage by rounding up. |
|
| 152 |
- // |
|
| 153 |
- // This cannot be 0 if MaxSurge is 0. By default, 25% is used. |
|
| 154 |
- // |
|
| 155 |
- // Example: when this is set to 30%, the old RC can be scaled down by 30% |
|
| 156 |
- // immediately when the rolling update starts. Once new pods are ready, old |
|
| 157 |
- // RC can be scaled down further, followed by scaling up the new RC, |
|
| 158 |
- // ensuring that at least 70% of original number of pods are available at |
|
| 159 |
- // all times during the update. |
|
| 160 |
- MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` |
|
| 161 |
- // MaxSurge is the maximum number of pods that can be scheduled above the |
|
| 162 |
- // original number of pods. Value can be an absolute number (ex: 5) or a |
|
| 163 |
- // percentage of total pods at the start of the update (ex: 10%). Absolute |
|
| 164 |
- // number is calculated from percentage by rounding up. |
|
| 165 |
- // |
|
| 166 |
- // This cannot be 0 if MaxUnavailable is 0. By default, 25% is used. |
|
| 167 |
- // |
|
| 168 |
- // Example: when this is set to 30%, the new RC can be scaled up by 30% |
|
| 169 |
- // immediately when the rolling update starts. Once old pods have been |
|
| 170 |
- // killed, new RC can be scaled up further, ensuring that total number of |
|
| 171 |
- // pods running at any time during the update is atmost 130% of original |
|
| 172 |
- // pods. |
|
| 173 |
- MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` |
|
| 174 |
- // UpdatePercent is the percentage of replicas to scale up or down each |
|
| 175 |
- // interval. If nil, one replica will be scaled up and down each interval. |
|
| 176 |
- // If negative, the scale order will be down/up instead of up/down. |
|
| 177 |
- // DEPRECATED: Use MaxUnavailable/MaxSurge instead. |
|
| 178 |
- UpdatePercent *int32 `json:"updatePercent,omitempty"` |
|
| 179 |
- // Pre is a lifecycle hook which is executed before the deployment process |
|
| 180 |
- // begins. All LifecycleHookFailurePolicy values are supported. |
|
| 181 |
- Pre *LifecycleHook `json:"pre,omitempty"` |
|
| 182 |
- // Post is a lifecycle hook which is executed after the strategy has |
|
| 183 |
- // finished all deployment logic. The LifecycleHookFailurePolicyAbort policy |
|
| 184 |
- // is NOT supported. |
|
| 185 |
- Post *LifecycleHook `json:"post,omitempty"` |
|
| 186 |
-} |
|
| 187 |
- |
|
| 188 |
-// These constants represent keys used for correlating objects related to deployments. |
|
| 189 |
-const ( |
|
| 190 |
- // DeploymentConfigAnnotation is an annotation name used to correlate a deployment with the |
|
| 191 |
- // DeploymentConfig on which the deployment is based. |
|
| 192 |
- DeploymentConfigAnnotation = "openshift.io/deployment-config.name" |
|
| 193 |
- // DeploymentAnnotation is an annotation on a deployer Pod. The annotation value is the name |
|
| 194 |
- // of the deployment (a ReplicationController) on which the deployer Pod acts. |
|
| 195 |
- DeploymentAnnotation = "openshift.io/deployment.name" |
|
| 196 |
- // DeploymentPodAnnotation is an annotation on a deployment (a ReplicationController). The |
|
| 197 |
- // annotation value is the name of the deployer Pod which will act upon the ReplicationController |
|
| 198 |
- // to implement the deployment behavior. |
|
| 199 |
- DeploymentPodAnnotation = "openshift.io/deployer-pod.name" |
|
| 200 |
- // DeploymentPodTypeLabel is a label with which contains a type of deployment pod. |
|
| 201 |
- DeploymentPodTypeLabel = "openshift.io/deployer-pod.type" |
|
| 202 |
- // DeployerPodForDeploymentLabel is a label which groups pods related to a |
|
| 203 |
- // deployment. The value is a deployment name. The deployer pod and hook pods |
|
| 204 |
- // created by the internal strategies will have this label. Custom |
|
| 205 |
- // strategies can apply this label to any pods they create, enabling |
|
| 206 |
- // platform-provided cancellation and garbage collection support. |
|
| 207 |
- DeployerPodForDeploymentLabel = "openshift.io/deployer-pod-for.name" |
|
| 208 |
- // DeploymentPhaseAnnotation is an annotation name used to retrieve the DeploymentPhase of |
|
| 209 |
- // a deployment. |
|
| 210 |
- DeploymentPhaseAnnotation = "openshift.io/deployment.phase" |
|
| 211 |
- // DeploymentEncodedConfigAnnotation is an annotation name used to retrieve specific encoded |
|
| 212 |
- // DeploymentConfig on which a given deployment is based. |
|
| 213 |
- DeploymentEncodedConfigAnnotation = "openshift.io/encoded-deployment-config" |
|
| 214 |
- // DeploymentVersionAnnotation is an annotation on a deployment (a ReplicationController). The |
|
| 215 |
- // annotation value is the LatestVersion value of the DeploymentConfig which was the basis for |
|
| 216 |
- // the deployment. |
|
| 217 |
- DeploymentVersionAnnotation = "openshift.io/deployment-config.latest-version" |
|
| 218 |
- // DeploymentLabel is the name of a label used to correlate a deployment with the Pod created |
|
| 219 |
- // to execute the deployment logic. |
|
| 220 |
- // TODO: This is a workaround for upstream's lack of annotation support on PodTemplate. Once |
|
| 221 |
- // annotations are available on PodTemplate, audit this constant with the goal of removing it. |
|
| 222 |
- DeploymentLabel = "deployment" |
|
| 223 |
- // DeploymentConfigLabel is the name of a label used to correlate a deployment with the |
|
| 224 |
- // DeploymentConfigs on which the deployment is based. |
|
| 225 |
- DeploymentConfigLabel = "deploymentconfig" |
|
| 226 |
- // DeploymentStatusReasonAnnotation represents the reason for deployment being in a given state |
|
| 227 |
- // Used for specifying the reason for cancellation or failure of a deployment |
|
| 228 |
- DeploymentStatusReasonAnnotation = "openshift.io/deployment.status-reason" |
|
| 229 |
- // DeploymentCancelledAnnotation indicates that the deployment has been cancelled |
|
| 230 |
- // The annotation value does not matter and its mere presence indicates cancellation |
|
| 231 |
- DeploymentCancelledAnnotation = "openshift.io/deployment.cancelled" |
|
| 232 |
- // DeploymentInstantiatedAnnotation indicates that the deployment has been instantiated. |
|
| 233 |
- // The annotation value does not matter and its mere presence indicates instantiation. |
|
| 234 |
- DeploymentInstantiatedAnnotation = "openshift.io/deployment.instantiated" |
|
| 235 |
-) |
|
| 236 |
- |
|
| 237 |
-// These constants represent the various reasons for cancelling a deployment |
|
| 238 |
-// or for a deployment being placed in a failed state |
|
| 239 |
-const ( |
|
| 240 |
- DeploymentCancelledByUser = "cancelled by the user" |
|
| 241 |
- DeploymentCancelledNewerDeploymentExists = "cancelled as a newer deployment was found running" |
|
| 242 |
- DeploymentFailedUnrelatedDeploymentExists = "unrelated pod with the same name as this deployment is already running" |
|
| 243 |
- DeploymentFailedDeployerPodNoLongerExists = "deployer pod no longer exists" |
|
| 244 |
-) |
|
| 245 |
- |
|
| 246 |
-// This constant represents the maximum duration that a deployment is allowed to run |
|
| 247 |
-// This is set as the default value for ActiveDeadlineSeconds for the deployer pod |
|
| 248 |
-// Currently set to 6 hours |
|
| 249 |
-const MaxDeploymentDurationSeconds int64 = 21600 |
|
| 250 |
- |
|
| 251 |
-// This constant represents the value for the DeploymentCancelledAnnotation annotation |
|
| 252 |
-// that signifies that the deployment should be cancelled |
|
| 253 |
-const DeploymentCancelledAnnotationValue = "true" |
|
| 254 |
- |
|
| 255 |
-// DeploymentConfig represents a configuration for a single deployment (represented as a |
|
| 256 |
-// ReplicationController). It also contains details about changes which resulted in the current |
|
| 257 |
-// state of the DeploymentConfig. Each change to the DeploymentConfig which should result in |
|
| 258 |
-// a new deployment results in an increment of LatestVersion. |
|
| 259 |
-type DeploymentConfig struct {
|
|
| 260 |
- unversioned.TypeMeta `json:",inline"` |
|
| 261 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 262 |
- // Spec represents a desired deployment state and how to deploy to it. |
|
| 263 |
- Spec DeploymentConfigSpec `json:"spec"` |
|
| 264 |
- // Status represents a desired deployment state and how to deploy to it. |
|
| 265 |
- Status DeploymentConfigStatus `json:"status"` |
|
| 266 |
-} |
|
| 267 |
- |
|
| 268 |
-// DeploymentTemplate contains all the necessary information to create a deployment from a |
|
| 269 |
-// DeploymentStrategy. |
|
| 270 |
-type DeploymentConfigSpec struct {
|
|
| 271 |
- // Strategy describes how a deployment is executed. |
|
| 272 |
- Strategy DeploymentStrategy `json:"strategy,omitempty"` |
|
| 273 |
- |
|
| 274 |
- // Triggers determine how updates to a DeploymentConfig result in new deployments. If no triggers |
|
| 275 |
- // are defined, a new deployment can only occur as a result of an explicit client update to the |
|
| 276 |
- // DeploymentConfig with a new LatestVersion. |
|
| 277 |
- Triggers []DeploymentTriggerPolicy `json:"triggers,omitempty"` |
|
| 278 |
- |
|
| 279 |
- // Replicas is the number of desired replicas. |
|
| 280 |
- Replicas int32 `json:"replicas"` |
|
| 281 |
- |
|
| 282 |
- // Test ensures that this deployment config will have zero replicas except while a deployment is running. This allows the |
|
| 283 |
- // deployment config to be used as a continuous deployment test - triggering on images, running the deployment, and then succeeding |
|
| 284 |
- // or failing. Post strategy hooks and After actions can be used to integrate successful deployment with an action. |
|
| 285 |
- Test bool `json:"test"` |
|
| 286 |
- |
|
| 287 |
- // Paused indicates that the deployment config is paused resulting in no new deployments on template |
|
| 288 |
- // changes or changes in the template caused by other triggers. |
|
| 289 |
- Paused bool `json:"paused,omitempty"` |
|
| 290 |
- |
|
| 291 |
- // Selector is a label query over pods that should match the Replicas count. |
|
| 292 |
- Selector map[string]string `json:"selector,omitempty"` |
|
| 293 |
- |
|
| 294 |
- // Template is the object that describes the pod that will be created if |
|
| 295 |
- // insufficient replicas are detected. |
|
| 296 |
- Template *kapi.PodTemplateSpec `json:"template,omitempty"` |
|
| 297 |
-} |
|
| 298 |
- |
|
| 299 |
-type DeploymentConfigStatus struct {
|
|
| 300 |
- // LatestVersion is used to determine whether the current deployment associated with a deployment |
|
| 301 |
- // config is out of sync. |
|
| 302 |
- LatestVersion int64 `json:"latestVersion,omitempty"` |
|
| 303 |
- // ObservedGeneration is the most recent generation observed by the deployment config controller. |
|
| 304 |
- ObservedGeneration int64 `json:"observedGeneration,omitempty"` |
|
| 305 |
- // Replicas is the total number of pods targeted by this deployment config. |
|
| 306 |
- Replicas int32 `json:"replicas,omitempty"` |
|
| 307 |
- // UpdatedReplicas is the total number of non-terminated pods targeted by this deployment config |
|
| 308 |
- // that have the desired template spec. |
|
| 309 |
- UpdatedReplicas int32 `json:"updatedReplicas,omitempty"` |
|
| 310 |
- // AvailableReplicas is the total number of available pods targeted by this deployment config. |
|
| 311 |
- AvailableReplicas int32 `json:"availableReplicas,omitempty"` |
|
| 312 |
- // UnavailableReplicas is the total number of unavailable pods targeted by this deployment config. |
|
| 313 |
- UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` |
|
| 314 |
- // The reasons for the update to this deployment config. |
|
| 315 |
- // This could be based on a change made by the user or caused by an automatic trigger |
|
| 316 |
- Details *DeploymentDetails `json:"details,omitempty"` |
|
| 317 |
-} |
|
| 318 |
- |
|
| 319 |
-// DeploymentTriggerPolicy describes a policy for a single trigger that results in a new deployment. |
|
| 320 |
-type DeploymentTriggerPolicy struct {
|
|
| 321 |
- Type DeploymentTriggerType `json:"type,omitempty"` |
|
| 322 |
- // ImageChangeParams represents the parameters for the ImageChange trigger. |
|
| 323 |
- ImageChangeParams *DeploymentTriggerImageChangeParams `json:"imageChangeParams,omitempty"` |
|
| 324 |
-} |
|
| 325 |
- |
|
| 326 |
-// DeploymentTriggerType refers to a specific DeploymentTriggerPolicy implementation. |
|
| 327 |
-type DeploymentTriggerType string |
|
| 328 |
- |
|
| 329 |
-const ( |
|
| 330 |
- // DeploymentTriggerOnImageChange will create new deployments in response to updated tags from |
|
| 331 |
- // a Docker image repository. |
|
| 332 |
- DeploymentTriggerOnImageChange DeploymentTriggerType = "ImageChange" |
|
| 333 |
- // DeploymentTriggerOnConfigChange will create new deployments in response to changes to |
|
| 334 |
- // the ControllerTemplate of a DeploymentConfig. |
|
| 335 |
- DeploymentTriggerOnConfigChange DeploymentTriggerType = "ConfigChange" |
|
| 336 |
-) |
|
| 337 |
- |
|
| 338 |
-// DeploymentTriggerImageChangeParams represents the parameters to the ImageChange trigger. |
|
| 339 |
-type DeploymentTriggerImageChangeParams struct {
|
|
| 340 |
- // Automatic means that the detection of a new tag value should result in an image update |
|
| 341 |
- // inside the pod template. Deployment configs that haven't been deployed yet will always |
|
| 342 |
- // have their images updated. Deployment configs that have been deployed at least once, will |
|
| 343 |
- // have their images updated only if this is set to true. |
|
| 344 |
- Automatic bool `json:"automatic,omitempty"` |
|
| 345 |
- // ContainerNames is used to restrict tag updates to the specified set of container names in a pod. |
|
| 346 |
- ContainerNames []string `json:"containerNames,omitempty"` |
|
| 347 |
- // From is a reference to an image stream tag to watch for changes. From.Name is the only |
|
| 348 |
- // required subfield - if From.Namespace is blank, the namespace of the current deployment |
|
| 349 |
- // trigger will be used. |
|
| 350 |
- From kapi.ObjectReference `json:"from"` |
|
| 351 |
- // LastTriggeredImage is the last image to be triggered. |
|
| 352 |
- LastTriggeredImage string `json:"lastTriggeredImage"` |
|
| 353 |
-} |
|
| 354 |
- |
|
| 355 |
-// DeploymentDetails captures information about the causes of a deployment. |
|
| 356 |
-type DeploymentDetails struct {
|
|
| 357 |
- // The user specified change message, if this deployment was triggered manually by the user |
|
| 358 |
- Message string `json:"message,omitempty"` |
|
| 359 |
- // Extended data associated with all the causes for creating a new deployment |
|
| 360 |
- Causes []DeploymentCause `json:"causes"` |
|
| 361 |
-} |
|
| 362 |
- |
|
| 363 |
-// DeploymentCause captures information about a particular cause of a deployment. |
|
| 364 |
-type DeploymentCause struct {
|
|
| 365 |
- // The type of the trigger that resulted in the creation of a new deployment |
|
| 366 |
- Type DeploymentTriggerType `json:"type"` |
|
| 367 |
- // The image trigger details, if this trigger was fired based on an image change |
|
| 368 |
- ImageTrigger *DeploymentCauseImageTrigger `json:"imageTrigger,omitempty"` |
|
| 369 |
-} |
|
| 370 |
- |
|
| 371 |
-// DeploymentCauseImageTrigger represents details about the cause of a deployment originating |
|
| 372 |
-// from an image change trigger |
|
| 373 |
-type DeploymentCauseImageTrigger struct {
|
|
| 374 |
- // From is a reference to the changed object which triggered a deployment. The field may have |
|
| 375 |
- // the kinds DockerImage, ImageStreamTag, or ImageStreamImage. |
|
| 376 |
- From kapi.ObjectReference `json:"from"` |
|
| 377 |
-} |
|
| 378 |
- |
|
| 379 |
-// A DeploymentConfigList is a collection of deployment configs. |
|
| 380 |
-type DeploymentConfigList struct {
|
|
| 381 |
- unversioned.TypeMeta `json:",inline"` |
|
| 382 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 383 |
- Items []DeploymentConfig `json:"items"` |
|
| 384 |
-} |
|
| 385 |
- |
|
| 386 |
-// DeploymentConfigRollback provides the input to rollback generation. |
|
| 387 |
-type DeploymentConfigRollback struct {
|
|
| 388 |
- unversioned.TypeMeta `json:",inline"` |
|
| 389 |
- // Name of the deployment config that will be rolled back. |
|
| 390 |
- Name string `json:"name"` |
|
| 391 |
- // UpdatedAnnotations is a set of new annotations that will be added in the deployment config. |
|
| 392 |
- UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty"` |
|
| 393 |
- // Spec defines the options to rollback generation. |
|
| 394 |
- Spec DeploymentConfigRollbackSpec `json:"spec"` |
|
| 395 |
-} |
|
| 396 |
- |
|
| 397 |
-// DeploymentConfigRollbackSpec represents the options for rollback generation. |
|
| 398 |
-type DeploymentConfigRollbackSpec struct {
|
|
| 399 |
- // From points to a ReplicationController which is a deployment. |
|
| 400 |
- From kapi.ObjectReference `json:"from"` |
|
| 401 |
- // Revision to rollback to. If set to 0, rollback to the last revision. |
|
| 402 |
- Revision int64 `json:"revision,omitempty"` |
|
| 403 |
- // IncludeTriggers specifies whether to include config Triggers. |
|
| 404 |
- IncludeTriggers bool `json:"includeTriggers"` |
|
| 405 |
- // IncludeTemplate specifies whether to include the PodTemplateSpec. |
|
| 406 |
- IncludeTemplate bool `json:"includeTemplate"` |
|
| 407 |
- // IncludeReplicationMeta specifies whether to include the replica count and selector. |
|
| 408 |
- IncludeReplicationMeta bool `json:"includeReplicationMeta"` |
|
| 409 |
- // IncludeStrategy specifies whether to include the deployment Strategy. |
|
| 410 |
- IncludeStrategy bool `json:"includeStrategy"` |
|
| 411 |
-} |
|
| 412 |
- |
|
| 413 |
-// DeploymentLog represents the logs for a deployment |
|
| 414 |
-type DeploymentLog struct {
|
|
| 415 |
- unversioned.TypeMeta `json:",inline"` |
|
| 416 |
-} |
|
| 417 |
- |
|
| 418 |
-// DeploymentLogOptions is the REST options for a deployment log |
|
| 419 |
-type DeploymentLogOptions struct {
|
|
| 420 |
- unversioned.TypeMeta `json:",inline"` |
|
| 421 |
- |
|
| 422 |
- // The container for which to stream logs. Defaults to only container if there is one container in the pod. |
|
| 423 |
- Container string `json:"container,omitempty"` |
|
| 424 |
- // Follow if true indicates that the build log should be streamed until |
|
| 425 |
- // the build terminates. |
|
| 426 |
- Follow bool `json:"follow,omitempty"` |
|
| 427 |
- // Return previous deployment logs. Defaults to false. |
|
| 428 |
- Previous bool `json:"previous,omitempty"` |
|
| 429 |
- // A relative time in seconds before the current time from which to show logs. If this value |
|
| 430 |
- // precedes the time a pod was started, only logs since the pod start will be returned. |
|
| 431 |
- // If this value is in the future, no logs will be returned. |
|
| 432 |
- // Only one of sinceSeconds or sinceTime may be specified. |
|
| 433 |
- SinceSeconds *int64 `json:"sinceSeconds,omitempty"` |
|
| 434 |
- // An RFC3339 timestamp from which to show logs. If this value |
|
| 435 |
- // precedes the time a pod was started, only logs since the pod start will be returned. |
|
| 436 |
- // If this value is in the future, no logs will be returned. |
|
| 437 |
- // Only one of sinceSeconds or sinceTime may be specified. |
|
| 438 |
- SinceTime *unversioned.Time `json:"sinceTime,omitempty"` |
|
| 439 |
- // If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line |
|
| 440 |
- // of log output. Defaults to false. |
|
| 441 |
- Timestamps bool `json:"timestamps,omitempty"` |
|
| 442 |
- // If set, the number of lines from the end of the logs to show. If not specified, |
|
| 443 |
- // logs are shown from the creation of the container or sinceSeconds or sinceTime |
|
| 444 |
- TailLines *int64 `json:"tailLines,omitempty"` |
|
| 445 |
- // If set, the number of bytes to read from the server before terminating the |
|
| 446 |
- // log output. This may not display a complete final line of logging, and may return |
|
| 447 |
- // slightly more or slightly less than the specified limit. |
|
| 448 |
- LimitBytes *int64 `json:"limitBytes,omitempty"` |
|
| 449 |
- |
|
| 450 |
- // NoWait if true causes the call to return immediately even if the deployment |
|
| 451 |
- // is not available yet. Otherwise the server will wait until the deployment has started. |
|
| 452 |
- NoWait bool `json:"nowait,omitempty"` |
|
| 453 |
- |
|
| 454 |
- // Version of the deployment for which to view logs. |
|
| 455 |
- Version *int64 `json:"version,omitempty"` |
|
| 456 |
-} |
| ... | ... |
@@ -17,7 +17,6 @@ import ( |
| 17 | 17 |
"github.com/openshift/origin/pkg/image/api/docker10" |
| 18 | 18 |
"github.com/openshift/origin/pkg/image/api/dockerpre012" |
| 19 | 19 |
"github.com/openshift/origin/pkg/image/api/v1" |
| 20 |
- "github.com/openshift/origin/pkg/image/api/v1beta3" |
|
| 21 | 20 |
) |
| 22 | 21 |
|
| 23 | 22 |
const importPrefix = "github.com/openshift/origin/pkg/image/api" |
| ... | ... |
@@ -25,7 +24,7 @@ const importPrefix = "github.com/openshift/origin/pkg/image/api" |
| 25 | 25 |
var accessor = meta.NewAccessor() |
| 26 | 26 |
|
| 27 | 27 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 28 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, docker10.SchemeGroupVersion, dockerpre012.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 28 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, docker10.SchemeGroupVersion, dockerpre012.SchemeGroupVersion}
|
|
| 29 | 29 |
|
| 30 | 30 |
func init() {
|
| 31 | 31 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -83,8 +82,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 83 | 83 |
switch v {
|
| 84 | 84 |
case v1.SchemeGroupVersion: |
| 85 | 85 |
v1.AddToScheme(kapi.Scheme) |
| 86 |
- case v1beta3.SchemeGroupVersion: |
|
| 87 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 88 | 86 |
case docker10.SchemeGroupVersion: |
| 89 | 87 |
docker10.AddToScheme(kapi.Scheme) |
| 90 | 88 |
case dockerpre012.SchemeGroupVersion: |
| ... | ... |
@@ -111,12 +108,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 111 | 111 |
MetadataAccessor: accessor, |
| 112 | 112 |
}, nil |
| 113 | 113 |
|
| 114 |
- case v1beta3.SchemeGroupVersion: |
|
| 115 |
- return &meta.VersionInterfaces{
|
|
| 116 |
- ObjectConvertor: kapi.Scheme, |
|
| 117 |
- MetadataAccessor: accessor, |
|
| 118 |
- }, nil |
|
| 119 |
- |
|
| 120 | 114 |
case docker10.SchemeGroupVersion: |
| 121 | 115 |
return &meta.VersionInterfaces{
|
| 122 | 116 |
ObjectConvertor: kapi.Scheme, |
| 123 | 117 |
deleted file mode 100644 |
| ... | ... |
@@ -1,318 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "fmt" |
|
| 5 |
- "sort" |
|
| 6 |
- "strings" |
|
| 7 |
- |
|
| 8 |
- "k8s.io/kubernetes/pkg/api" |
|
| 9 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 10 |
- "k8s.io/kubernetes/pkg/conversion" |
|
| 11 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 12 |
- |
|
| 13 |
- newer "github.com/openshift/origin/pkg/image/api" |
|
| 14 |
-) |
|
| 15 |
- |
|
| 16 |
-// The docker metadata must be cast to a version |
|
| 17 |
-func Convert_api_Image_To_v1beta3_Image(in *newer.Image, out *Image, s conversion.Scope) error {
|
|
| 18 |
- if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
| 19 |
- return err |
|
| 20 |
- } |
|
| 21 |
- |
|
| 22 |
- out.DockerImageReference = in.DockerImageReference |
|
| 23 |
- out.DockerImageManifest = in.DockerImageManifest |
|
| 24 |
- out.DockerImageManifestMediaType = in.DockerImageManifestMediaType |
|
| 25 |
- out.DockerImageConfig = in.DockerImageConfig |
|
| 26 |
- |
|
| 27 |
- gvString := in.DockerImageMetadataVersion |
|
| 28 |
- if len(gvString) == 0 {
|
|
| 29 |
- gvString = "1.0" |
|
| 30 |
- } |
|
| 31 |
- if !strings.Contains(gvString, "/") {
|
|
| 32 |
- gvString = "/" + gvString |
|
| 33 |
- } |
|
| 34 |
- |
|
| 35 |
- version, err := unversioned.ParseGroupVersion(gvString) |
|
| 36 |
- if err != nil {
|
|
| 37 |
- return err |
|
| 38 |
- } |
|
| 39 |
- data, err := runtime.Encode(api.Codecs.LegacyCodec(version), &in.DockerImageMetadata, version) |
|
| 40 |
- if err != nil {
|
|
| 41 |
- return err |
|
| 42 |
- } |
|
| 43 |
- out.DockerImageMetadata.Raw = data |
|
| 44 |
- out.DockerImageMetadataVersion = version.Version |
|
| 45 |
- |
|
| 46 |
- return nil |
|
| 47 |
-} |
|
| 48 |
- |
|
| 49 |
-func Convert_v1beta3_Image_To_api_Image(in *Image, out *newer.Image, s conversion.Scope) error {
|
|
| 50 |
- if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
| 51 |
- return err |
|
| 52 |
- } |
|
| 53 |
- |
|
| 54 |
- out.DockerImageReference = in.DockerImageReference |
|
| 55 |
- out.DockerImageManifest = in.DockerImageManifest |
|
| 56 |
- out.DockerImageManifestMediaType = in.DockerImageManifestMediaType |
|
| 57 |
- out.DockerImageConfig = in.DockerImageConfig |
|
| 58 |
- |
|
| 59 |
- version := in.DockerImageMetadataVersion |
|
| 60 |
- if len(version) == 0 {
|
|
| 61 |
- version = "1.0" |
|
| 62 |
- } |
|
| 63 |
- if len(in.DockerImageMetadata.Raw) > 0 {
|
|
| 64 |
- // TODO: add a way to default the expected kind and version of an object if not set |
|
| 65 |
- obj, err := api.Scheme.New(unversioned.GroupVersionKind{Version: version, Kind: "DockerImage"})
|
|
| 66 |
- if err != nil {
|
|
| 67 |
- return err |
|
| 68 |
- } |
|
| 69 |
- if err := runtime.DecodeInto(api.Codecs.UniversalDecoder(), in.DockerImageMetadata.Raw, obj); err != nil {
|
|
| 70 |
- return err |
|
| 71 |
- } |
|
| 72 |
- if err := s.Convert(obj, &out.DockerImageMetadata, 0); err != nil {
|
|
| 73 |
- return err |
|
| 74 |
- } |
|
| 75 |
- } |
|
| 76 |
- out.DockerImageMetadataVersion = version |
|
| 77 |
- |
|
| 78 |
- return nil |
|
| 79 |
-} |
|
| 80 |
- |
|
| 81 |
-func Convert_v1beta3_ImageStreamSpec_To_api_ImageStreamSpec(in *ImageStreamSpec, out *newer.ImageStreamSpec, s conversion.Scope) error {
|
|
| 82 |
- out.DockerImageRepository = in.DockerImageRepository |
|
| 83 |
- if len(in.DockerImageRepository) > 0 {
|
|
| 84 |
- // ensure that stored image references have no tag or ID, which was possible from 1.0.0 until 1.0.7 |
|
| 85 |
- if ref, err := newer.ParseDockerImageReference(in.DockerImageRepository); err == nil {
|
|
| 86 |
- if len(ref.Tag) > 0 || len(ref.ID) > 0 {
|
|
| 87 |
- ref.Tag, ref.ID = "", "" |
|
| 88 |
- out.DockerImageRepository = ref.Exact() |
|
| 89 |
- } |
|
| 90 |
- } |
|
| 91 |
- } |
|
| 92 |
- out.Tags = make(map[string]newer.TagReference) |
|
| 93 |
- return s.Convert(&in.Tags, &out.Tags, 0) |
|
| 94 |
-} |
|
| 95 |
- |
|
| 96 |
-func Convert_api_ImageStreamSpec_To_v1beta3_ImageStreamSpec(in *newer.ImageStreamSpec, out *ImageStreamSpec, s conversion.Scope) error {
|
|
| 97 |
- out.DockerImageRepository = in.DockerImageRepository |
|
| 98 |
- out.Tags = make([]TagReference, 0, 0) |
|
| 99 |
- return s.Convert(&in.Tags, &out.Tags, 0) |
|
| 100 |
-} |
|
| 101 |
- |
|
| 102 |
-func Convert_v1beta3_ImageStreamStatus_To_api_ImageStreamStatus(in *ImageStreamStatus, out *newer.ImageStreamStatus, s conversion.Scope) error {
|
|
| 103 |
- out.DockerImageRepository = in.DockerImageRepository |
|
| 104 |
- if len(in.DockerImageRepository) > 0 {
|
|
| 105 |
- // ensure that stored image references have no tag or ID, which was possible from 1.0.0 until 1.0.7 |
|
| 106 |
- if ref, err := newer.ParseDockerImageReference(in.DockerImageRepository); err == nil {
|
|
| 107 |
- if len(ref.Tag) > 0 || len(ref.ID) > 0 {
|
|
| 108 |
- ref.Tag, ref.ID = "", "" |
|
| 109 |
- out.DockerImageRepository = ref.Exact() |
|
| 110 |
- } |
|
| 111 |
- } |
|
| 112 |
- } |
|
| 113 |
- out.Tags = make(map[string]newer.TagEventList) |
|
| 114 |
- return s.Convert(&in.Tags, &out.Tags, 0) |
|
| 115 |
-} |
|
| 116 |
- |
|
| 117 |
-func Convert_api_ImageStreamStatus_To_v1beta3_ImageStreamStatus(in *newer.ImageStreamStatus, out *ImageStreamStatus, s conversion.Scope) error {
|
|
| 118 |
- out.DockerImageRepository = in.DockerImageRepository |
|
| 119 |
- out.Tags = make([]NamedTagEventList, 0, 0) |
|
| 120 |
- return s.Convert(&in.Tags, &out.Tags, 0) |
|
| 121 |
-} |
|
| 122 |
- |
|
| 123 |
-func Convert_api_ImageStreamMapping_To_v1beta3_ImageStreamMapping(in *newer.ImageStreamMapping, out *ImageStreamMapping, s conversion.Scope) error {
|
|
| 124 |
- return s.DefaultConvert(in, out, conversion.DestFromSource) |
|
| 125 |
-} |
|
| 126 |
- |
|
| 127 |
-func Convert_v1beta3_ImageStreamMapping_To_api_ImageStreamMapping(in *ImageStreamMapping, out *newer.ImageStreamMapping, s conversion.Scope) error {
|
|
| 128 |
- return s.DefaultConvert(in, out, conversion.SourceToDest) |
|
| 129 |
-} |
|
| 130 |
- |
|
| 131 |
-func Convert_api_ImageStream_To_v1beta3_ImageStream(in *newer.ImageStream, out *ImageStream, s conversion.Scope) error {
|
|
| 132 |
- if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
| 133 |
- return err |
|
| 134 |
- } |
|
| 135 |
- if err := s.Convert(&in.Spec, &out.Spec, 0); err != nil {
|
|
| 136 |
- return err |
|
| 137 |
- } |
|
| 138 |
- return s.Convert(&in.Status, &out.Status, 0) |
|
| 139 |
-} |
|
| 140 |
- |
|
| 141 |
-func Convert_v1beta3_ImageStream_To_api_ImageStream(in *ImageStream, out *newer.ImageStream, s conversion.Scope) error {
|
|
| 142 |
- if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
| 143 |
- return err |
|
| 144 |
- } |
|
| 145 |
- if err := s.Convert(&in.Spec, &out.Spec, 0); err != nil {
|
|
| 146 |
- return err |
|
| 147 |
- } |
|
| 148 |
- return s.Convert(&in.Status, &out.Status, 0) |
|
| 149 |
-} |
|
| 150 |
- |
|
| 151 |
-func Convert_api_ImageStreamImage_To_v1beta3_ImageStreamImage(in *newer.ImageStreamImage, out *ImageStreamImage, s conversion.Scope) error {
|
|
| 152 |
- if err := s.Convert(&in.Image, &out.Image, 0); err != nil {
|
|
| 153 |
- return err |
|
| 154 |
- } |
|
| 155 |
- |
|
| 156 |
- if err := s.Convert(&in.Image.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
| 157 |
- return err |
|
| 158 |
- } |
|
| 159 |
- |
|
| 160 |
- out.ImageName = in.Image.Name |
|
| 161 |
- out.Name = in.Name |
|
| 162 |
- |
|
| 163 |
- return nil |
|
| 164 |
-} |
|
| 165 |
- |
|
| 166 |
-func Convert_v1beta3_ImageStreamImage_To_api_ImageStreamImage(in *ImageStreamImage, out *newer.ImageStreamImage, s conversion.Scope) error {
|
|
| 167 |
- imageName := in.ImageName |
|
| 168 |
- isiName := in.Name |
|
| 169 |
- |
|
| 170 |
- if err := s.Convert(&in.Image, &out.Image, 0); err != nil {
|
|
| 171 |
- return err |
|
| 172 |
- } |
|
| 173 |
- |
|
| 174 |
- if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
| 175 |
- return err |
|
| 176 |
- } |
|
| 177 |
- |
|
| 178 |
- out.Image.Name = imageName |
|
| 179 |
- out.Name = isiName |
|
| 180 |
- |
|
| 181 |
- return nil |
|
| 182 |
-} |
|
| 183 |
- |
|
| 184 |
-func Convert_api_ImageStreamTag_To_v1beta3_ImageStreamTag(in *newer.ImageStreamTag, out *ImageStreamTag, s conversion.Scope) error {
|
|
| 185 |
- if err := s.Convert(&in.Image, &out.Image, 0); err != nil {
|
|
| 186 |
- return err |
|
| 187 |
- } |
|
| 188 |
- |
|
| 189 |
- if err := s.Convert(&in.Image.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
| 190 |
- return err |
|
| 191 |
- } |
|
| 192 |
- |
|
| 193 |
- out.ImageName = in.Image.Name |
|
| 194 |
- out.Name = in.Name |
|
| 195 |
- |
|
| 196 |
- return nil |
|
| 197 |
-} |
|
| 198 |
- |
|
| 199 |
-func Convert_v1beta3_ImageStreamTag_To_api_ImageStreamTag(in *ImageStreamTag, out *newer.ImageStreamTag, s conversion.Scope) error {
|
|
| 200 |
- imageName := in.ImageName |
|
| 201 |
- istName := in.Name |
|
| 202 |
- |
|
| 203 |
- if err := s.Convert(&in.Image, &out.Image, 0); err != nil {
|
|
| 204 |
- return err |
|
| 205 |
- } |
|
| 206 |
- |
|
| 207 |
- if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
| 208 |
- return err |
|
| 209 |
- } |
|
| 210 |
- |
|
| 211 |
- out.Image.Name = imageName |
|
| 212 |
- out.Name = istName |
|
| 213 |
- |
|
| 214 |
- return nil |
|
| 215 |
-} |
|
| 216 |
-func addConversionFuncs(scheme *runtime.Scheme) {
|
|
| 217 |
- err := scheme.AddConversionFuncs( |
|
| 218 |
- func(in *[]NamedTagEventList, out *map[string]newer.TagEventList, s conversion.Scope) error {
|
|
| 219 |
- for _, curr := range *in {
|
|
| 220 |
- newTagEventList := newer.TagEventList{}
|
|
| 221 |
- if err := s.Convert(&curr.Conditions, &newTagEventList.Conditions, 0); err != nil {
|
|
| 222 |
- return err |
|
| 223 |
- } |
|
| 224 |
- if err := s.Convert(&curr.Items, &newTagEventList.Items, 0); err != nil {
|
|
| 225 |
- return err |
|
| 226 |
- } |
|
| 227 |
- (*out)[curr.Tag] = newTagEventList |
|
| 228 |
- } |
|
| 229 |
- |
|
| 230 |
- return nil |
|
| 231 |
- }, |
|
| 232 |
- func(in *map[string]newer.TagEventList, out *[]NamedTagEventList, s conversion.Scope) error {
|
|
| 233 |
- allKeys := make([]string, 0, len(*in)) |
|
| 234 |
- for key := range *in {
|
|
| 235 |
- allKeys = append(allKeys, key) |
|
| 236 |
- } |
|
| 237 |
- sort.Strings(allKeys) |
|
| 238 |
- |
|
| 239 |
- for _, key := range allKeys {
|
|
| 240 |
- newTagEventList := (*in)[key] |
|
| 241 |
- oldTagEventList := &NamedTagEventList{Tag: key}
|
|
| 242 |
- if err := s.Convert(&newTagEventList.Conditions, &oldTagEventList.Conditions, 0); err != nil {
|
|
| 243 |
- return err |
|
| 244 |
- } |
|
| 245 |
- if err := s.Convert(&newTagEventList.Items, &oldTagEventList.Items, 0); err != nil {
|
|
| 246 |
- return err |
|
| 247 |
- } |
|
| 248 |
- |
|
| 249 |
- *out = append(*out, *oldTagEventList) |
|
| 250 |
- } |
|
| 251 |
- |
|
| 252 |
- return nil |
|
| 253 |
- }, |
|
| 254 |
- func(in *[]TagReference, out *map[string]newer.TagReference, s conversion.Scope) error {
|
|
| 255 |
- for _, curr := range *in {
|
|
| 256 |
- r := newer.TagReference{}
|
|
| 257 |
- if err := s.Convert(&curr, &r, 0); err != nil {
|
|
| 258 |
- return err |
|
| 259 |
- } |
|
| 260 |
- (*out)[curr.Name] = r |
|
| 261 |
- } |
|
| 262 |
- return nil |
|
| 263 |
- }, |
|
| 264 |
- func(in *map[string]newer.TagReference, out *[]TagReference, s conversion.Scope) error {
|
|
| 265 |
- allTags := make([]string, 0, len(*in)) |
|
| 266 |
- for tag := range *in {
|
|
| 267 |
- allTags = append(allTags, tag) |
|
| 268 |
- } |
|
| 269 |
- sort.Strings(allTags) |
|
| 270 |
- |
|
| 271 |
- for _, tag := range allTags {
|
|
| 272 |
- newTagReference := (*in)[tag] |
|
| 273 |
- oldTagReference := TagReference{}
|
|
| 274 |
- if err := s.Convert(&newTagReference, &oldTagReference, 0); err != nil {
|
|
| 275 |
- return err |
|
| 276 |
- } |
|
| 277 |
- oldTagReference.Name = tag |
|
| 278 |
- *out = append(*out, oldTagReference) |
|
| 279 |
- } |
|
| 280 |
- return nil |
|
| 281 |
- }, |
|
| 282 |
- |
|
| 283 |
- Convert_api_Image_To_v1beta3_Image, |
|
| 284 |
- Convert_v1beta3_Image_To_api_Image, |
|
| 285 |
- Convert_v1beta3_ImageStreamSpec_To_api_ImageStreamSpec, |
|
| 286 |
- Convert_api_ImageStreamSpec_To_v1beta3_ImageStreamSpec, |
|
| 287 |
- Convert_v1beta3_ImageStreamStatus_To_api_ImageStreamStatus, |
|
| 288 |
- Convert_api_ImageStreamStatus_To_v1beta3_ImageStreamStatus, |
|
| 289 |
- Convert_api_ImageStreamMapping_To_v1beta3_ImageStreamMapping, |
|
| 290 |
- Convert_v1beta3_ImageStreamMapping_To_api_ImageStreamMapping, |
|
| 291 |
- Convert_api_ImageStream_To_v1beta3_ImageStream, |
|
| 292 |
- Convert_v1beta3_ImageStream_To_api_ImageStream, |
|
| 293 |
- Convert_api_ImageStreamImage_To_v1beta3_ImageStreamImage, |
|
| 294 |
- Convert_v1beta3_ImageStreamImage_To_api_ImageStreamImage, |
|
| 295 |
- Convert_api_ImageStreamTag_To_v1beta3_ImageStreamTag, |
|
| 296 |
- Convert_v1beta3_ImageStreamTag_To_api_ImageStreamTag, |
|
| 297 |
- ) |
|
| 298 |
- if err != nil {
|
|
| 299 |
- // If one of the conversion functions is malformed, detect it immediately. |
|
| 300 |
- panic(err) |
|
| 301 |
- } |
|
| 302 |
- |
|
| 303 |
- err = scheme.AddFieldLabelConversionFunc("v1beta3", "ImageStream",
|
|
| 304 |
- func(label, value string) (string, string, error) {
|
|
| 305 |
- switch label {
|
|
| 306 |
- case "name": |
|
| 307 |
- return "metadata.name", value, nil |
|
| 308 |
- case "metadata.name", "spec.dockerImageRepository", "status.dockerImageRepository": |
|
| 309 |
- return label, value, nil |
|
| 310 |
- default: |
|
| 311 |
- return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 312 |
- } |
|
| 313 |
- }) |
|
| 314 |
- if err != nil {
|
|
| 315 |
- // If one of the conversion functions is malformed, detect it immediately. |
|
| 316 |
- panic(err) |
|
| 317 |
- } |
|
| 318 |
-} |
| 319 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,49 +0,0 @@ |
| 1 |
-package v1beta3_test |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "reflect" |
|
| 5 |
- "testing" |
|
| 6 |
- |
|
| 7 |
- kapi "k8s.io/kubernetes/pkg/api" |
|
| 8 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 9 |
- "k8s.io/kubernetes/pkg/util/diff" |
|
| 10 |
- |
|
| 11 |
- newer "github.com/openshift/origin/pkg/image/api" |
|
| 12 |
- "github.com/openshift/origin/pkg/image/api/v1beta3" |
|
| 13 |
- |
|
| 14 |
- _ "github.com/openshift/origin/pkg/api/install" |
|
| 15 |
-) |
|
| 16 |
- |
|
| 17 |
-var Convert = kapi.Scheme.Convert |
|
| 18 |
- |
|
| 19 |
-func TestRoundTripVersionedObject(t *testing.T) {
|
|
| 20 |
- d := &newer.DockerImage{
|
|
| 21 |
- Config: &newer.DockerConfig{
|
|
| 22 |
- Env: []string{"A=1", "B=2"},
|
|
| 23 |
- }, |
|
| 24 |
- } |
|
| 25 |
- i := &newer.Image{
|
|
| 26 |
- ObjectMeta: kapi.ObjectMeta{Name: "foo"},
|
|
| 27 |
- |
|
| 28 |
- DockerImageMetadata: *d, |
|
| 29 |
- DockerImageReference: "foo/bar/baz", |
|
| 30 |
- } |
|
| 31 |
- |
|
| 32 |
- data, err := runtime.Encode(kapi.Codecs.LegacyCodec(v1beta3.SchemeGroupVersion), i) |
|
| 33 |
- if err != nil {
|
|
| 34 |
- t.Fatalf("unexpected error: %v", err)
|
|
| 35 |
- } |
|
| 36 |
- |
|
| 37 |
- obj, err := runtime.Decode(kapi.Codecs.UniversalDecoder(), data) |
|
| 38 |
- if err != nil {
|
|
| 39 |
- t.Fatalf("unexpected error: %v", err)
|
|
| 40 |
- } |
|
| 41 |
- image := obj.(*newer.Image) |
|
| 42 |
- if image.DockerImageMetadataVersion != "1.0" {
|
|
| 43 |
- t.Errorf("did not default to correct metadata version: %#v", image)
|
|
| 44 |
- } |
|
| 45 |
- image.DockerImageMetadataVersion = "" |
|
| 46 |
- if !reflect.DeepEqual(i, image) {
|
|
| 47 |
- t.Errorf("unable to round trip object: %s", diff.ObjectDiff(i, image))
|
|
| 48 |
- } |
|
| 49 |
-} |
| 50 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,44 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
- |
|
| 7 |
- "github.com/openshift/origin/pkg/image/api/docker10" |
|
| 8 |
- "github.com/openshift/origin/pkg/image/api/dockerpre012" |
|
| 9 |
-) |
|
| 10 |
- |
|
| 11 |
-const GroupName = "" |
|
| 12 |
- |
|
| 13 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 14 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 15 |
- |
|
| 16 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 17 |
- docker10.AddToScheme(scheme) |
|
| 18 |
- dockerpre012.AddToScheme(scheme) |
|
| 19 |
- addKnownTypes(scheme) |
|
| 20 |
- addConversionFuncs(scheme) |
|
| 21 |
-} |
|
| 22 |
- |
|
| 23 |
-// Adds the list of known types to api.Scheme. |
|
| 24 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 25 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 26 |
- &Image{},
|
|
| 27 |
- &ImageList{},
|
|
| 28 |
- &ImageStream{},
|
|
| 29 |
- &ImageStreamList{},
|
|
| 30 |
- &ImageStreamMapping{},
|
|
| 31 |
- &ImageStreamTag{},
|
|
| 32 |
- &ImageStreamTagList{},
|
|
| 33 |
- &ImageStreamImage{},
|
|
| 34 |
- ) |
|
| 35 |
-} |
|
| 36 |
- |
|
| 37 |
-func (obj *Image) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 38 |
-func (obj *ImageList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 39 |
-func (obj *ImageStream) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 40 |
-func (obj *ImageStreamList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 41 |
-func (obj *ImageStreamMapping) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 42 |
-func (obj *ImageStreamTag) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 43 |
-func (obj *ImageStreamTagList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 44 |
-func (obj *ImageStreamImage) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 45 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,269 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 6 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 7 |
-) |
|
| 8 |
- |
|
| 9 |
-// ImageList is a list of Image objects. |
|
| 10 |
-type ImageList struct {
|
|
| 11 |
- unversioned.TypeMeta `json:",inline"` |
|
| 12 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 13 |
- |
|
| 14 |
- Items []Image `json:"items"` |
|
| 15 |
-} |
|
| 16 |
- |
|
| 17 |
-// Image is an immutable representation of a Docker image and metadata at a point in time. |
|
| 18 |
-type Image struct {
|
|
| 19 |
- unversioned.TypeMeta `json:",inline"` |
|
| 20 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 21 |
- |
|
| 22 |
- // The string that can be used to pull this image. |
|
| 23 |
- DockerImageReference string `json:"dockerImageReference,omitempty"` |
|
| 24 |
- // Metadata about this image |
|
| 25 |
- DockerImageMetadata runtime.RawExtension `json:"dockerImageMetadata,omitempty"` |
|
| 26 |
- // This attribute conveys the version of the object, which if empty defaults to "1.0" |
|
| 27 |
- DockerImageMetadataVersion string `json:"dockerImageMetadataVersion,omitempty"` |
|
| 28 |
- // The raw JSON of the manifest |
|
| 29 |
- DockerImageManifest string `json:"dockerImageManifest,omitempty"` |
|
| 30 |
- // DockerImageLayers represents the layers in the image. May not be set if the image does not define that data. |
|
| 31 |
- DockerImageLayers []ImageLayer `json:"dockerImageLayers"` |
|
| 32 |
- // Signatures holds all signatures of the image. |
|
| 33 |
- Signatures []ImageSignature |
|
| 34 |
- // DockerImageSignatures provides the signatures as opaque blobs. This is a part of manifest schema v1. |
|
| 35 |
- DockerImageSignatures [][]byte `json:"dockerImageSignatures,omitempty"` |
|
| 36 |
- // DockerImageManifestMediaType specifies the mediaType of manifest. This is a part of manifest schema v2. |
|
| 37 |
- DockerImageManifestMediaType string `json:"dockerImageManifestMediaType,omitempty"` |
|
| 38 |
- // DockerImageConfig is a JSON blob that the runtime uses to set up the container. This is a part of manifest schema v2. |
|
| 39 |
- DockerImageConfig string `json:"dockerImageConfig,omitempty"` |
|
| 40 |
-} |
|
| 41 |
- |
|
| 42 |
-// ImageLayer represents a single layer of the image. Some images may have multiple layers. Some may have none. |
|
| 43 |
-type ImageLayer struct {
|
|
| 44 |
- // Name of the layer as defined by the underlying store. |
|
| 45 |
- Name string `json:"name"` |
|
| 46 |
- // Size of the layer as defined by the underlying store. |
|
| 47 |
- Size int64 `json:"size"` |
|
| 48 |
- // MediaType of the referenced object. |
|
| 49 |
- MediaType string `json:"mediaType"` |
|
| 50 |
-} |
|
| 51 |
- |
|
| 52 |
-// ImageSignature holds a signature of an image. It allows to verify image identity and possibly other claims |
|
| 53 |
-// as long as the signature is trusted. Based on this information it is possible to restrict runnable images |
|
| 54 |
-// to those matching cluster-wide policy. |
|
| 55 |
-// There are two mandatory fields provided by client: Type and Content. They should be parsed by clients doing |
|
| 56 |
-// image verification. The others are parsed from signature's content by the server. They serve just an |
|
| 57 |
-// informative purpose. |
|
| 58 |
-type ImageSignature struct {
|
|
| 59 |
- // Required: Describes a type of stored blob. |
|
| 60 |
- Type string `json:"type"` |
|
| 61 |
- // Required: An opaque binary string which is an image's signature. |
|
| 62 |
- Content []byte `json:"content"` |
|
| 63 |
- // Conditions represent the latest available observations of a signature's current state. |
|
| 64 |
- Conditions []SignatureCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` |
|
| 65 |
- |
|
| 66 |
- // Following metadata fields will be set by server if the signature content is successfully parsed and |
|
| 67 |
- // the information available. |
|
| 68 |
- |
|
| 69 |
- // A human readable string representing image's identity. It could be a product name and version, or an |
|
| 70 |
- // image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). |
|
| 71 |
- ImageIdentity string `json:"imageIdentity,omitempty"` |
|
| 72 |
- // Contains claims from the signature. |
|
| 73 |
- SignedClaims map[string]string `json:"signedClaims,omitempty"` |
|
| 74 |
- // If specified, it is the time of signature's creation. |
|
| 75 |
- Created *unversioned.Time `json:"created,omitempty"` |
|
| 76 |
- // If specified, it holds information about an issuer of signing certificate or key (a person or entity |
|
| 77 |
- // who signed the signing certificate or key). |
|
| 78 |
- IssuedBy *SignatureIssuer `json:"issuedBy,omitempty"` |
|
| 79 |
- // If specified, it holds information about a subject of signing certificate or key (a person or entity |
|
| 80 |
- // who signed the image). |
|
| 81 |
- IssuedTo *SignatureSubject `json:"issuedTo,omitempty"` |
|
| 82 |
-} |
|
| 83 |
- |
|
| 84 |
-/// SignatureConditionType is a type of image signature condition. |
|
| 85 |
-type SignatureConditionType string |
|
| 86 |
- |
|
| 87 |
-// SignatureCondition describes an image signature condition of particular kind at particular probe time. |
|
| 88 |
-type SignatureCondition struct {
|
|
| 89 |
- // Type of job condition, Complete or Failed. |
|
| 90 |
- Type SignatureConditionType `json:"type"` |
|
| 91 |
- // Status of the condition, one of True, False, Unknown. |
|
| 92 |
- Status kapi.ConditionStatus `json:"status"` |
|
| 93 |
- // Last time the condition was checked. |
|
| 94 |
- LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"` |
|
| 95 |
- // Last time the condition transit from one status to another. |
|
| 96 |
- LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"` |
|
| 97 |
- // (brief) reason for the condition's last transition. |
|
| 98 |
- Reason string `json:"reason,omitempty"` |
|
| 99 |
- // Human readable message indicating details about last transition. |
|
| 100 |
- Message string `json:"message,omitempty"` |
|
| 101 |
-} |
|
| 102 |
- |
|
| 103 |
-// SignatureGenericEntity holds a generic information about a person or entity who is an issuer or a subject |
|
| 104 |
-// of signing certificate or key. |
|
| 105 |
-type SignatureGenericEntity struct {
|
|
| 106 |
- // Organization name. |
|
| 107 |
- Organization string `json:"organization,omitempty"` |
|
| 108 |
- // Common name (e.g. openshift-signing-service). |
|
| 109 |
- CommonName string `json:"commonName,omitempty"` |
|
| 110 |
-} |
|
| 111 |
- |
|
| 112 |
-// SignatureIssuer holds information about an issuer of signing certificate or key. |
|
| 113 |
-type SignatureIssuer struct {
|
|
| 114 |
- SignatureGenericEntity `json:",inline"` |
|
| 115 |
-} |
|
| 116 |
- |
|
| 117 |
-// SignatureSubject holds information about a person or entity who created the signature. |
|
| 118 |
-type SignatureSubject struct {
|
|
| 119 |
- SignatureGenericEntity `json:",inline"` |
|
| 120 |
- // If present, it is a human readable key id of public key belonging to the subject used to verify image |
|
| 121 |
- // signature. It should contain at least 64 lowest bits of public key's fingerprint (e.g. |
|
| 122 |
- // 0x685ebe62bf278440). |
|
| 123 |
- PublicKeyID string `json:"publicKeyID"` |
|
| 124 |
-} |
|
| 125 |
- |
|
| 126 |
-// ImageStreamList is a list of ImageStream objects. |
|
| 127 |
-type ImageStreamList struct {
|
|
| 128 |
- unversioned.TypeMeta `json:",inline"` |
|
| 129 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 130 |
- |
|
| 131 |
- Items []ImageStream `json:"items"` |
|
| 132 |
-} |
|
| 133 |
- |
|
| 134 |
-// ImageStream stores a mapping of tags to images, metadata overrides that are applied |
|
| 135 |
-// when images are tagged in a stream, and an optional reference to a Docker image |
|
| 136 |
-// repository on a registry. |
|
| 137 |
-type ImageStream struct {
|
|
| 138 |
- unversioned.TypeMeta `json:",inline"` |
|
| 139 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 140 |
- |
|
| 141 |
- // Spec describes the desired state of this stream |
|
| 142 |
- Spec ImageStreamSpec `json:"spec"` |
|
| 143 |
- // Status describes the current state of this stream |
|
| 144 |
- Status ImageStreamStatus `json:"status,omitempty"` |
|
| 145 |
-} |
|
| 146 |
- |
|
| 147 |
-// ImageStreamSpec represents options for ImageStreams. |
|
| 148 |
-type ImageStreamSpec struct {
|
|
| 149 |
- // Optional, if specified this stream is backed by a Docker repository on this server |
|
| 150 |
- DockerImageRepository string `json:"dockerImageRepository,omitempty"` |
|
| 151 |
- // Tags map arbitrary string values to specific image locators |
|
| 152 |
- Tags []TagReference `json:"tags,omitempty"` |
|
| 153 |
-} |
|
| 154 |
- |
|
| 155 |
-// TagReference specifies optional annotations for images using this tag and an optional reference to an ImageStreamTag, ImageStreamImage, or DockerImage this tag should track. |
|
| 156 |
-type TagReference struct {
|
|
| 157 |
- Name string `json:"name"` |
|
| 158 |
- Annotations map[string]string `json:"annotations"` |
|
| 159 |
- From *kapi.ObjectReference `json:"from,omitempty"` |
|
| 160 |
- // Reference states if the tag will be imported. Default value is false, which means the tag will be imported. |
|
| 161 |
- Reference bool `json:"reference,omitempty"` |
|
| 162 |
- // Generation is the image stream generation that updated this tag - setting it to 0 is an indication that the generation must be updated. |
|
| 163 |
- // Legacy clients will send this as nil, which means the client doesn't know or care. |
|
| 164 |
- Generation *int64 `json:"generation"` |
|
| 165 |
- // Import is information that controls how images may be imported by the server. |
|
| 166 |
- ImportPolicy TagImportPolicy `json:"importPolicy,omitempty"` |
|
| 167 |
-} |
|
| 168 |
- |
|
| 169 |
-type TagImportPolicy struct {
|
|
| 170 |
- // Insecure is true if the server may bypass certificate verification or connect directly over HTTP during image import. |
|
| 171 |
- Insecure bool `json:"insecure,omitempty"` |
|
| 172 |
- // Scheduled indicates to the server that this tag should be periodically checked to ensure it is up to date, and imported |
|
| 173 |
- Scheduled bool `json:"scheduled,omitempty"` |
|
| 174 |
-} |
|
| 175 |
- |
|
| 176 |
-// ImageStreamStatus contains information about the state of this image stream. |
|
| 177 |
-type ImageStreamStatus struct {
|
|
| 178 |
- // Represents the effective location this stream may be accessed at. May be empty until the server |
|
| 179 |
- // determines where the repository is located |
|
| 180 |
- DockerImageRepository string `json:"dockerImageRepository"` |
|
| 181 |
- // A historical record of images associated with each tag. The first entry in the TagEvent array is |
|
| 182 |
- // the currently tagged image. |
|
| 183 |
- Tags []NamedTagEventList `json:"tags,omitempty"` |
|
| 184 |
-} |
|
| 185 |
- |
|
| 186 |
-// NamedTagEventList relates a tag to its image history. |
|
| 187 |
-type NamedTagEventList struct {
|
|
| 188 |
- Tag string `json:"tag"` |
|
| 189 |
- Items []TagEvent `json:"items"` |
|
| 190 |
- // Conditions is an array of conditions that apply to the tag event list. |
|
| 191 |
- Conditions []TagEventCondition `json:"conditions"` |
|
| 192 |
-} |
|
| 193 |
- |
|
| 194 |
-// TagEvent is used by ImageStreamStatus to keep a historical record of images associated with a tag. |
|
| 195 |
-type TagEvent struct {
|
|
| 196 |
- // Created holds the time the TagEvent was created |
|
| 197 |
- Created unversioned.Time `json:"created"` |
|
| 198 |
- // DockerImageReference is the string that can be used to pull this image |
|
| 199 |
- DockerImageReference string `json:"dockerImageReference"` |
|
| 200 |
- // Image is the image |
|
| 201 |
- Image string `json:"image"` |
|
| 202 |
- // Generation is the spec tag generation that resulted in this tag being updated |
|
| 203 |
- Generation int64 `json:"generation"` |
|
| 204 |
-} |
|
| 205 |
- |
|
| 206 |
-type TagEventConditionType string |
|
| 207 |
- |
|
| 208 |
-// These are valid conditions of TagEvents. |
|
| 209 |
-const ( |
|
| 210 |
- // ImportSuccess with status False means the import of the specific tag failed |
|
| 211 |
- ImportSuccess TagEventConditionType = "ImportSuccess" |
|
| 212 |
-) |
|
| 213 |
- |
|
| 214 |
-// TagEventCondition contains condition information for a tag event. |
|
| 215 |
-type TagEventCondition struct {
|
|
| 216 |
- // Type of tag event condition, currently only ImportSuccess |
|
| 217 |
- Type TagEventConditionType `json:"type"` |
|
| 218 |
- // Status of the condition, one of True, False, Unknown. |
|
| 219 |
- Status kapi.ConditionStatus `json:"status"` |
|
| 220 |
- // Last time the condition transit from one status to another. |
|
| 221 |
- LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"` |
|
| 222 |
- // (brief) reason for the condition's last transition. |
|
| 223 |
- Reason string `json:"reason,omitempty"` |
|
| 224 |
- // Human readable message indicating details about last transition. |
|
| 225 |
- Message string `json:"message,omitempty"` |
|
| 226 |
- // Generation is the spec tag generation that this status corresponds to |
|
| 227 |
- Generation int64 `json:"generation"` |
|
| 228 |
-} |
|
| 229 |
- |
|
| 230 |
-// ImageStreamMapping represents a mapping from a single tag to a Docker image as |
|
| 231 |
-// well as the reference to the Docker image repository the image came from. |
|
| 232 |
-type ImageStreamMapping struct {
|
|
| 233 |
- unversioned.TypeMeta `json:",inline"` |
|
| 234 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 235 |
- |
|
| 236 |
- // A Docker image. |
|
| 237 |
- Image Image `json:"image"` |
|
| 238 |
- // A string value this image can be located with inside the repository. |
|
| 239 |
- Tag string `json:"tag"` |
|
| 240 |
-} |
|
| 241 |
- |
|
| 242 |
-// ImageStreamTag represents an Image that is retrieved by tag name from an ImageStream. |
|
| 243 |
-type ImageStreamTag struct {
|
|
| 244 |
- Image `json:",inline"` |
|
| 245 |
- ImageName string `json:"imageName"` |
|
| 246 |
-} |
|
| 247 |
- |
|
| 248 |
-// ImageStreamTagList is a list of ImageStreamTag objects. |
|
| 249 |
-type ImageStreamTagList struct {
|
|
| 250 |
- unversioned.TypeMeta `json:",inline"` |
|
| 251 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 252 |
- |
|
| 253 |
- Items []ImageStreamTag `json:"items"` |
|
| 254 |
-} |
|
| 255 |
- |
|
| 256 |
-// ImageStreamImage represents an Image that is retrieved by image name from an ImageStream. |
|
| 257 |
-type ImageStreamImage struct {
|
|
| 258 |
- Image `json:",inline"` |
|
| 259 |
- ImageName string `json:"imageName"` |
|
| 260 |
-} |
|
| 261 |
- |
|
| 262 |
-// DockerImageReference points to a Docker image. |
|
| 263 |
-type DockerImageReference struct {
|
|
| 264 |
- Registry string |
|
| 265 |
- Namespace string |
|
| 266 |
- Name string |
|
| 267 |
- Tag string |
|
| 268 |
- ID string |
|
| 269 |
-} |
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/openshift/origin/pkg/oauth/api" |
| 17 | 17 |
"github.com/openshift/origin/pkg/oauth/api/v1" |
| 18 |
- "github.com/openshift/origin/pkg/oauth/api/v1beta3" |
|
| 19 | 18 |
) |
| 20 | 19 |
|
| 21 | 20 |
const importPrefix = "github.com/openshift/origin/pkg/oauth/api" |
| ... | ... |
@@ -23,7 +22,7 @@ const importPrefix = "github.com/openshift/origin/pkg/oauth/api" |
| 23 | 23 |
var accessor = meta.NewAccessor() |
| 24 | 24 |
|
| 25 | 25 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 26 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 26 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
|
| 27 | 27 |
|
| 28 | 28 |
func init() {
|
| 29 | 29 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -81,8 +80,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 81 | 81 |
switch v {
|
| 82 | 82 |
case v1.SchemeGroupVersion: |
| 83 | 83 |
v1.AddToScheme(kapi.Scheme) |
| 84 |
- case v1beta3.SchemeGroupVersion: |
|
| 85 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 86 | 84 |
|
| 87 | 85 |
default: |
| 88 | 86 |
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
| ... | ... |
@@ -105,12 +102,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 105 | 105 |
MetadataAccessor: accessor, |
| 106 | 106 |
}, nil |
| 107 | 107 |
|
| 108 |
- case v1beta3.SchemeGroupVersion: |
|
| 109 |
- return &meta.VersionInterfaces{
|
|
| 110 |
- ObjectConvertor: kapi.Scheme, |
|
| 111 |
- MetadataAccessor: accessor, |
|
| 112 |
- }, nil |
|
| 113 |
- |
|
| 114 | 108 |
default: |
| 115 | 109 |
g, _ := registered.Group(api.GroupName) |
| 116 | 110 |
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
| 117 | 111 |
deleted file mode 100644 |
| ... | ... |
@@ -1,38 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-const GroupName = "" |
|
| 9 |
- |
|
| 10 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 11 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 12 |
- |
|
| 13 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 14 |
- addKnownTypes(scheme) |
|
| 15 |
-} |
|
| 16 |
- |
|
| 17 |
-// Adds the list of known types to api.Scheme. |
|
| 18 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 19 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 20 |
- &OAuthAccessToken{},
|
|
| 21 |
- &OAuthAccessTokenList{},
|
|
| 22 |
- &OAuthAuthorizeToken{},
|
|
| 23 |
- &OAuthAuthorizeTokenList{},
|
|
| 24 |
- &OAuthClient{},
|
|
| 25 |
- &OAuthClientList{},
|
|
| 26 |
- &OAuthClientAuthorization{},
|
|
| 27 |
- &OAuthClientAuthorizationList{},
|
|
| 28 |
- ) |
|
| 29 |
-} |
|
| 30 |
- |
|
| 31 |
-func (obj *OAuthClientAuthorizationList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 32 |
-func (obj *OAuthClientAuthorization) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 33 |
-func (obj *OAuthClientList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 34 |
-func (obj *OAuthClient) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 35 |
-func (obj *OAuthAuthorizeTokenList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 36 |
-func (obj *OAuthAuthorizeToken) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 37 |
-func (obj *OAuthAccessTokenList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 38 |
-func (obj *OAuthAccessToken) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 39 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,146 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-type OAuthAccessToken struct {
|
|
| 9 |
- unversioned.TypeMeta `json:",inline"` |
|
| 10 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 11 |
- |
|
| 12 |
- // ClientName references the client that created this token. |
|
| 13 |
- ClientName string `json:"clientName,omitempty"` |
|
| 14 |
- |
|
| 15 |
- // ExpiresIn is the seconds from CreationTime before this token expires. |
|
| 16 |
- ExpiresIn int64 `json:"expiresIn,omitempty"` |
|
| 17 |
- |
|
| 18 |
- // Scopes is an array of the requested scopes. |
|
| 19 |
- Scopes []string `json:"scopes,omitempty"` |
|
| 20 |
- |
|
| 21 |
- // RedirectURI is the redirection associated with the token. |
|
| 22 |
- RedirectURI string `json:"redirectURI,omitempty"` |
|
| 23 |
- |
|
| 24 |
- // UserName is the user name associated with this token |
|
| 25 |
- UserName string `json:"userName,omitempty"` |
|
| 26 |
- |
|
| 27 |
- // UserUID is the unique UID associated with this token |
|
| 28 |
- UserUID string `json:"userUID,omitempty"` |
|
| 29 |
- |
|
| 30 |
- // AuthorizeToken contains the token that authorized this token |
|
| 31 |
- AuthorizeToken string `json:"authorizeToken,omitempty"` |
|
| 32 |
- |
|
| 33 |
- // RefreshToken is the value by which this token can be renewed. Can be blank. |
|
| 34 |
- RefreshToken string `json:"refreshToken,omitempty"` |
|
| 35 |
-} |
|
| 36 |
- |
|
| 37 |
-type OAuthAuthorizeToken struct {
|
|
| 38 |
- unversioned.TypeMeta `json:",inline"` |
|
| 39 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 40 |
- |
|
| 41 |
- // ClientName references the client that created this token. |
|
| 42 |
- ClientName string `json:"clientName,omitempty"` |
|
| 43 |
- |
|
| 44 |
- // ExpiresIn is the seconds from CreationTime before this token expires. |
|
| 45 |
- ExpiresIn int64 `json:"expiresIn,omitempty"` |
|
| 46 |
- |
|
| 47 |
- // Scopes is an array of the requested scopes. |
|
| 48 |
- Scopes []string `json:"scopes,omitempty"` |
|
| 49 |
- |
|
| 50 |
- // RedirectURI is the redirection associated with the token. |
|
| 51 |
- RedirectURI string `json:"redirectURI,omitempty"` |
|
| 52 |
- |
|
| 53 |
- // State data from request |
|
| 54 |
- State string `json:"state,omitempty"` |
|
| 55 |
- |
|
| 56 |
- // UserName is the user name associated with this token |
|
| 57 |
- UserName string `json:"userName,omitempty"` |
|
| 58 |
- |
|
| 59 |
- // UserUID is the unique UID associated with this token. UserUID and UserName must both match |
|
| 60 |
- // for this token to be valid. |
|
| 61 |
- UserUID string `json:"userUID,omitempty"` |
|
| 62 |
-} |
|
| 63 |
- |
|
| 64 |
-type OAuthClient struct {
|
|
| 65 |
- unversioned.TypeMeta `json:",inline"` |
|
| 66 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 67 |
- |
|
| 68 |
- // Secret is the unique secret associated with a client |
|
| 69 |
- Secret string `json:"secret,omitempty"` |
|
| 70 |
- |
|
| 71 |
- // AdditionalSecrets holds other secrets that may be used to identify the client. This is useful for rotation |
|
| 72 |
- // and for service account token validation |
|
| 73 |
- AdditionalSecrets []string `json:"additionalSecrets,omitempty"` |
|
| 74 |
- |
|
| 75 |
- // RespondWithChallenges indicates whether the client wants authentication needed responses made in the form of challenges instead of redirects |
|
| 76 |
- RespondWithChallenges bool `json:"respondWithChallenges,omitempty"` |
|
| 77 |
- |
|
| 78 |
- // RedirectURIs is the valid redirection URIs associated with a client |
|
| 79 |
- RedirectURIs []string `json:"redirectURIs,omitempty"` |
|
| 80 |
- |
|
| 81 |
- // ScopeRestrictions describes which scopes this client can request. Each requested scope |
|
| 82 |
- // is checked against each restriction. If any restriction matches, then the scope is allowed. |
|
| 83 |
- // If no restriction matches, then the scope is denied. |
|
| 84 |
- ScopeRestrictions []ScopeRestriction `json:"scopeRestrictions,omitempty"` |
|
| 85 |
-} |
|
| 86 |
- |
|
| 87 |
-// ScopeRestriction describe one restriction on scopes. Exactly one option must be non-nil. |
|
| 88 |
-type ScopeRestriction struct {
|
|
| 89 |
- // ExactValues means the scope has to match a particular set of strings exactly |
|
| 90 |
- ExactValues []string `json:"literals,omitempty"` |
|
| 91 |
- |
|
| 92 |
- // ClusterRole describes a set of restrictions for cluster role scoping. |
|
| 93 |
- ClusterRole *ClusterRoleScopeRestriction `json:"clusterRole,omitempty"` |
|
| 94 |
-} |
|
| 95 |
- |
|
| 96 |
-// ClusterRoleScopeRestriction describes restrictions on cluster role scopes |
|
| 97 |
-type ClusterRoleScopeRestriction struct {
|
|
| 98 |
- // RoleNames is the list of cluster roles that can referenced. * means anything |
|
| 99 |
- RoleNames []string `json:"roleNames"` |
|
| 100 |
- // Namespaces is the list of namespaces that can be referenced. * means any of them (including *) |
|
| 101 |
- Namespaces []string `json:"namespaces"` |
|
| 102 |
- // AllowEscalation indicates whether you can request roles and their escalating resources |
|
| 103 |
- AllowEscalation bool `json:"allowEscalation"` |
|
| 104 |
-} |
|
| 105 |
- |
|
| 106 |
-type OAuthClientAuthorization struct {
|
|
| 107 |
- unversioned.TypeMeta `json:",inline"` |
|
| 108 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 109 |
- |
|
| 110 |
- // ClientName references the client that created this authorization |
|
| 111 |
- ClientName string `json:"clientName,omitempty"` |
|
| 112 |
- |
|
| 113 |
- // UserName is the user name that authorized this client |
|
| 114 |
- UserName string `json:"userName,omitempty"` |
|
| 115 |
- |
|
| 116 |
- // UserUID is the unique UID associated with this authorization. UserUID and UserName |
|
| 117 |
- // must both match for this authorization to be valid. |
|
| 118 |
- UserUID string `json:"userUID,omitempty"` |
|
| 119 |
- |
|
| 120 |
- // Scopes is an array of the granted scopes. |
|
| 121 |
- Scopes []string `json:"scopes,omitempty"` |
|
| 122 |
-} |
|
| 123 |
- |
|
| 124 |
-type OAuthAccessTokenList struct {
|
|
| 125 |
- unversioned.TypeMeta `json:",inline"` |
|
| 126 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 127 |
- Items []OAuthAccessToken `json:"items"` |
|
| 128 |
-} |
|
| 129 |
- |
|
| 130 |
-type OAuthAuthorizeTokenList struct {
|
|
| 131 |
- unversioned.TypeMeta `json:",inline"` |
|
| 132 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 133 |
- Items []OAuthAuthorizeToken `json:"items"` |
|
| 134 |
-} |
|
| 135 |
- |
|
| 136 |
-type OAuthClientList struct {
|
|
| 137 |
- unversioned.TypeMeta `json:",inline"` |
|
| 138 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 139 |
- Items []OAuthClient `json:"items"` |
|
| 140 |
-} |
|
| 141 |
- |
|
| 142 |
-type OAuthClientAuthorizationList struct {
|
|
| 143 |
- unversioned.TypeMeta `json:",inline"` |
|
| 144 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 145 |
- Items []OAuthClientAuthorization `json:"items"` |
|
| 146 |
-} |
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/openshift/origin/pkg/project/api" |
| 17 | 17 |
"github.com/openshift/origin/pkg/project/api/v1" |
| 18 |
- "github.com/openshift/origin/pkg/project/api/v1beta3" |
|
| 19 | 18 |
) |
| 20 | 19 |
|
| 21 | 20 |
const importPrefix = "github.com/openshift/origin/pkg/project/api" |
| ... | ... |
@@ -23,7 +22,7 @@ const importPrefix = "github.com/openshift/origin/pkg/project/api" |
| 23 | 23 |
var accessor = meta.NewAccessor() |
| 24 | 24 |
|
| 25 | 25 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 26 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 26 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
|
| 27 | 27 |
|
| 28 | 28 |
func init() {
|
| 29 | 29 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -81,8 +80,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 81 | 81 |
switch v {
|
| 82 | 82 |
case v1.SchemeGroupVersion: |
| 83 | 83 |
v1.AddToScheme(kapi.Scheme) |
| 84 |
- case v1beta3.SchemeGroupVersion: |
|
| 85 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 86 | 84 |
|
| 87 | 85 |
default: |
| 88 | 86 |
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
| ... | ... |
@@ -105,12 +102,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 105 | 105 |
MetadataAccessor: accessor, |
| 106 | 106 |
}, nil |
| 107 | 107 |
|
| 108 |
- case v1beta3.SchemeGroupVersion: |
|
| 109 |
- return &meta.VersionInterfaces{
|
|
| 110 |
- ObjectConvertor: kapi.Scheme, |
|
| 111 |
- MetadataAccessor: accessor, |
|
| 112 |
- }, nil |
|
| 113 |
- |
|
| 114 | 108 |
default: |
| 115 | 109 |
g, _ := registered.Group(api.GroupName) |
| 116 | 110 |
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
| 117 | 111 |
deleted file mode 100644 |
| ... | ... |
@@ -1,28 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-const GroupName = "" |
|
| 9 |
- |
|
| 10 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 11 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 12 |
- |
|
| 13 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 14 |
- addKnownTypes(scheme) |
|
| 15 |
-} |
|
| 16 |
- |
|
| 17 |
-// Adds the list of known types to api.Scheme. |
|
| 18 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 19 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 20 |
- &Project{},
|
|
| 21 |
- &ProjectList{},
|
|
| 22 |
- &ProjectRequest{},
|
|
| 23 |
- ) |
|
| 24 |
-} |
|
| 25 |
- |
|
| 26 |
-func (obj *ProjectRequest) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 27 |
-func (obj *Project) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 28 |
-func (obj *ProjectList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 29 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,59 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-// ProjectList is a list of Project objects. |
|
| 9 |
-type ProjectList struct {
|
|
| 10 |
- unversioned.TypeMeta `json:",inline"` |
|
| 11 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 12 |
- Items []Project `json:"items"` |
|
| 13 |
-} |
|
| 14 |
- |
|
| 15 |
-const ( |
|
| 16 |
- // These are internal finalizer values to Origin |
|
| 17 |
- FinalizerOrigin kapi.FinalizerName = "openshift.io/origin" |
|
| 18 |
-) |
|
| 19 |
- |
|
| 20 |
-// ProjectSpec describes the attributes on a Project |
|
| 21 |
-type ProjectSpec struct {
|
|
| 22 |
- // Finalizers is an opaque list of values that must be empty to permanently remove object from storage |
|
| 23 |
- Finalizers []kapi.FinalizerName `json:"finalizers,omitempty"` |
|
| 24 |
-} |
|
| 25 |
- |
|
| 26 |
-// ProjectStatus is information about the current status of a Project |
|
| 27 |
-type ProjectStatus struct {
|
|
| 28 |
- Phase kapi.NamespacePhase `json:"phase,omitempty"` |
|
| 29 |
-} |
|
| 30 |
- |
|
| 31 |
-// Project is a logical top-level container for a set of origin resources |
|
| 32 |
-type Project struct {
|
|
| 33 |
- unversioned.TypeMeta `json:",inline"` |
|
| 34 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 35 |
- |
|
| 36 |
- // Spec defines the behavior of the Namespace. |
|
| 37 |
- Spec ProjectSpec `json:"spec,omitempty"` |
|
| 38 |
- |
|
| 39 |
- // Status describes the current status of a Namespace |
|
| 40 |
- Status ProjectStatus `json:"status,omitempty"` |
|
| 41 |
-} |
|
| 42 |
- |
|
| 43 |
-type ProjectRequest struct {
|
|
| 44 |
- unversioned.TypeMeta `json:",inline"` |
|
| 45 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 46 |
- DisplayName string `json:"displayName,omitempty"` |
|
| 47 |
- Description string `json:"description,omitempty"` |
|
| 48 |
-} |
|
| 49 |
- |
|
| 50 |
-// These constants represent annotations keys affixed to projects |
|
| 51 |
-const ( |
|
| 52 |
- // ProjectDisplayName is an annotation that stores the name displayed when querying for projects |
|
| 53 |
- ProjectDisplayName = "openshift.io/display-name" |
|
| 54 |
- // ProjectDescription is an annotatoion that holds the description of the project |
|
| 55 |
- ProjectDescription = "openshift.io/description" |
|
| 56 |
- // ProjectNodeSelector is an annotation that holds the node selector; |
|
| 57 |
- // the node selector annotation determines which nodes will have pods from this project scheduled to them |
|
| 58 |
- ProjectNodeSelector = "openshift.io/node-selector" |
|
| 59 |
-) |
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/openshift/origin/pkg/route/api" |
| 17 | 17 |
"github.com/openshift/origin/pkg/route/api/v1" |
| 18 |
- "github.com/openshift/origin/pkg/route/api/v1beta3" |
|
| 19 | 18 |
) |
| 20 | 19 |
|
| 21 | 20 |
const importPrefix = "github.com/openshift/origin/pkg/route/api" |
| ... | ... |
@@ -23,7 +22,7 @@ const importPrefix = "github.com/openshift/origin/pkg/route/api" |
| 23 | 23 |
var accessor = meta.NewAccessor() |
| 24 | 24 |
|
| 25 | 25 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 26 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 26 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
|
| 27 | 27 |
|
| 28 | 28 |
func init() {
|
| 29 | 29 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -81,8 +80,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 81 | 81 |
switch v {
|
| 82 | 82 |
case v1.SchemeGroupVersion: |
| 83 | 83 |
v1.AddToScheme(kapi.Scheme) |
| 84 |
- case v1beta3.SchemeGroupVersion: |
|
| 85 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 86 | 84 |
|
| 87 | 85 |
default: |
| 88 | 86 |
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
| ... | ... |
@@ -105,12 +102,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 105 | 105 |
MetadataAccessor: accessor, |
| 106 | 106 |
}, nil |
| 107 | 107 |
|
| 108 |
- case v1beta3.SchemeGroupVersion: |
|
| 109 |
- return &meta.VersionInterfaces{
|
|
| 110 |
- ObjectConvertor: kapi.Scheme, |
|
| 111 |
- MetadataAccessor: accessor, |
|
| 112 |
- }, nil |
|
| 113 |
- |
|
| 114 | 108 |
default: |
| 115 | 109 |
g, _ := registered.Group(api.GroupName) |
| 116 | 110 |
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
| 117 | 111 |
deleted file mode 100644 |
| ... | ... |
@@ -1,62 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "fmt" |
|
| 5 |
- |
|
| 6 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 7 |
-) |
|
| 8 |
- |
|
| 9 |
-func addConversionFuncs(scheme *runtime.Scheme) {
|
|
| 10 |
- err := scheme.AddDefaultingFuncs( |
|
| 11 |
- func(obj *RouteTargetReference) {
|
|
| 12 |
- if len(obj.Kind) == 0 {
|
|
| 13 |
- obj.Kind = "Service" |
|
| 14 |
- } |
|
| 15 |
- if obj.Weight == nil {
|
|
| 16 |
- obj.Weight = new(int32) |
|
| 17 |
- *obj.Weight = 100 |
|
| 18 |
- } |
|
| 19 |
- }, |
|
| 20 |
- func(obj *TLSConfig) {
|
|
| 21 |
- if len(obj.Termination) == 0 && len(obj.DestinationCACertificate) == 0 {
|
|
| 22 |
- obj.Termination = TLSTerminationEdge |
|
| 23 |
- } |
|
| 24 |
- switch obj.Termination {
|
|
| 25 |
- case TLSTerminationType("Reencrypt"):
|
|
| 26 |
- obj.Termination = TLSTerminationReencrypt |
|
| 27 |
- case TLSTerminationType("Edge"):
|
|
| 28 |
- obj.Termination = TLSTerminationEdge |
|
| 29 |
- case TLSTerminationType("Passthrough"):
|
|
| 30 |
- obj.Termination = TLSTerminationPassthrough |
|
| 31 |
- } |
|
| 32 |
- }, |
|
| 33 |
- ) |
|
| 34 |
- if err != nil {
|
|
| 35 |
- panic(err) |
|
| 36 |
- } |
|
| 37 |
- |
|
| 38 |
- err = scheme.AddConversionFuncs() |
|
| 39 |
- if err != nil {
|
|
| 40 |
- panic(err) |
|
| 41 |
- } |
|
| 42 |
- |
|
| 43 |
- // Add field conversion funcs. |
|
| 44 |
- err = scheme.AddFieldLabelConversionFunc("v1beta3", "Route",
|
|
| 45 |
- func(label, value string) (string, string, error) {
|
|
| 46 |
- switch label {
|
|
| 47 |
- case "metadata.name", |
|
| 48 |
- "spec.host", |
|
| 49 |
- "spec.path", |
|
| 50 |
- "spec.to.name": |
|
| 51 |
- return label, value, nil |
|
| 52 |
- // This is for backwards compatibility with old v1 clients which send spec.host |
|
| 53 |
- default: |
|
| 54 |
- return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 55 |
- } |
|
| 56 |
- }) |
|
| 57 |
- if err != nil {
|
|
| 58 |
- // If one of the conversion functions is malformed, detect it immediately. |
|
| 59 |
- panic(err) |
|
| 60 |
- } |
|
| 61 |
- |
|
| 62 |
-} |
| 63 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,27 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-const GroupName = "" |
|
| 9 |
- |
|
| 10 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 11 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 12 |
- |
|
| 13 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 14 |
- addKnownTypes(scheme) |
|
| 15 |
- addConversionFuncs(scheme) |
|
| 16 |
-} |
|
| 17 |
- |
|
| 18 |
-// Adds the list of known types to api.Scheme. |
|
| 19 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 20 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 21 |
- &Route{},
|
|
| 22 |
- &RouteList{},
|
|
| 23 |
- ) |
|
| 24 |
-} |
|
| 25 |
- |
|
| 26 |
-func (obj *Route) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 27 |
-func (obj *RouteList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 28 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,177 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 6 |
- "k8s.io/kubernetes/pkg/util/intstr" |
|
| 7 |
-) |
|
| 8 |
- |
|
| 9 |
-// Route encapsulates the inputs needed to connect an alias to endpoints. |
|
| 10 |
-type Route struct {
|
|
| 11 |
- unversioned.TypeMeta `json:",inline"` |
|
| 12 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 13 |
- |
|
| 14 |
- Spec RouteSpec `json:"spec"` |
|
| 15 |
- Status RouteStatus `json:"status"` |
|
| 16 |
-} |
|
| 17 |
- |
|
| 18 |
-// RouteList is a collection of Routes. |
|
| 19 |
-type RouteList struct {
|
|
| 20 |
- unversioned.TypeMeta `json:",inline"` |
|
| 21 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 22 |
- Items []Route `json:"items"` |
|
| 23 |
-} |
|
| 24 |
- |
|
| 25 |
-// RouteSpec describes the route the user wishes to exist. |
|
| 26 |
-type RouteSpec struct {
|
|
| 27 |
- // Ports are the ports that the user wishes to expose. |
|
| 28 |
- //Ports []RoutePort `json:"ports,omitempty"` |
|
| 29 |
- |
|
| 30 |
- // Host is an alias/DNS that points to the service. Optional |
|
| 31 |
- // Must follow DNS952 subdomain conventions. |
|
| 32 |
- Host string `json:"host"` |
|
| 33 |
- // Optional: Path that the router watches for, to route traffic for to the service |
|
| 34 |
- Path string `json:"path,omitempty"` |
|
| 35 |
- |
|
| 36 |
- // An object the route points to. Only the Service kind is allowed, and it will |
|
| 37 |
- // be defaulted to Service. |
|
| 38 |
- To RouteTargetReference `json:"to"` |
|
| 39 |
- |
|
| 40 |
- // AlternateBackends is an extension of the 'to' field. If more than one service needs to be |
|
| 41 |
- // pointed to, then use this field. Use the weight field in RouteTargetReference object |
|
| 42 |
- // to specify relative preference |
|
| 43 |
- AlternateBackends []RouteTargetReference `json:"alternateBackends,omitempty"` |
|
| 44 |
- |
|
| 45 |
- // If specified, the port to be used by the router. Most routers will use all |
|
| 46 |
- // endpoints exposed by the service by default - set this value to instruct routers |
|
| 47 |
- // which port to use. |
|
| 48 |
- Port *RoutePort `json:"port,omitempty"` |
|
| 49 |
- |
|
| 50 |
- // TLS provides the ability to configure certificates and termination for the route |
|
| 51 |
- TLS *TLSConfig `json:"tls,omitempty"` |
|
| 52 |
-} |
|
| 53 |
- |
|
| 54 |
-// RouteTargetReference specifies the target that resolve into endpoints. Only the 'Service' |
|
| 55 |
-// kind is allowed. Use 'weight' field to emphasize one over others. |
|
| 56 |
-type RouteTargetReference struct {
|
|
| 57 |
- // The kind of target that the route is referring to. Currently, only 'Service' is allowed |
|
| 58 |
- Kind string `json:"kind"` |
|
| 59 |
- |
|
| 60 |
- // Name of the service/target that is being referred to. e.g. name of the service |
|
| 61 |
- Name string `json:"name"` |
|
| 62 |
- |
|
| 63 |
- // Weight as an integer between 1 and 256 that specifies the target's relative weight |
|
| 64 |
- // against other target reference objects |
|
| 65 |
- Weight *int32 `json:"weight"` |
|
| 66 |
-} |
|
| 67 |
- |
|
| 68 |
-// RoutePort defines a port mapping from a router to an endpoint in the service endpoints. |
|
| 69 |
-type RoutePort struct {
|
|
| 70 |
- // The target port on pods selected by the service this route points to. |
|
| 71 |
- // If this is a string, it will be looked up as a named port in the target |
|
| 72 |
- // endpoints port list. Required |
|
| 73 |
- TargetPort intstr.IntOrString `json:"targetPort"` |
|
| 74 |
-} |
|
| 75 |
- |
|
| 76 |
-// RouteStatus provides relevant info about the status of a route, including which routers |
|
| 77 |
-// acknowledge it. |
|
| 78 |
-type RouteStatus struct {
|
|
| 79 |
- // Ingress describes the places where the route may be exposed. The list of |
|
| 80 |
- // ingress points may contain duplicate Host or RouterName values. Routes |
|
| 81 |
- // are considered live once they are `Ready` |
|
| 82 |
- Ingress []RouteIngress `json:"ingress"` |
|
| 83 |
-} |
|
| 84 |
- |
|
| 85 |
-// RouteIngress holds information about the places where a route is exposed |
|
| 86 |
-type RouteIngress struct {
|
|
| 87 |
- // Host is the host string under which the route is exposed; this value is required |
|
| 88 |
- Host string `json:"host,omitempty"` |
|
| 89 |
- // Name is a name chosen by the router to identify itself; this value is required |
|
| 90 |
- RouterName string `json:"routerName,omitempty"` |
|
| 91 |
- // Conditions is the state of the route, may be empty. |
|
| 92 |
- Conditions []RouteIngressCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` |
|
| 93 |
-} |
|
| 94 |
- |
|
| 95 |
-// RouteIngressConditionType is a valid value for RouteCondition |
|
| 96 |
-type RouteIngressConditionType string |
|
| 97 |
- |
|
| 98 |
-// These are valid conditions of pod. |
|
| 99 |
-const ( |
|
| 100 |
- // RouteAdmitted means the route is able to service requests for the provided Host |
|
| 101 |
- RouteAdmitted RouteIngressConditionType = "Admitted" |
|
| 102 |
- // TODO: add other route condition types |
|
| 103 |
-) |
|
| 104 |
- |
|
| 105 |
-// RouteIngressCondition contains details for the current condition of this pod. |
|
| 106 |
-// TODO: add LastTransitionTime, Reason, Message to match NodeCondition api. |
|
| 107 |
-type RouteIngressCondition struct {
|
|
| 108 |
- // Type is the type of the condition. |
|
| 109 |
- // Currently only Ready. |
|
| 110 |
- Type RouteIngressConditionType `json:"type"` |
|
| 111 |
- // Status is the status of the condition. |
|
| 112 |
- // Can be True, False, Unknown. |
|
| 113 |
- Status kapi.ConditionStatus `json:"status"` |
|
| 114 |
- // (brief) reason for the condition's last transition, and is usually a machine and human |
|
| 115 |
- // readable constant |
|
| 116 |
- Reason string `json:"reason,omitempty"` |
|
| 117 |
- // Human readable message indicating details about last transition. |
|
| 118 |
- Message string `json:"message,omitempty"` |
|
| 119 |
- // RFC 3339 date and time at which the object was acknowledged by the router. |
|
| 120 |
- // This may be before the router exposes the route |
|
| 121 |
- LastTransitionTime *unversioned.Time `json:"lastTransitionTime,omitempty"` |
|
| 122 |
-} |
|
| 123 |
- |
|
| 124 |
-// RouterShard has information of a routing shard and is used to |
|
| 125 |
-// generate host names and routing table entries when a routing shard is |
|
| 126 |
-// allocated for a specific route. |
|
| 127 |
-// Caveat: This is WIP and will likely undergo modifications when sharding |
|
| 128 |
-// support is added. |
|
| 129 |
-type RouterShard struct {
|
|
| 130 |
- // Shard name uniquely identifies a router shard in the "set" of |
|
| 131 |
- // routers used for routing traffic to the services. |
|
| 132 |
- ShardName string `json:"shardName"` |
|
| 133 |
- |
|
| 134 |
- // The DNS suffix for the shard ala: shard-1.v3.openshift.com |
|
| 135 |
- DNSSuffix string `json:"dnsSuffix"` |
|
| 136 |
-} |
|
| 137 |
- |
|
| 138 |
-// TLSConfig defines config used to secure a route and provide termination |
|
| 139 |
-type TLSConfig struct {
|
|
| 140 |
- // Termination indicates termination type. |
|
| 141 |
- Termination TLSTerminationType `json:"termination"` |
|
| 142 |
- |
|
| 143 |
- // Certificate provides certificate contents |
|
| 144 |
- Certificate string `json:"certificate,omitempty"` |
|
| 145 |
- |
|
| 146 |
- // Key provides key file contents |
|
| 147 |
- Key string `json:"key,omitempty"` |
|
| 148 |
- |
|
| 149 |
- // CACertificate provides the cert authority certificate contents |
|
| 150 |
- CACertificate string `json:"caCertificate,omitempty"` |
|
| 151 |
- |
|
| 152 |
- // DestinationCACertificate provides the contents of the ca certificate of the final destination. When using reencrypt |
|
| 153 |
- // termination this file should be provided in order to have routers use it for health checks on the secure connection |
|
| 154 |
- DestinationCACertificate string `json:"destinationCACertificate,omitempty"` |
|
| 155 |
- |
|
| 156 |
- // InsecureEdgeTerminationPolicy indicates the desired behavior for |
|
| 157 |
- // insecure connections to an edge-terminated route: |
|
| 158 |
- // disable, allow or redirect |
|
| 159 |
- InsecureEdgeTerminationPolicy InsecureEdgeTerminationPolicyType `json:"insecureEdgeTerminationPolicy,omitempty"` |
|
| 160 |
-} |
|
| 161 |
- |
|
| 162 |
-// TLSTerminationType dictates where the secure communication will stop |
|
| 163 |
-// TODO: Reconsider this type in v2 |
|
| 164 |
-type TLSTerminationType string |
|
| 165 |
- |
|
| 166 |
-// InsecureEdgeTerminationPolicyType dictates the behavior of insecure |
|
| 167 |
-// connections to an edge-terminated route. |
|
| 168 |
-type InsecureEdgeTerminationPolicyType string |
|
| 169 |
- |
|
| 170 |
-const ( |
|
| 171 |
- // TLSTerminationEdge terminate encryption at the edge router. |
|
| 172 |
- TLSTerminationEdge TLSTerminationType = "edge" |
|
| 173 |
- // TLSTerminationPassthrough terminate encryption at the destination, the destination is responsible for decrypting traffic |
|
| 174 |
- TLSTerminationPassthrough TLSTerminationType = "passthrough" |
|
| 175 |
- // TLSTerminationReencrypt terminate encryption at the edge router and re-encrypt it with a new certificate supplied by the destination |
|
| 176 |
- TLSTerminationReencrypt TLSTerminationType = "reencrypt" |
|
| 177 |
-) |
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/openshift/origin/pkg/sdn/api" |
| 17 | 17 |
"github.com/openshift/origin/pkg/sdn/api/v1" |
| 18 |
- "github.com/openshift/origin/pkg/sdn/api/v1beta3" |
|
| 19 | 18 |
) |
| 20 | 19 |
|
| 21 | 20 |
const importPrefix = "github.com/openshift/origin/pkg/sdn/api" |
| ... | ... |
@@ -23,7 +22,7 @@ const importPrefix = "github.com/openshift/origin/pkg/sdn/api" |
| 23 | 23 |
var accessor = meta.NewAccessor() |
| 24 | 24 |
|
| 25 | 25 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 26 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 26 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
|
| 27 | 27 |
|
| 28 | 28 |
func init() {
|
| 29 | 29 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -81,8 +80,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 81 | 81 |
switch v {
|
| 82 | 82 |
case v1.SchemeGroupVersion: |
| 83 | 83 |
v1.AddToScheme(kapi.Scheme) |
| 84 |
- case v1beta3.SchemeGroupVersion: |
|
| 85 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 86 | 84 |
|
| 87 | 85 |
default: |
| 88 | 86 |
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
| ... | ... |
@@ -105,12 +102,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 105 | 105 |
MetadataAccessor: accessor, |
| 106 | 106 |
}, nil |
| 107 | 107 |
|
| 108 |
- case v1beta3.SchemeGroupVersion: |
|
| 109 |
- return &meta.VersionInterfaces{
|
|
| 110 |
- ObjectConvertor: kapi.Scheme, |
|
| 111 |
- MetadataAccessor: accessor, |
|
| 112 |
- }, nil |
|
| 113 |
- |
|
| 114 | 108 |
default: |
| 115 | 109 |
g, _ := registered.Group(api.GroupName) |
| 116 | 110 |
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
| 117 | 111 |
deleted file mode 100644 |
| ... | ... |
@@ -1,34 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-const GroupName = "" |
|
| 9 |
- |
|
| 10 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 11 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 12 |
- |
|
| 13 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 14 |
- addKnownTypes(scheme) |
|
| 15 |
-} |
|
| 16 |
- |
|
| 17 |
-// Adds the list of known types to api.Scheme. |
|
| 18 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 19 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 20 |
- &ClusterNetwork{},
|
|
| 21 |
- &ClusterNetworkList{},
|
|
| 22 |
- &HostSubnet{},
|
|
| 23 |
- &HostSubnetList{},
|
|
| 24 |
- &NetNamespace{},
|
|
| 25 |
- &NetNamespaceList{},
|
|
| 26 |
- ) |
|
| 27 |
-} |
|
| 28 |
- |
|
| 29 |
-func (obj *ClusterNetwork) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 30 |
-func (obj *ClusterNetworkList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 31 |
-func (obj *HostSubnet) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 32 |
-func (obj *HostSubnetList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 33 |
-func (obj *NetNamespace) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 34 |
-func (obj *NetNamespaceList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 35 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,55 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-type ClusterNetwork struct {
|
|
| 9 |
- unversioned.TypeMeta `json:",inline"` |
|
| 10 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 11 |
- |
|
| 12 |
- Network string `json:"network"` |
|
| 13 |
- HostSubnetLength int `json:"hostsubnetlength"` |
|
| 14 |
- ServiceNetwork string `json:"serviceNetwork"` |
|
| 15 |
-} |
|
| 16 |
- |
|
| 17 |
-type ClusterNetworkList struct {
|
|
| 18 |
- unversioned.TypeMeta `json:",inline"` |
|
| 19 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 20 |
- Items []ClusterNetwork `json:"items"` |
|
| 21 |
-} |
|
| 22 |
- |
|
| 23 |
-// HostSubnet encapsulates the inputs needed to define the container subnet network on a node |
|
| 24 |
-type HostSubnet struct {
|
|
| 25 |
- unversioned.TypeMeta `json:",inline"` |
|
| 26 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 27 |
- |
|
| 28 |
- // host may just be an IP address, resolvable hostname or a complete DNS |
|
| 29 |
- Host string `json:"host"` |
|
| 30 |
- HostIP string `json:"hostIP"` |
|
| 31 |
- Subnet string `json:"subnet"` |
|
| 32 |
-} |
|
| 33 |
- |
|
| 34 |
-// HostSubnetList is a collection of HostSubnets |
|
| 35 |
-type HostSubnetList struct {
|
|
| 36 |
- unversioned.TypeMeta `json:",inline"` |
|
| 37 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 38 |
- Items []HostSubnet `json:"items"` |
|
| 39 |
-} |
|
| 40 |
- |
|
| 41 |
-// NetNamespace encapsulates the inputs needed to define a unique network namespace on the cluster |
|
| 42 |
-type NetNamespace struct {
|
|
| 43 |
- unversioned.TypeMeta `json:",inline"` |
|
| 44 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 45 |
- |
|
| 46 |
- NetName string `json:"netname"` |
|
| 47 |
- NetID uint `json:"netid"` |
|
| 48 |
-} |
|
| 49 |
- |
|
| 50 |
-// NetNamespaceList is a collection of NetNamespaces |
|
| 51 |
-type NetNamespaceList struct {
|
|
| 52 |
- unversioned.TypeMeta `json:",inline"` |
|
| 53 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 54 |
- Items []NetNamespace `json:"items"` |
|
| 55 |
-} |
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/openshift/origin/pkg/template/api" |
| 17 | 17 |
"github.com/openshift/origin/pkg/template/api/v1" |
| 18 |
- "github.com/openshift/origin/pkg/template/api/v1beta3" |
|
| 19 | 18 |
) |
| 20 | 19 |
|
| 21 | 20 |
const importPrefix = "github.com/openshift/origin/pkg/template/api" |
| ... | ... |
@@ -23,7 +22,7 @@ const importPrefix = "github.com/openshift/origin/pkg/template/api" |
| 23 | 23 |
var accessor = meta.NewAccessor() |
| 24 | 24 |
|
| 25 | 25 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 26 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 26 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
|
| 27 | 27 |
|
| 28 | 28 |
func init() {
|
| 29 | 29 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -81,8 +80,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 81 | 81 |
switch v {
|
| 82 | 82 |
case v1.SchemeGroupVersion: |
| 83 | 83 |
v1.AddToScheme(kapi.Scheme) |
| 84 |
- case v1beta3.SchemeGroupVersion: |
|
| 85 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 86 | 84 |
|
| 87 | 85 |
default: |
| 88 | 86 |
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
| ... | ... |
@@ -110,12 +107,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 110 | 110 |
MetadataAccessor: accessor, |
| 111 | 111 |
}, nil |
| 112 | 112 |
|
| 113 |
- case v1beta3.SchemeGroupVersion: |
|
| 114 |
- return &meta.VersionInterfaces{
|
|
| 115 |
- ObjectConvertor: kapi.Scheme, |
|
| 116 |
- MetadataAccessor: accessor, |
|
| 117 |
- }, nil |
|
| 118 |
- |
|
| 119 | 113 |
default: |
| 120 | 114 |
g, _ := registered.Group(api.GroupName) |
| 121 | 115 |
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
| 122 | 116 |
deleted file mode 100644 |
| ... | ... |
@@ -1,51 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/conversion" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
- |
|
| 7 |
- newer "github.com/openshift/origin/pkg/template/api" |
|
| 8 |
-) |
|
| 9 |
- |
|
| 10 |
-func Convert_api_Template_To_v1beta3_Template(in *newer.Template, out *Template, s conversion.Scope) error {
|
|
| 11 |
- //FIXME: DefaultConvert should not overwrite the Labels field on the |
|
| 12 |
- // the base object. This is likely a bug in the DefaultConvert |
|
| 13 |
- // code. For now, it is called before converting the labels. |
|
| 14 |
- if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
|
| 15 |
- return err |
|
| 16 |
- } |
|
| 17 |
- if err := s.Convert(&in.ObjectLabels, &out.Labels, 0); err != nil {
|
|
| 18 |
- return err |
|
| 19 |
- } |
|
| 20 |
- |
|
| 21 |
- // if we have runtime.Unstructured objects from the Process call. We need to encode those |
|
| 22 |
- // objects using the unstructured codec BEFORE the REST layers gets its shot at encoding to avoid a layered |
|
| 23 |
- // encode being done. |
|
| 24 |
- for i := range in.Objects {
|
|
| 25 |
- if unstructured, ok := in.Objects[i].(*runtime.Unstructured); ok {
|
|
| 26 |
- bytes, err := runtime.Encode(runtime.UnstructuredJSONScheme, unstructured) |
|
| 27 |
- if err != nil {
|
|
| 28 |
- return err |
|
| 29 |
- } |
|
| 30 |
- out.Objects[i] = runtime.RawExtension{Raw: bytes}
|
|
| 31 |
- } |
|
| 32 |
- } |
|
| 33 |
- return nil |
|
| 34 |
-} |
|
| 35 |
- |
|
| 36 |
-func Convert_v1beta3_Template_To_api_Template(in *Template, out *newer.Template, s conversion.Scope) error {
|
|
| 37 |
- if err := s.Convert(&in.Labels, &out.ObjectLabels, 0); err != nil {
|
|
| 38 |
- return err |
|
| 39 |
- } |
|
| 40 |
- return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) |
|
| 41 |
-} |
|
| 42 |
- |
|
| 43 |
-func addConversionFuncs(scheme *runtime.Scheme) {
|
|
| 44 |
- err := scheme.AddConversionFuncs( |
|
| 45 |
- Convert_api_Template_To_v1beta3_Template, |
|
| 46 |
- Convert_v1beta3_Template_To_api_Template, |
|
| 47 |
- ) |
|
| 48 |
- if err != nil {
|
|
| 49 |
- panic(err) |
|
| 50 |
- } |
|
| 51 |
-} |
| 52 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,30 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-const GroupName = "" |
|
| 9 |
- |
|
| 10 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 11 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 12 |
- |
|
| 13 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 14 |
- addKnownTypes(scheme) |
|
| 15 |
- addConversionFuncs(scheme) |
|
| 16 |
-} |
|
| 17 |
- |
|
| 18 |
-// Adds the list of known types to api.Scheme. |
|
| 19 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 20 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 21 |
- &Template{},
|
|
| 22 |
- &TemplateList{},
|
|
| 23 |
- ) |
|
| 24 |
- |
|
| 25 |
- scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("TemplateConfig"), &Template{})
|
|
| 26 |
- scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ProcessedTemplate"), &Template{})
|
|
| 27 |
-} |
|
| 28 |
- |
|
| 29 |
-func (obj *Template) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 30 |
-func (obj *TemplateList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 31 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,62 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 6 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 7 |
-) |
|
| 8 |
- |
|
| 9 |
-// Template contains the inputs needed to produce a Config. |
|
| 10 |
-type Template struct {
|
|
| 11 |
- unversioned.TypeMeta `json:",inline"` |
|
| 12 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 13 |
- |
|
| 14 |
- // Required: Objects is an array of objects to include in this template |
|
| 15 |
- Objects []runtime.RawExtension `json:"objects"` |
|
| 16 |
- |
|
| 17 |
- // Optional: Parameters is an array of Parameters used during the |
|
| 18 |
- // Template to Config transformation. |
|
| 19 |
- Parameters []Parameter `json:"parameters,omitempty"` |
|
| 20 |
- |
|
| 21 |
- // Optional: Labels is a set of labels that are applied to every |
|
| 22 |
- // object during the Template to Config transformation |
|
| 23 |
- Labels map[string]string `json:"labels,omitempty"` |
|
| 24 |
-} |
|
| 25 |
- |
|
| 26 |
-// TemplateList is a list of Template objects. |
|
| 27 |
-type TemplateList struct {
|
|
| 28 |
- unversioned.TypeMeta `json:",inline"` |
|
| 29 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 30 |
- Items []Template `json:"items"` |
|
| 31 |
-} |
|
| 32 |
- |
|
| 33 |
-// Parameter defines a name/value variable that is to be processed during |
|
| 34 |
-// the Template to Config transformation. |
|
| 35 |
-type Parameter struct {
|
|
| 36 |
- // Required: Parameter name must be set and it can be referenced in Template |
|
| 37 |
- // Items using ${PARAMETER_NAME}
|
|
| 38 |
- Name string `json:"name"` |
|
| 39 |
- |
|
| 40 |
- // Optional: The name that will show in UI instead of parameter 'Name' |
|
| 41 |
- DisplayName string `json:"displayName,omitempty"` |
|
| 42 |
- |
|
| 43 |
- // Optional: Parameter can have description |
|
| 44 |
- Description string `json:"description,omitempty"` |
|
| 45 |
- |
|
| 46 |
- // Optional: Value holds the Parameter data. If specified, the generator |
|
| 47 |
- // will be ignored. The value replaces all occurrences of the Parameter |
|
| 48 |
- // ${Name} expression during the Template to Config transformation.
|
|
| 49 |
- Value string `json:"value,omitempty"` |
|
| 50 |
- |
|
| 51 |
- // Optional: Generate specifies the generator to be used to generate |
|
| 52 |
- // random string from an input value specified by From field. The result |
|
| 53 |
- // string is stored into Value field. If empty, no generator is being |
|
| 54 |
- // used, leaving the result Value untouched. |
|
| 55 |
- Generate string `json:"generate,omitempty"` |
|
| 56 |
- |
|
| 57 |
- // Optional: From is an input value for the generator. |
|
| 58 |
- From string `json:"from,omitempty"` |
|
| 59 |
- |
|
| 60 |
- // Optional: Indicates the parameter must have a value. Defaults to false. |
|
| 61 |
- Required bool `json:"required,omitempty"` |
|
| 62 |
-} |
| ... | ... |
@@ -14,8 +14,8 @@ import ( |
| 14 | 14 |
"k8s.io/kubernetes/pkg/util/diff" |
| 15 | 15 |
"k8s.io/kubernetes/pkg/util/validation/field" |
| 16 | 16 |
|
| 17 |
- "github.com/openshift/origin/pkg/api/v1beta3" |
|
| 18 | 17 |
"github.com/openshift/origin/pkg/template/api" |
| 18 |
+ "github.com/openshift/origin/pkg/template/api/v1" |
|
| 19 | 19 |
"github.com/openshift/origin/pkg/template/generator" |
| 20 | 20 |
|
| 21 | 21 |
_ "github.com/openshift/origin/pkg/api/install" |
| ... | ... |
@@ -183,7 +183,7 @@ func TestProcessValueEscape(t *testing.T) {
|
| 183 | 183 |
"kind":"Template", "apiVersion":"v1", |
| 184 | 184 |
"objects": [ |
| 185 | 185 |
{
|
| 186 |
- "kind": "Service", "apiVersion": "v1beta3${VALUE}",
|
|
| 186 |
+ "kind": "Service", "apiVersion": "v1${VALUE}",
|
|
| 187 | 187 |
"metadata": {
|
| 188 | 188 |
"labels": {
|
| 189 | 189 |
"key1": "${VALUE}",
|
| ... | ... |
@@ -209,11 +209,11 @@ func TestProcessValueEscape(t *testing.T) {
|
| 209 | 209 |
if len(errs) > 0 {
|
| 210 | 210 |
t.Fatalf("unexpected error: %v", errs)
|
| 211 | 211 |
} |
| 212 |
- result, err := runtime.Encode(kapi.Codecs.LegacyCodec(v1beta3.SchemeGroupVersion), &template) |
|
| 212 |
+ result, err := runtime.Encode(kapi.Codecs.LegacyCodec(v1.SchemeGroupVersion), &template) |
|
| 213 | 213 |
if err != nil {
|
| 214 | 214 |
t.Fatalf("unexpected error during encoding Config: %#v", err)
|
| 215 | 215 |
} |
| 216 |
- expect := `{"kind":"Template","apiVersion":"v1beta3","metadata":{"creationTimestamp":null},"objects":[{"apiVersion":"v1beta31","kind":"Service","metadata":{"labels":{"key1":"1","key2":"$1"}}}],"parameters":[{"name":"VALUE","value":"1"}]}`
|
|
| 216 |
+ expect := `{"kind":"Template","apiVersion":"v1","metadata":{"creationTimestamp":null},"objects":[{"apiVersion":"v11","kind":"Service","metadata":{"labels":{"key1":"1","key2":"$1"}}}],"parameters":[{"name":"VALUE","value":"1"}]}`
|
|
| 217 | 217 |
stringResult := strings.TrimSpace(string(result)) |
| 218 | 218 |
if expect != stringResult {
|
| 219 | 219 |
t.Errorf("unexpected output: %s", diff.StringDiff(expect, stringResult))
|
| ... | ... |
@@ -233,16 +233,16 @@ func TestEvaluateLabels(t *testing.T) {
|
| 233 | 233 |
"kind":"Template", "apiVersion":"v1", |
| 234 | 234 |
"objects": [ |
| 235 | 235 |
{
|
| 236 |
- "kind": "Service", "apiVersion": "v1beta3", |
|
| 236 |
+ "kind": "Service", "apiVersion": "v1", |
|
| 237 | 237 |
"metadata": {"labels": {"key1": "v1", "key2": "v2"} }
|
| 238 | 238 |
} |
| 239 | 239 |
] |
| 240 | 240 |
}`, |
| 241 | 241 |
Output: `{
|
| 242 |
- "kind":"Template","apiVersion":"v1beta3","metadata":{"creationTimestamp":null},
|
|
| 242 |
+ "kind":"Template","apiVersion":"v1","metadata":{"creationTimestamp":null},
|
|
| 243 | 243 |
"objects":[ |
| 244 | 244 |
{
|
| 245 |
- "apiVersion":"v1beta3","kind":"Service","metadata":{
|
|
| 245 |
+ "apiVersion":"v1","kind":"Service","metadata":{
|
|
| 246 | 246 |
"labels":{"key1":"v1","key2":"v2"}}
|
| 247 | 247 |
} |
| 248 | 248 |
] |
| ... | ... |
@@ -253,16 +253,16 @@ func TestEvaluateLabels(t *testing.T) {
|
| 253 | 253 |
"kind":"Template", "apiVersion":"v1", |
| 254 | 254 |
"objects": [ |
| 255 | 255 |
{
|
| 256 |
- "kind": "Service", "apiVersion": "v1beta3", |
|
| 256 |
+ "kind": "Service", "apiVersion": "v1", |
|
| 257 | 257 |
"metadata": {"labels": {"key1": "v1", "key2": "v2"} }
|
| 258 | 258 |
} |
| 259 | 259 |
] |
| 260 | 260 |
}`, |
| 261 | 261 |
Output: `{
|
| 262 |
- "kind":"Template","apiVersion":"v1beta3","metadata":{"creationTimestamp":null},
|
|
| 262 |
+ "kind":"Template","apiVersion":"v1","metadata":{"creationTimestamp":null},
|
|
| 263 | 263 |
"objects":[ |
| 264 | 264 |
{
|
| 265 |
- "apiVersion":"v1beta3","kind":"Service","metadata":{
|
|
| 265 |
+ "apiVersion":"v1","kind":"Service","metadata":{
|
|
| 266 | 266 |
"labels":{"key1":"v1","key2":"v2","key3":"v3"}}
|
| 267 | 267 |
} |
| 268 | 268 |
], |
| ... | ... |
@@ -275,7 +275,7 @@ func TestEvaluateLabels(t *testing.T) {
|
| 275 | 275 |
"kind":"Template", "apiVersion":"v1", |
| 276 | 276 |
"objects": [ |
| 277 | 277 |
{
|
| 278 |
- "kind": "Service", "apiVersion": "v1beta3", |
|
| 278 |
+ "kind": "Service", "apiVersion": "v1", |
|
| 279 | 279 |
"metadata": {},
|
| 280 | 280 |
"labels": {
|
| 281 | 281 |
"key1": "v1", |
| ... | ... |
@@ -285,10 +285,10 @@ func TestEvaluateLabels(t *testing.T) {
|
| 285 | 285 |
] |
| 286 | 286 |
}`, |
| 287 | 287 |
Output: `{
|
| 288 |
- "kind":"Template","apiVersion":"v1beta3","metadata":{"creationTimestamp":null},
|
|
| 288 |
+ "kind":"Template","apiVersion":"v1","metadata":{"creationTimestamp":null},
|
|
| 289 | 289 |
"objects":[ |
| 290 | 290 |
{
|
| 291 |
- "apiVersion":"v1beta3","kind":"Service", |
|
| 291 |
+ "apiVersion":"v1","kind":"Service", |
|
| 292 | 292 |
"labels":{"key1":"v1","key2":"v2"},
|
| 293 | 293 |
"metadata":{"labels":{"key3":"v3"}}
|
| 294 | 294 |
} |
| ... | ... |
@@ -302,16 +302,16 @@ func TestEvaluateLabels(t *testing.T) {
|
| 302 | 302 |
"kind":"Template", "apiVersion":"v1", |
| 303 | 303 |
"objects": [ |
| 304 | 304 |
{
|
| 305 |
- "kind": "Service", "apiVersion": "v1beta3", |
|
| 305 |
+ "kind": "Service", "apiVersion": "v1", |
|
| 306 | 306 |
"metadata": {"labels": {"key1": "v1", "key2": "v2"} }
|
| 307 | 307 |
} |
| 308 | 308 |
] |
| 309 | 309 |
}`, |
| 310 | 310 |
Output: `{
|
| 311 |
- "kind":"Template","apiVersion":"v1beta3","metadata":{"creationTimestamp":null},
|
|
| 311 |
+ "kind":"Template","apiVersion":"v1","metadata":{"creationTimestamp":null},
|
|
| 312 | 312 |
"objects":[ |
| 313 | 313 |
{
|
| 314 |
- "apiVersion":"v1beta3","kind":"Service","metadata":{
|
|
| 314 |
+ "apiVersion":"v1","kind":"Service","metadata":{
|
|
| 315 | 315 |
"labels":{"key1":"v1","key2":"v3"}}
|
| 316 | 316 |
} |
| 317 | 317 |
], |
| ... | ... |
@@ -341,7 +341,7 @@ func TestEvaluateLabels(t *testing.T) {
|
| 341 | 341 |
t.Errorf("%s: unexpected error: %v", k, errs)
|
| 342 | 342 |
continue |
| 343 | 343 |
} |
| 344 |
- result, err := runtime.Encode(kapi.Codecs.LegacyCodec(v1beta3.SchemeGroupVersion), &template) |
|
| 344 |
+ result, err := runtime.Encode(kapi.Codecs.LegacyCodec(v1.SchemeGroupVersion), &template) |
|
| 345 | 345 |
if err != nil {
|
| 346 | 346 |
t.Errorf("%s: unexpected error: %v", k, err)
|
| 347 | 347 |
continue |
| ... | ... |
@@ -381,11 +381,11 @@ func TestProcessTemplateParameters(t *testing.T) {
|
| 381 | 381 |
if len(errs) > 0 {
|
| 382 | 382 |
t.Fatalf("unexpected error: %v", errs)
|
| 383 | 383 |
} |
| 384 |
- result, err := runtime.Encode(kapi.Codecs.LegacyCodec(v1beta3.SchemeGroupVersion), &template) |
|
| 384 |
+ result, err := runtime.Encode(kapi.Codecs.LegacyCodec(v1.SchemeGroupVersion), &template) |
|
| 385 | 385 |
if err != nil {
|
| 386 | 386 |
t.Fatalf("unexpected error during encoding Config: %#v", err)
|
| 387 | 387 |
} |
| 388 |
- exp, _ := runtime.Encode(kapi.Codecs.LegacyCodec(v1beta3.SchemeGroupVersion), &expectedTemplate) |
|
| 388 |
+ exp, _ := runtime.Encode(kapi.Codecs.LegacyCodec(v1.SchemeGroupVersion), &expectedTemplate) |
|
| 389 | 389 |
|
| 390 | 390 |
if string(result) != string(exp) {
|
| 391 | 391 |
t.Errorf("unexpected output: %s", diff.StringDiff(string(exp), string(result)))
|
| ... | ... |
@@ -15,7 +15,6 @@ import ( |
| 15 | 15 |
|
| 16 | 16 |
"github.com/openshift/origin/pkg/user/api" |
| 17 | 17 |
"github.com/openshift/origin/pkg/user/api/v1" |
| 18 |
- "github.com/openshift/origin/pkg/user/api/v1beta3" |
|
| 19 | 18 |
) |
| 20 | 19 |
|
| 21 | 20 |
const importPrefix = "github.com/openshift/origin/pkg/user/api" |
| ... | ... |
@@ -23,7 +22,7 @@ const importPrefix = "github.com/openshift/origin/pkg/user/api" |
| 23 | 23 |
var accessor = meta.NewAccessor() |
| 24 | 24 |
|
| 25 | 25 |
// availableVersions lists all known external versions for this group from most preferred to least preferred |
| 26 |
-var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion, v1beta3.SchemeGroupVersion}
|
|
| 26 |
+var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
|
|
| 27 | 27 |
|
| 28 | 28 |
func init() {
|
| 29 | 29 |
registered.RegisterVersions(availableVersions) |
| ... | ... |
@@ -81,8 +80,6 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
| 81 | 81 |
switch v {
|
| 82 | 82 |
case v1.SchemeGroupVersion: |
| 83 | 83 |
v1.AddToScheme(kapi.Scheme) |
| 84 |
- case v1beta3.SchemeGroupVersion: |
|
| 85 |
- v1beta3.AddToScheme(kapi.Scheme) |
|
| 86 | 84 |
|
| 87 | 85 |
default: |
| 88 | 86 |
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
|
| ... | ... |
@@ -105,12 +102,6 @@ func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, e |
| 105 | 105 |
MetadataAccessor: accessor, |
| 106 | 106 |
}, nil |
| 107 | 107 |
|
| 108 |
- case v1beta3.SchemeGroupVersion: |
|
| 109 |
- return &meta.VersionInterfaces{
|
|
| 110 |
- ObjectConvertor: kapi.Scheme, |
|
| 111 |
- MetadataAccessor: accessor, |
|
| 112 |
- }, nil |
|
| 113 |
- |
|
| 114 | 108 |
default: |
| 115 | 109 |
g, _ := registered.Group(api.GroupName) |
| 116 | 110 |
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
| 117 | 111 |
deleted file mode 100644 |
| ... | ... |
@@ -1,36 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- "k8s.io/kubernetes/pkg/runtime" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-const GroupName = "" |
|
| 9 |
- |
|
| 10 |
-// SchemeGroupVersion is group version used to register these objects |
|
| 11 |
-var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta3"}
|
|
| 12 |
- |
|
| 13 |
-func AddToScheme(scheme *runtime.Scheme) {
|
|
| 14 |
- addKnownTypes(scheme) |
|
| 15 |
-} |
|
| 16 |
- |
|
| 17 |
-// Adds the list of known types to api.Scheme. |
|
| 18 |
-func addKnownTypes(scheme *runtime.Scheme) {
|
|
| 19 |
- scheme.AddKnownTypes(SchemeGroupVersion, |
|
| 20 |
- &User{},
|
|
| 21 |
- &UserList{},
|
|
| 22 |
- &Identity{},
|
|
| 23 |
- &IdentityList{},
|
|
| 24 |
- &UserIdentityMapping{},
|
|
| 25 |
- &Group{},
|
|
| 26 |
- &GroupList{},
|
|
| 27 |
- ) |
|
| 28 |
-} |
|
| 29 |
- |
|
| 30 |
-func (obj *GroupList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 31 |
-func (obj *Group) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 32 |
-func (obj *User) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 33 |
-func (obj *UserList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 34 |
-func (obj *Identity) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 35 |
-func (obj *IdentityList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
|
| 36 |
-func (obj *UserIdentityMapping) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
| 37 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,72 +0,0 @@ |
| 1 |
-package v1beta3 |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "k8s.io/kubernetes/pkg/api/unversioned" |
|
| 5 |
- kapi "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-// Auth system gets identity name and provider |
|
| 9 |
-// POST to UserIdentityMapping, get back error or a filled out UserIdentityMapping object |
|
| 10 |
- |
|
| 11 |
-type User struct {
|
|
| 12 |
- unversioned.TypeMeta `json:",inline"` |
|
| 13 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 14 |
- |
|
| 15 |
- FullName string `json:"fullName,omitempty"` |
|
| 16 |
- |
|
| 17 |
- Identities []string `json:"identities"` |
|
| 18 |
- |
|
| 19 |
- Groups []string `json:"groups"` |
|
| 20 |
-} |
|
| 21 |
- |
|
| 22 |
-type UserList struct {
|
|
| 23 |
- unversioned.TypeMeta `json:",inline"` |
|
| 24 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 25 |
- Items []User `json:"items"` |
|
| 26 |
-} |
|
| 27 |
- |
|
| 28 |
-type Identity struct {
|
|
| 29 |
- unversioned.TypeMeta `json:",inline"` |
|
| 30 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 31 |
- |
|
| 32 |
- // ProviderName is the source of identity information |
|
| 33 |
- ProviderName string `json:"providerName"` |
|
| 34 |
- |
|
| 35 |
- // ProviderUserName uniquely represents this identity in the scope of the provider |
|
| 36 |
- ProviderUserName string `json:"providerUserName"` |
|
| 37 |
- |
|
| 38 |
- // User is a reference to the user this identity is associated with |
|
| 39 |
- // Both Name and UID must be set |
|
| 40 |
- User kapi.ObjectReference `json:"user"` |
|
| 41 |
- |
|
| 42 |
- Extra map[string]string `json:"extra,omitempty"` |
|
| 43 |
-} |
|
| 44 |
- |
|
| 45 |
-type IdentityList struct {
|
|
| 46 |
- unversioned.TypeMeta `json:",inline"` |
|
| 47 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 48 |
- Items []Identity `json:"items"` |
|
| 49 |
-} |
|
| 50 |
- |
|
| 51 |
-type UserIdentityMapping struct {
|
|
| 52 |
- unversioned.TypeMeta `json:",inline"` |
|
| 53 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 54 |
- |
|
| 55 |
- Identity kapi.ObjectReference `json:"identity,omitempty"` |
|
| 56 |
- User kapi.ObjectReference `json:"user,omitempty"` |
|
| 57 |
-} |
|
| 58 |
- |
|
| 59 |
-// Group represents a referenceable set of Users |
|
| 60 |
-type Group struct {
|
|
| 61 |
- unversioned.TypeMeta `json:",inline"` |
|
| 62 |
- kapi.ObjectMeta `json:"metadata,omitempty"` |
|
| 63 |
- |
|
| 64 |
- // Users is the list of users in this group. |
|
| 65 |
- Users []string `json:"users"` |
|
| 66 |
-} |
|
| 67 |
- |
|
| 68 |
-type GroupList struct {
|
|
| 69 |
- unversioned.TypeMeta `json:",inline"` |
|
| 70 |
- unversioned.ListMeta `json:"metadata,omitempty"` |
|
| 71 |
- Items []Group `json:"items"` |
|
| 72 |
-} |
| ... | ... |
@@ -119,8 +119,8 @@ os::cmd::expect_success 'oc get -f test/testdata/mixed-api-versions.yaml -o |
| 119 | 119 |
os::cmd::expect_success 'oc label -f test/testdata/mixed-api-versions.yaml mylabel=a' |
| 120 | 120 |
os::cmd::expect_success 'oc annotate -f test/testdata/mixed-api-versions.yaml myannotation=b' |
| 121 | 121 |
# Make sure all six resources, with different API versions, got labeled and annotated |
| 122 |
-os::cmd::expect_success_and_text 'oc get -f test/testdata/mixed-api-versions.yaml --output-version=v1 --output=jsonpath="{..metadata.labels.mylabel}"' '^a a a a a a$'
|
|
| 123 |
-os::cmd::expect_success_and_text 'oc get -f test/testdata/mixed-api-versions.yaml --output-version=v1 --output=jsonpath="{..metadata.annotations.myannotation}"' '^b b b b b b$'
|
|
| 122 |
+os::cmd::expect_success_and_text 'oc get -f test/testdata/mixed-api-versions.yaml --output-version=v1 --output=jsonpath="{..metadata.labels.mylabel}"' '^a a a a a$'
|
|
| 123 |
+os::cmd::expect_success_and_text 'oc get -f test/testdata/mixed-api-versions.yaml --output-version=v1 --output=jsonpath="{..metadata.annotations.myannotation}"' '^b b b b b$'
|
|
| 124 | 124 |
os::cmd::expect_success 'oc delete -f test/testdata/mixed-api-versions.yaml' |
| 125 | 125 |
echo "list version conversion: ok" |
| 126 | 126 |
os::test::junit::declare_suite_end |
| ... | ... |
@@ -52,7 +52,7 @@ os::cmd::expect_success_and_text 'oc env dc/test-deployment-config OTHER=foo -o |
| 52 | 52 |
os::cmd::expect_success_and_text 'echo OTHER=foo | oc env dc/test-deployment-config -e - --list' 'OTHER=foo' |
| 53 | 53 |
os::cmd::expect_success_and_not_text 'echo #OTHER=foo | oc env dc/test-deployment-config -e - --list' 'OTHER=foo' |
| 54 | 54 |
os::cmd::expect_success 'oc env dc/test-deployment-config TEST=bar OTHER=baz BAR-' |
| 55 |
-os::cmd::expect_success_and_not_text 'oc env -f test/integration/testdata/test-deployment-config.yaml TEST=VERSION -o yaml' 'v1beta3' |
|
| 55 |
+os::cmd::expect_success_and_text 'oc env -f test/integration/testdata/test-deployment-config.yaml TEST=VERSION -o yaml' 'v1' |
|
| 56 | 56 |
os::cmd::expect_success 'oc env dc/test-deployment-config A=a B=b C=c D=d E=e F=f G=g' |
| 57 | 57 |
os::cmd::expect_success_and_text 'oc env dc/test-deployment-config --list' 'A=a' |
| 58 | 58 |
os::cmd::expect_success_and_text 'oc env dc/test-deployment-config --list' 'B=b' |
| ... | ... |
@@ -23,7 +23,7 @@ function wait_for_app() {
|
| 23 | 23 |
|
| 24 | 24 |
echo "[INFO] Waiting for database service to start" |
| 25 | 25 |
os::cmd::try_until_text "oc get -n $1 services" 'database' "$(( 2 * TIME_MIN ))" |
| 26 |
- DB_IP=$(oc get -n "$1" --template="{{ .spec.portalIP }}" service database)
|
|
| 26 |
+ DB_IP=$(oc get -n "$1" --output-version=v1 --template="{{ .spec.portalIP }}" service database)
|
|
| 27 | 27 |
|
| 28 | 28 |
echo "[INFO] Waiting for frontend pod to start" |
| 29 | 29 |
os::cmd::try_until_text "oc get -n $1 pods" 'frontend.+Running' "$(( 2 * TIME_MIN ))" |
| ... | ... |
@@ -31,7 +31,7 @@ function wait_for_app() {
|
| 31 | 31 |
|
| 32 | 32 |
echo "[INFO] Waiting for frontend service to start" |
| 33 | 33 |
os::cmd::try_until_text "oc get -n $1 services" 'frontend' "$(( 2 * TIME_MIN ))" |
| 34 |
- FRONTEND_IP=$(oc get -n "$1" --template="{{ .spec.portalIP }}" service frontend)
|
|
| 34 |
+ FRONTEND_IP=$(oc get -n "$1" --output-version=v1 --template="{{ .spec.portalIP }}" service frontend)
|
|
| 35 | 35 |
|
| 36 | 36 |
echo "[INFO] Waiting for database to start..." |
| 37 | 37 |
wait_for_url_timed "http://${DB_IP}:5434" "[INFO] Database says: " $((3*TIME_MIN))
|
| ... | ... |
@@ -90,7 +90,7 @@ os::cmd::expect_success_and_text "oc rsh dc/docker-registry cat config.yml" "500 |
| 90 | 90 |
os::cmd::expect_success_and_text "oc rsh rc/docker-registry-1 cat config.yml" "5000" |
| 91 | 91 |
|
| 92 | 92 |
# services can end up on any IP. Make sure we get the IP we need for the docker registry |
| 93 |
-DOCKER_REGISTRY=$(oc get --template="{{ .spec.portalIP }}:{{ (index .spec.ports 0).port }}" service docker-registry)
|
|
| 93 |
+DOCKER_REGISTRY=$(oc get --output-version=v1 --template="{{ .spec.portalIP }}:{{ (index .spec.ports 0).port }}" service docker-registry)
|
|
| 94 | 94 |
|
| 95 | 95 |
os::cmd::expect_success_and_text "dig @${API_HOST} docker-registry.default.svc.cluster.local. +short A | head -n 1" "${DOCKER_REGISTRY/:5000}"
|
| 96 | 96 |
|
| ... | ... |
@@ -326,14 +326,14 @@ os::cmd::expect_success_and_text "oc rsh ${frontend_pod} ls /tmp/sample-app" 'ap
|
| 326 | 326 |
#echo "[INFO] Applying Docker application config" |
| 327 | 327 |
#oc create -n docker -f "${DOCKER_CONFIG_FILE}"
|
| 328 | 328 |
#echo "[INFO] Invoking generic web hook to trigger new docker build using curl" |
| 329 |
-#curl -k -X POST $API_SCHEME://$API_HOST:$API_PORT/osapi/v1beta3/namespaces/docker/buildconfigs/ruby-sample-build/webhooks/secret101/generic && sleep 3 |
|
| 329 |
+#curl -k -X POST $API_SCHEME://$API_HOST:$API_PORT/oapi/v1/namespaces/docker/buildconfigs/ruby-sample-build/webhooks/secret101/generic && sleep 3 |
|
| 330 | 330 |
#os::build:wait_for_end "docker" |
| 331 | 331 |
#wait_for_app "docker" |
| 332 | 332 |
|
| 333 | 333 |
#echo "[INFO] Applying Custom application config" |
| 334 | 334 |
#oc create -n custom -f "${CUSTOM_CONFIG_FILE}"
|
| 335 | 335 |
#echo "[INFO] Invoking generic web hook to trigger new custom build using curl" |
| 336 |
-#curl -k -X POST $API_SCHEME://$API_HOST:$API_PORT/osapi/v1beta3/namespaces/custom/buildconfigs/ruby-sample-build/webhooks/secret101/generic && sleep 3 |
|
| 336 |
+#curl -k -X POST $API_SCHEME://$API_HOST:$API_PORT/oapi/v1/namespaces/custom/buildconfigs/ruby-sample-build/webhooks/secret101/generic && sleep 3 |
|
| 337 | 337 |
#os::build:wait_for_end "custom" |
| 338 | 338 |
#wait_for_app "custom" |
| 339 | 339 |
|
| ... | ... |
@@ -342,7 +342,7 @@ os::cmd::expect_success "oc project ${CLUSTER_ADMIN_CONTEXT}"
|
| 342 | 342 |
|
| 343 | 343 |
# ensure the router is started |
| 344 | 344 |
# TODO: simplify when #4702 is fixed upstream |
| 345 |
-os::cmd::try_until_text "oc get endpoints router --template='{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}'" '[1-9]+' $((5*TIME_MIN))
|
|
| 345 |
+os::cmd::try_until_text "oc get endpoints router --output-version=v1 --template='{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}'" '[1-9]+' $((5*TIME_MIN))
|
|
| 346 | 346 |
echo "[INFO] Waiting for router to start..." |
| 347 | 347 |
router_pod=$(oc get pod -n default -l deploymentconfig=router --template='{{(index .items 0).metadata.name}}')
|
| 348 | 348 |
healthz_uri="http://$(oc get pod "${router_pod}" --template='{{.status.podIP}}'):1936/healthz"
|
| ... | ... |
@@ -88,7 +88,7 @@ wait_for_command 'oc get pods -l deploymentconfig=openldap-server --template="${
|
| 88 | 88 |
oc login -u system:admin -n openldap |
| 89 | 89 |
|
| 90 | 90 |
|
| 91 |
-LDAP_SERVICE_IP=$(oc get --output-version=v1beta3 --template="{{ .spec.portalIP }}" service openldap-server)
|
|
| 91 |
+LDAP_SERVICE_IP=$(oc get --output-version=v1 --template="{{ .spec.portalIP }}" service openldap-server)
|
|
| 92 | 92 |
|
| 93 | 93 |
function compare_and_cleanup() {
|
| 94 | 94 |
validation_file=$1 |
| ... | ... |
@@ -238,7 +238,7 @@ grep 'For group "cn=group1,ou=groups,ou=incomplete\-rfc2307,dc=example,dc=com", |
| 238 | 238 |
grep 'For group "cn=group2,ou=groups,ou=incomplete\-rfc2307,dc=example,dc=com", ignoring member "cn=OUTOFSCOPE,ou=people,ou=OUTOFSCOPE,dc=example,dc=com"' "${LOG_DIR}/tolerated-output.txt"
|
| 239 | 239 |
grep 'For group "cn=group3,ou=groups,ou=incomplete\-rfc2307,dc=example,dc=com", ignoring member "cn=INVALID,ou=people,ou=rfc2307,dc=example,dc=com"' "${LOG_DIR}/tolerated-output.txt"
|
| 240 | 240 |
grep 'For group "cn=group3,ou=groups,ou=incomplete\-rfc2307,dc=example,dc=com", ignoring member "cn=OUTOFSCOPE,ou=people,ou=OUTOFSCOPE,dc=example,dc=com"' "${LOG_DIR}/tolerated-output.txt"
|
| 241 |
-compare_and_cleanup valid_all_ldap_sync_tolerating.yaml |
|
| 241 |
+compare_and_cleanup valid_all_ldap_sync_tolerating.yaml |
|
| 242 | 242 |
popd > /dev/null |
| 243 | 243 |
|
| 244 | 244 |
# special test for augmented-ad |
| ... | ... |
@@ -247,5 +247,5 @@ echo -e "\tTEST: Sync all LDAP groups from LDAP server, remove LDAP group metada |
| 247 | 247 |
oadm groups sync --sync-config=sync-config.yaml --confirm |
| 248 | 248 |
ldapdelete -x -h $LDAP_SERVICE_IP -p 389 -D cn=Manager,dc=example,dc=com -w admin "${group1_ldapuid}"
|
| 249 | 249 |
oadm groups prune --sync-config=sync-config.yaml --confirm |
| 250 |
-compare_and_cleanup valid_all_ldap_sync_delete_prune.yaml |
|
| 250 |
+compare_and_cleanup valid_all_ldap_sync_delete_prune.yaml |
|
| 251 | 251 |
popd > /dev/null |
| ... | ... |
@@ -191,8 +191,7 @@ func (s *TestHttpService) Start() error {
|
| 191 | 191 |
|
| 192 | 192 |
func (s *TestHttpService) startMaster() error {
|
| 193 | 193 |
masterServer := http.NewServeMux() |
| 194 |
- // TODO: this is incorrect |
|
| 195 |
- apis := []string{"v1beta3", "v1"}
|
|
| 194 |
+ apis := []string{"v1"}
|
|
| 196 | 195 |
|
| 197 | 196 |
for _, version := range apis {
|
| 198 | 197 |
masterServer.HandleFunc(fmt.Sprintf("/api/%s/endpoints", version), s.handleEndpointList)
|
| ... | ... |
@@ -22,7 +22,6 @@ import ( |
| 22 | 22 |
|
| 23 | 23 |
kapi "k8s.io/kubernetes/pkg/api" |
| 24 | 24 |
"k8s.io/kubernetes/pkg/api/unversioned" |
| 25 |
- "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 26 | 25 |
"k8s.io/kubernetes/pkg/util/intstr" |
| 27 | 26 |
knet "k8s.io/kubernetes/pkg/util/net" |
| 28 | 27 |
"k8s.io/kubernetes/pkg/util/wait" |
| ... | ... |
@@ -30,6 +29,7 @@ import ( |
| 30 | 30 |
watchjson "k8s.io/kubernetes/pkg/watch/json" |
| 31 | 31 |
|
| 32 | 32 |
routeapi "github.com/openshift/origin/pkg/route/api" |
| 33 |
+ "github.com/openshift/origin/pkg/route/api/v1" |
|
| 33 | 34 |
tr "github.com/openshift/origin/test/integration/router" |
| 34 | 35 |
testutil "github.com/openshift/origin/test/util" |
| 35 | 36 |
) |
| ... | ... |
@@ -1201,7 +1201,7 @@ func waitForRoute(routerUrl string, hostName string, protocol string, headers ma |
| 1201 | 1201 |
|
| 1202 | 1202 |
// eventString marshals the event into a string |
| 1203 | 1203 |
func eventString(e *watch.Event) string {
|
| 1204 |
- obj, _ := watchjson.Object(kapi.Codecs.LegacyCodec(v1beta3.SchemeGroupVersion), e) |
|
| 1204 |
+ obj, _ := watchjson.Object(kapi.Codecs.LegacyCodec(v1.SchemeGroupVersion), e) |
|
| 1205 | 1205 |
s, _ := json.Marshal(obj) |
| 1206 | 1206 |
return string(s) |
| 1207 | 1207 |
} |
| ... | ... |
@@ -1,11 +1,11 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "List", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {},
|
| 5 | 5 |
"items": [ |
| 6 | 6 |
{
|
| 7 | 7 |
"kind": "ImageStream", |
| 8 |
- "apiVersion": "v1beta3", |
|
| 8 |
+ "apiVersion": "v1", |
|
| 9 | 9 |
"metadata": {
|
| 10 | 10 |
"name": "ruby-22-centos-buildcli", |
| 11 | 11 |
"creationTimestamp": null |
| ... | ... |
@@ -24,7 +24,7 @@ |
| 24 | 24 |
}, |
| 25 | 25 |
{
|
| 26 | 26 |
"kind": "BuildConfig", |
| 27 |
- "apiVersion": "v1beta3", |
|
| 27 |
+ "apiVersion": "v1", |
|
| 28 | 28 |
"metadata": {
|
| 29 | 29 |
"name": "ruby-sample-build-validtag", |
| 30 | 30 |
"creationTimestamp": null |
| ... | ... |
@@ -67,7 +67,7 @@ |
| 67 | 67 |
}, |
| 68 | 68 |
{
|
| 69 | 69 |
"kind": "BuildConfig", |
| 70 |
- "apiVersion": "v1beta3", |
|
| 70 |
+ "apiVersion": "v1", |
|
| 71 | 71 |
"metadata": {
|
| 72 | 72 |
"name": "ruby-sample-build-invalidtag", |
| 73 | 73 |
"creationTimestamp": null |
| ... | ... |
@@ -1,11 +1,11 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "List", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {},
|
| 5 | 5 |
"items": [ |
| 6 | 6 |
{
|
| 7 | 7 |
"kind": "ImageStream", |
| 8 |
- "apiVersion": "v1beta3", |
|
| 8 |
+ "apiVersion": "v1", |
|
| 9 | 9 |
"metadata": {
|
| 10 | 10 |
"name": "ruby-20-centos7-buildcli", |
| 11 | 11 |
"creationTimestamp": null |
| ... | ... |
@@ -24,7 +24,7 @@ |
| 24 | 24 |
}, |
| 25 | 25 |
{
|
| 26 | 26 |
"kind": "BuildConfig", |
| 27 |
- "apiVersion": "v1beta3", |
|
| 27 |
+ "apiVersion": "v1", |
|
| 28 | 28 |
"metadata": {
|
| 29 | 29 |
"name": "ruby-sample-build-validtag", |
| 30 | 30 |
"creationTimestamp": null |
| ... | ... |
@@ -67,7 +67,7 @@ |
| 67 | 67 |
}, |
| 68 | 68 |
{
|
| 69 | 69 |
"kind": "BuildConfig", |
| 70 |
- "apiVersion": "v1beta3", |
|
| 70 |
+ "apiVersion": "v1", |
|
| 71 | 71 |
"metadata": {
|
| 72 | 72 |
"name": "ruby-sample-build-invalidtag", |
| 73 | 73 |
"creationTimestamp": null |
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "Template", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {
|
| 5 | 5 |
"name": "ruby-helloworld-sample", |
| 6 | 6 |
"creationTimestamp": null, |
| ... | ... |
@@ -11,7 +11,7 @@ |
| 11 | 11 |
"objects": [ |
| 12 | 12 |
{
|
| 13 | 13 |
"kind": "Service", |
| 14 |
- "apiVersion": "v1beta3", |
|
| 14 |
+ "apiVersion": "v1", |
|
| 15 | 15 |
"metadata": {
|
| 16 | 16 |
"name": "frontend", |
| 17 | 17 |
"creationTimestamp": null |
| ... | ... |
@@ -39,7 +39,7 @@ |
| 39 | 39 |
}, |
| 40 | 40 |
{
|
| 41 | 41 |
"kind": "Route", |
| 42 |
- "apiVersion": "v1beta3", |
|
| 42 |
+ "apiVersion": "v1", |
|
| 43 | 43 |
"metadata": {
|
| 44 | 44 |
"name": "route-edge", |
| 45 | 45 |
"creationTimestamp": null |
| ... | ... |
@@ -61,7 +61,7 @@ |
| 61 | 61 |
}, |
| 62 | 62 |
{
|
| 63 | 63 |
"kind": "ImageStream", |
| 64 |
- "apiVersion": "v1beta3", |
|
| 64 |
+ "apiVersion": "v1", |
|
| 65 | 65 |
"metadata": {
|
| 66 | 66 |
"name": "origin-ruby-sample", |
| 67 | 67 |
"creationTimestamp": null |
| ... | ... |
@@ -73,7 +73,7 @@ |
| 73 | 73 |
}, |
| 74 | 74 |
{
|
| 75 | 75 |
"kind": "ImageStream", |
| 76 |
- "apiVersion": "v1beta3", |
|
| 76 |
+ "apiVersion": "v1", |
|
| 77 | 77 |
"metadata": {
|
| 78 | 78 |
"name": "origin-custom-docker-builder", |
| 79 | 79 |
"creationTimestamp": null |
| ... | ... |
@@ -87,7 +87,7 @@ |
| 87 | 87 |
}, |
| 88 | 88 |
{
|
| 89 | 89 |
"kind": "BuildConfig", |
| 90 |
- "apiVersion": "v1beta3", |
|
| 90 |
+ "apiVersion": "v1", |
|
| 91 | 91 |
"metadata": {
|
| 92 | 92 |
"name": "ruby-sample-build", |
| 93 | 93 |
"creationTimestamp": null, |
| ... | ... |
@@ -150,7 +150,7 @@ |
| 150 | 150 |
}, |
| 151 | 151 |
{
|
| 152 | 152 |
"kind": "DeploymentConfig", |
| 153 |
- "apiVersion": "v1beta3", |
|
| 153 |
+ "apiVersion": "v1", |
|
| 154 | 154 |
"metadata": {
|
| 155 | 155 |
"name": "frontend", |
| 156 | 156 |
"creationTimestamp": null |
| ... | ... |
@@ -248,7 +248,7 @@ |
| 248 | 248 |
}, |
| 249 | 249 |
{
|
| 250 | 250 |
"kind": "Service", |
| 251 |
- "apiVersion": "v1beta3", |
|
| 251 |
+ "apiVersion": "v1", |
|
| 252 | 252 |
"metadata": {
|
| 253 | 253 |
"name": "database", |
| 254 | 254 |
"creationTimestamp": null |
| ... | ... |
@@ -276,7 +276,7 @@ |
| 276 | 276 |
}, |
| 277 | 277 |
{
|
| 278 | 278 |
"kind": "DeploymentConfig", |
| 279 |
- "apiVersion": "v1beta3", |
|
| 279 |
+ "apiVersion": "v1", |
|
| 280 | 280 |
"metadata": {
|
| 281 | 281 |
"name": "database", |
| 282 | 282 |
"creationTimestamp": null |
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "Template", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {
|
| 5 | 5 |
"name": "ruby-helloworld-sample", |
| 6 | 6 |
"creationTimestamp": null, |
| ... | ... |
@@ -11,7 +11,7 @@ |
| 11 | 11 |
"objects": [ |
| 12 | 12 |
{
|
| 13 | 13 |
"kind": "Service", |
| 14 |
- "apiVersion": "v1beta3", |
|
| 14 |
+ "apiVersion": "v1", |
|
| 15 | 15 |
"metadata": {
|
| 16 | 16 |
"name": "frontend", |
| 17 | 17 |
"creationTimestamp": null |
| ... | ... |
@@ -39,7 +39,7 @@ |
| 39 | 39 |
}, |
| 40 | 40 |
{
|
| 41 | 41 |
"kind": "Route", |
| 42 |
- "apiVersion": "v1beta3", |
|
| 42 |
+ "apiVersion": "v1", |
|
| 43 | 43 |
"metadata": {
|
| 44 | 44 |
"name": "route-edge", |
| 45 | 45 |
"creationTimestamp": null |
| ... | ... |
@@ -61,7 +61,7 @@ |
| 61 | 61 |
}, |
| 62 | 62 |
{
|
| 63 | 63 |
"kind": "ImageStream", |
| 64 |
- "apiVersion": "v1beta3", |
|
| 64 |
+ "apiVersion": "v1", |
|
| 65 | 65 |
"metadata": {
|
| 66 | 66 |
"name": "origin-ruby-sample", |
| 67 | 67 |
"creationTimestamp": null |
| ... | ... |
@@ -73,7 +73,7 @@ |
| 73 | 73 |
}, |
| 74 | 74 |
{
|
| 75 | 75 |
"kind": "ImageStream", |
| 76 |
- "apiVersion": "v1beta3", |
|
| 76 |
+ "apiVersion": "v1", |
|
| 77 | 77 |
"metadata": {
|
| 78 | 78 |
"name": "ruby-20-centos7", |
| 79 | 79 |
"creationTimestamp": null |
| ... | ... |
@@ -87,7 +87,7 @@ |
| 87 | 87 |
}, |
| 88 | 88 |
{
|
| 89 | 89 |
"kind": "BuildConfig", |
| 90 |
- "apiVersion": "v1beta3", |
|
| 90 |
+ "apiVersion": "v1", |
|
| 91 | 91 |
"metadata": {
|
| 92 | 92 |
"name": "ruby-sample-build", |
| 93 | 93 |
"creationTimestamp": null, |
| ... | ... |
@@ -143,7 +143,7 @@ |
| 143 | 143 |
}, |
| 144 | 144 |
{
|
| 145 | 145 |
"kind": "DeploymentConfig", |
| 146 |
- "apiVersion": "v1beta3", |
|
| 146 |
+ "apiVersion": "v1", |
|
| 147 | 147 |
"metadata": {
|
| 148 | 148 |
"name": "frontend", |
| 149 | 149 |
"creationTimestamp": null |
| ... | ... |
@@ -241,7 +241,7 @@ |
| 241 | 241 |
}, |
| 242 | 242 |
{
|
| 243 | 243 |
"kind": "Service", |
| 244 |
- "apiVersion": "v1beta3", |
|
| 244 |
+ "apiVersion": "v1", |
|
| 245 | 245 |
"metadata": {
|
| 246 | 246 |
"name": "database", |
| 247 | 247 |
"creationTimestamp": null |
| ... | ... |
@@ -269,7 +269,7 @@ |
| 269 | 269 |
}, |
| 270 | 270 |
{
|
| 271 | 271 |
"kind": "DeploymentConfig", |
| 272 |
- "apiVersion": "v1beta3", |
|
| 272 |
+ "apiVersion": "v1", |
|
| 273 | 273 |
"metadata": {
|
| 274 | 274 |
"name": "database", |
| 275 | 275 |
"creationTimestamp": null |
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "Template", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {
|
| 5 | 5 |
"name": "ruby-helloworld-sample", |
| 6 | 6 |
"creationTimestamp": null, |
| ... | ... |
@@ -13,7 +13,7 @@ |
| 13 | 13 |
"objects": [ |
| 14 | 14 |
{
|
| 15 | 15 |
"kind": "Service", |
| 16 |
- "apiVersion": "v1beta3", |
|
| 16 |
+ "apiVersion": "v1", |
|
| 17 | 17 |
"metadata": {
|
| 18 | 18 |
"name": "frontend", |
| 19 | 19 |
"creationTimestamp": null |
| ... | ... |
@@ -41,7 +41,7 @@ |
| 41 | 41 |
}, |
| 42 | 42 |
{
|
| 43 | 43 |
"kind": "Route", |
| 44 |
- "apiVersion": "v1beta3", |
|
| 44 |
+ "apiVersion": "v1", |
|
| 45 | 45 |
"metadata": {
|
| 46 | 46 |
"name": "route-edge", |
| 47 | 47 |
"creationTimestamp": null |
| ... | ... |
@@ -63,7 +63,7 @@ |
| 63 | 63 |
}, |
| 64 | 64 |
{
|
| 65 | 65 |
"kind": "ImageStream", |
| 66 |
- "apiVersion": "v1beta3", |
|
| 66 |
+ "apiVersion": "v1", |
|
| 67 | 67 |
"metadata": {
|
| 68 | 68 |
"name": "origin-ruby-sample", |
| 69 | 69 |
"creationTimestamp": null |
| ... | ... |
@@ -75,7 +75,7 @@ |
| 75 | 75 |
}, |
| 76 | 76 |
{
|
| 77 | 77 |
"kind": "ImageStream", |
| 78 |
- "apiVersion": "v1beta3", |
|
| 78 |
+ "apiVersion": "v1", |
|
| 79 | 79 |
"metadata": {
|
| 80 | 80 |
"name": "ruby-20-centos7", |
| 81 | 81 |
"creationTimestamp": null |
| ... | ... |
@@ -89,7 +89,7 @@ |
| 89 | 89 |
}, |
| 90 | 90 |
{
|
| 91 | 91 |
"kind": "BuildConfig", |
| 92 |
- "apiVersion": "v1beta3", |
|
| 92 |
+ "apiVersion": "v1", |
|
| 93 | 93 |
"metadata": {
|
| 94 | 94 |
"name": "ruby-sample-build", |
| 95 | 95 |
"creationTimestamp": null, |
| ... | ... |
@@ -146,7 +146,7 @@ |
| 146 | 146 |
}, |
| 147 | 147 |
{
|
| 148 | 148 |
"kind": "DeploymentConfig", |
| 149 |
- "apiVersion": "v1beta3", |
|
| 149 |
+ "apiVersion": "v1", |
|
| 150 | 150 |
"metadata": {
|
| 151 | 151 |
"name": "frontend", |
| 152 | 152 |
"creationTimestamp": null |
| ... | ... |
@@ -274,7 +274,7 @@ |
| 274 | 274 |
}, |
| 275 | 275 |
{
|
| 276 | 276 |
"kind": "Service", |
| 277 |
- "apiVersion": "v1beta3", |
|
| 277 |
+ "apiVersion": "v1", |
|
| 278 | 278 |
"metadata": {
|
| 279 | 279 |
"name": "database", |
| 280 | 280 |
"creationTimestamp": null |
| ... | ... |
@@ -302,7 +302,7 @@ |
| 302 | 302 |
}, |
| 303 | 303 |
{
|
| 304 | 304 |
"kind": "DeploymentConfig", |
| 305 |
- "apiVersion": "v1beta3", |
|
| 305 |
+ "apiVersion": "v1", |
|
| 306 | 306 |
"metadata": {
|
| 307 | 307 |
"name": "database", |
| 308 | 308 |
"creationTimestamp": null |
| ... | ... |
@@ -102,7 +102,7 @@ function cleanup_openshift {
|
| 102 | 102 |
|
| 103 | 103 |
set +e |
| 104 | 104 |
dump_container_logs |
| 105 |
- |
|
| 105 |
+ |
|
| 106 | 106 |
echo "[INFO] Dumping all resources to ${LOG_DIR}/export_all.json"
|
| 107 | 107 |
oc export all --all-namespaces --raw -o json --config=${ADMIN_KUBECONFIG} > ${LOG_DIR}/export_all.json
|
| 108 | 108 |
|
| ... | ... |
@@ -126,7 +126,7 @@ function cleanup_openshift {
|
| 126 | 126 |
|
| 127 | 127 |
echo "[INFO] Cleanup complete" |
| 128 | 128 |
set -e |
| 129 |
-} |
|
| 129 |
+} |
|
| 130 | 130 |
|
| 131 | 131 |
# dump_container_logs writes container logs to $LOG_DIR |
| 132 | 132 |
function dump_container_logs() |
| ... | ... |
@@ -146,7 +146,7 @@ function dump_container_logs() |
| 146 | 146 |
done |
| 147 | 147 |
} |
| 148 | 148 |
|
| 149 |
-# kill_all_processes function will kill all |
|
| 149 |
+# kill_all_processes function will kill all |
|
| 150 | 150 |
# all processes created by the test script. |
| 151 | 151 |
function kill_all_processes() |
| 152 | 152 |
{
|
| ... | ... |
@@ -200,14 +200,14 @@ function wait_for_app() {
|
| 200 | 200 |
|
| 201 | 201 |
echo "[INFO] Waiting for database service to start" |
| 202 | 202 |
wait_for_command "oc get -n $1 services | grep database" $((20*TIME_SEC)) |
| 203 |
- DB_IP=$(oc get -n $1 --output-version=v1beta3 --template="{{ .spec.portalIP }}" service database)
|
|
| 203 |
+ DB_IP=$(oc get -n $1 --output-version=v1 --template="{{ .spec.portalIP }}" service database)
|
|
| 204 | 204 |
|
| 205 | 205 |
echo "[INFO] Waiting for frontend pod to start" |
| 206 | 206 |
wait_for_command "oc get -n $1 pods | grep frontend | grep -i Running" $((120*TIME_SEC)) |
| 207 | 207 |
|
| 208 | 208 |
echo "[INFO] Waiting for frontend service to start" |
| 209 | 209 |
wait_for_command "oc get -n $1 services | grep frontend" $((20*TIME_SEC)) |
| 210 |
- FRONTEND_IP=$(oc get -n $1 --output-version=v1beta3 --template="{{ .spec.portalIP }}" service frontend)
|
|
| 210 |
+ FRONTEND_IP=$(oc get -n $1 --output-version=v1 --template="{{ .spec.portalIP }}" service frontend)
|
|
| 211 | 211 |
|
| 212 | 212 |
echo "[INFO] Waiting for database to start..." |
| 213 | 213 |
wait_for_url_timed "http://${DB_IP}:5434" "[INFO] Database says: " $((3*TIME_MIN))
|
| ... | ... |
@@ -225,7 +225,7 @@ function wait_for_app() {
|
| 225 | 225 |
function wait_for_build() {
|
| 226 | 226 |
echo "[INFO] Waiting for $1 namespace build to complete" |
| 227 | 227 |
wait_for_command "oc get -n $1 builds | grep -i complete" $((10*TIME_MIN)) "oc get -n $1 builds | grep -i -e failed -e error" |
| 228 |
- BUILD_ID=`oc get -n $1 builds --output-version=v1beta3 --template="{{with index .items 0}}{{.metadata.name}}{{end}}"`
|
|
| 228 |
+ BUILD_ID=`oc get -n $1 builds --output-version=v1 --template="{{with index .items 0}}{{.metadata.name}}{{end}}"`
|
|
| 229 | 229 |
echo "[INFO] Build ${BUILD_ID} finished"
|
| 230 | 230 |
# TODO: fix |
| 231 | 231 |
set +e |
| ... | ... |
@@ -312,10 +312,10 @@ echo "[INFO] Pulled ruby-22-centos7" |
| 312 | 312 |
|
| 313 | 313 |
echo "[INFO] Waiting for Docker registry pod to start" |
| 314 | 314 |
# TODO: simplify when #4702 is fixed upstream |
| 315 |
-wait_for_command '[[ "$(oc get endpoints docker-registry --output-version=v1beta3 --template="{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}" || echo "0")" != "0" ]]' $((5*TIME_MIN))
|
|
| 315 |
+wait_for_command '[[ "$(oc get endpoints docker-registry --output-version=v1 --template="{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}" || echo "0")" != "0" ]]' $((5*TIME_MIN))
|
|
| 316 | 316 |
|
| 317 | 317 |
# services can end up on any IP. Make sure we get the IP we need for the docker registry |
| 318 |
-DOCKER_REGISTRY=$(oc get --output-version=v1beta3 --template="{{ .spec.portalIP }}:{{ with index .spec.ports 0 }}{{ .port }}{{ end }}" service docker-registry)
|
|
| 318 |
+DOCKER_REGISTRY=$(oc get --output-version=v1 --template="{{ .spec.portalIP }}:{{ with index .spec.ports 0 }}{{ .port }}{{ end }}" service docker-registry)
|
|
| 319 | 319 |
|
| 320 | 320 |
registry="$(dig @${API_HOST} "docker-registry.default.svc.cluster.local." +short A | head -n 1)"
|
| 321 | 321 |
[[ -n "${registry}" && "${registry}:5000" == "${DOCKER_REGISTRY}" ]]
|
| ... | ... |
@@ -373,14 +373,14 @@ wait_for_app "test" |
| 373 | 373 |
#echo "[INFO] Applying Docker application config" |
| 374 | 374 |
#oc create -n docker -f "${DOCKER_CONFIG_FILE}"
|
| 375 | 375 |
#echo "[INFO] Invoking generic web hook to trigger new docker build using curl" |
| 376 |
-#curl -k -X POST $API_SCHEME://$API_HOST:$API_PORT/osapi/v1beta3/namespaces/docker/buildconfigs/ruby-sample-build/webhooks/secret101/generic && sleep 3 |
|
| 376 |
+#curl -k -X POST $API_SCHEME://$API_HOST:$API_PORT/osapi/v1/namespaces/docker/buildconfigs/ruby-sample-build/webhooks/secret101/generic && sleep 3 |
|
| 377 | 377 |
#wait_for_build "docker" |
| 378 | 378 |
#wait_for_app "docker" |
| 379 | 379 |
|
| 380 | 380 |
#echo "[INFO] Applying Custom application config" |
| 381 | 381 |
#oc create -n custom -f "${CUSTOM_CONFIG_FILE}"
|
| 382 | 382 |
#echo "[INFO] Invoking generic web hook to trigger new custom build using curl" |
| 383 |
-#curl -k -X POST $API_SCHEME://$API_HOST:$API_PORT/osapi/v1beta3/namespaces/custom/buildconfigs/ruby-sample-build/webhooks/secret101/generic && sleep 3 |
|
| 383 |
+#curl -k -X POST $API_SCHEME://$API_HOST:$API_PORT/osapi/v1/namespaces/custom/buildconfigs/ruby-sample-build/webhooks/secret101/generic && sleep 3 |
|
| 384 | 384 |
#wait_for_build "custom" |
| 385 | 385 |
#wait_for_app "custom" |
| 386 | 386 |
|
| ... | ... |
@@ -389,7 +389,7 @@ oc project ${CLUSTER_ADMIN_CONTEXT}
|
| 389 | 389 |
|
| 390 | 390 |
# ensure the router is started |
| 391 | 391 |
# TODO: simplify when #4702 is fixed upstream |
| 392 |
-wait_for_command '[[ "$(oc get endpoints router --output-version=v1beta3 --template="{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}" || echo "0")" != "0" ]]' $((5*TIME_MIN))
|
|
| 392 |
+wait_for_command '[[ "$(oc get endpoints router --output-version=v1 --template="{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}" || echo "0")" != "0" ]]' $((5*TIME_MIN))
|
|
| 393 | 393 |
|
| 394 | 394 |
echo "[INFO] Validating routed app response..." |
| 395 | 395 |
validate_response "-s -k --resolve www.example.com:443:${CONTAINER_ACCESSIBLE_API_HOST} https://www.example.com" "Hello from OpenShift" 0.2 50
|
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "Template", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {
|
| 5 | 5 |
"name": "node-example", |
| 6 | 6 |
"creationTimestamp": null |
| ... | ... |
@@ -8,7 +8,7 @@ |
| 8 | 8 |
"objects": [ |
| 9 | 9 |
{
|
| 10 | 10 |
"kind": "Pod", |
| 11 |
- "apiVersion": "v1beta3", |
|
| 11 |
+ "apiVersion": "v1", |
|
| 12 | 12 |
"metadata": {
|
| 13 | 13 |
"name": "pg-standalone-1", |
| 14 | 14 |
"creationTimestamp": null, |
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "Template", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {
|
| 5 | 5 |
"name": "guestbook-example", |
| 6 | 6 |
"creationTimestamp": null, |
| ... | ... |
@@ -11,7 +11,7 @@ |
| 11 | 11 |
"objects": [ |
| 12 | 12 |
{
|
| 13 | 13 |
"kind": "Route", |
| 14 |
- "apiVersion": "v1beta3", |
|
| 14 |
+ "apiVersion": "v1", |
|
| 15 | 15 |
"metadata": {
|
| 16 | 16 |
"name": "frontend-route", |
| 17 | 17 |
"creationTimestamp": null |
| ... | ... |
@@ -27,7 +27,7 @@ |
| 27 | 27 |
}, |
| 28 | 28 |
{
|
| 29 | 29 |
"kind": "Service", |
| 30 |
- "apiVersion": "v1beta3", |
|
| 30 |
+ "apiVersion": "v1", |
|
| 31 | 31 |
"metadata": {
|
| 32 | 32 |
"name": "frontend-service", |
| 33 | 33 |
"creationTimestamp": null |
| ... | ... |
@@ -54,7 +54,7 @@ |
| 54 | 54 |
}, |
| 55 | 55 |
{
|
| 56 | 56 |
"kind": "Service", |
| 57 |
- "apiVersion": "v1beta3", |
|
| 57 |
+ "apiVersion": "v1", |
|
| 58 | 58 |
"metadata": {
|
| 59 | 59 |
"name": "redis-master", |
| 60 | 60 |
"creationTimestamp": null |
| ... | ... |
@@ -81,7 +81,7 @@ |
| 81 | 81 |
}, |
| 82 | 82 |
{
|
| 83 | 83 |
"kind": "Service", |
| 84 |
- "apiVersion": "v1beta3", |
|
| 84 |
+ "apiVersion": "v1", |
|
| 85 | 85 |
"metadata": {
|
| 86 | 86 |
"name": "${SLAVE_SERVICE_NAME}",
|
| 87 | 87 |
"creationTimestamp": null |
| ... | ... |
@@ -108,7 +108,7 @@ |
| 108 | 108 |
}, |
| 109 | 109 |
{
|
| 110 | 110 |
"kind": "Pod", |
| 111 |
- "apiVersion": "v1beta3", |
|
| 111 |
+ "apiVersion": "v1", |
|
| 112 | 112 |
"metadata": {
|
| 113 | 113 |
"name": "redis-master", |
| 114 | 114 |
"creationTimestamp": null, |
| ... | ... |
@@ -151,7 +151,7 @@ |
| 151 | 151 |
}, |
| 152 | 152 |
{
|
| 153 | 153 |
"kind": "ReplicationController", |
| 154 |
- "apiVersion": "v1beta3", |
|
| 154 |
+ "apiVersion": "v1", |
|
| 155 | 155 |
"metadata": {
|
| 156 | 156 |
"name": "guestbook", |
| 157 | 157 |
"creationTimestamp": null, |
| ... | ... |
@@ -219,7 +219,7 @@ |
| 219 | 219 |
}, |
| 220 | 220 |
{
|
| 221 | 221 |
"kind": "ReplicationController", |
| 222 |
- "apiVersion": "v1beta3", |
|
| 222 |
+ "apiVersion": "v1", |
|
| 223 | 223 |
"metadata": {
|
| 224 | 224 |
"name": "${SLAVE_SERVICE_NAME}",
|
| 225 | 225 |
"creationTimestamp": null, |
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
{
|
| 2 | 2 |
"kind": "Template", |
| 3 |
- "apiVersion": "v1beta3", |
|
| 3 |
+ "apiVersion": "v1", |
|
| 4 | 4 |
"metadata": {
|
| 5 | 5 |
"name": "guestbook-example", |
| 6 | 6 |
"creationTimestamp": null, |
| ... | ... |
@@ -10,7 +10,7 @@ |
| 10 | 10 |
}, |
| 11 | 11 |
"objects": [ |
| 12 | 12 |
{
|
| 13 |
- "apiVersion": "v1beta3", |
|
| 13 |
+ "apiVersion": "v1", |
|
| 14 | 14 |
"kind": "Route", |
| 15 | 15 |
"metadata": {
|
| 16 | 16 |
"creationTimestamp": null, |
| ... | ... |
@@ -26,7 +26,7 @@ |
| 26 | 26 |
"status": {}
|
| 27 | 27 |
}, |
| 28 | 28 |
{
|
| 29 |
- "apiVersion": "v1beta3", |
|
| 29 |
+ "apiVersion": "v1", |
|
| 30 | 30 |
"kind": "Service", |
| 31 | 31 |
"metadata": {
|
| 32 | 32 |
"creationTimestamp": null, |
| ... | ... |
@@ -53,7 +53,7 @@ |
| 53 | 53 |
} |
| 54 | 54 |
}, |
| 55 | 55 |
{
|
| 56 |
- "apiVersion": "v1beta3", |
|
| 56 |
+ "apiVersion": "v1", |
|
| 57 | 57 |
"kind": "Service", |
| 58 | 58 |
"metadata": {
|
| 59 | 59 |
"creationTimestamp": null, |
| ... | ... |
@@ -80,7 +80,7 @@ |
| 80 | 80 |
} |
| 81 | 81 |
}, |
| 82 | 82 |
{
|
| 83 |
- "apiVersion": "v1beta3", |
|
| 83 |
+ "apiVersion": "v1", |
|
| 84 | 84 |
"kind": "Service", |
| 85 | 85 |
"metadata": {
|
| 86 | 86 |
"creationTimestamp": null, |
| ... | ... |
@@ -107,7 +107,7 @@ |
| 107 | 107 |
} |
| 108 | 108 |
}, |
| 109 | 109 |
{
|
| 110 |
- "apiVersion": "v1beta3", |
|
| 110 |
+ "apiVersion": "v1", |
|
| 111 | 111 |
"kind": "Pod", |
| 112 | 112 |
"metadata": {
|
| 113 | 113 |
"creationTimestamp": null, |
| ... | ... |
@@ -150,7 +150,7 @@ |
| 150 | 150 |
"status": {}
|
| 151 | 151 |
}, |
| 152 | 152 |
{
|
| 153 |
- "apiVersion": "v1beta3", |
|
| 153 |
+ "apiVersion": "v1", |
|
| 154 | 154 |
"kind": "ReplicationController", |
| 155 | 155 |
"metadata": {
|
| 156 | 156 |
"creationTimestamp": null, |
| ... | ... |
@@ -218,7 +218,7 @@ |
| 218 | 218 |
} |
| 219 | 219 |
}, |
| 220 | 220 |
{
|
| 221 |
- "apiVersion": "v1beta3", |
|
| 221 |
+ "apiVersion": "v1", |
|
| 222 | 222 |
"kind": "ReplicationController", |
| 223 | 223 |
"metadata": {
|
| 224 | 224 |
"creationTimestamp": null, |
| ... | ... |
@@ -9,12 +9,12 @@ objects: |
| 9 | 9 |
annotations: |
| 10 | 10 |
description: v1 Secret - used to test v1 negotiation of k8s objects |
| 11 | 11 |
name: v1-secret |
| 12 |
-- apiVersion: v1beta3 |
|
| 12 |
+- apiVersion: v1 |
|
| 13 | 13 |
kind: Secret |
| 14 | 14 |
metadata: |
| 15 | 15 |
annotations: |
| 16 |
- description: v1beta3 Secret - used to test v1beta3 negotiation of k8s objects |
|
| 17 |
- name: v1beta3-secret |
|
| 16 |
+ description: v1 Secret - used to test v1 negotiation of k8s objects |
|
| 17 |
+ name: v1-secret |
|
| 18 | 18 |
- apiVersion: v1 |
| 19 | 19 |
kind: Route |
| 20 | 20 |
metadata: |
| ... | ... |
@@ -25,12 +25,12 @@ objects: |
| 25 | 25 |
to: |
| 26 | 26 |
kind: Service |
| 27 | 27 |
name: test |
| 28 |
-- apiVersion: v1beta3 |
|
| 28 |
+- apiVersion: v1 |
|
| 29 | 29 |
kind: Route |
| 30 | 30 |
metadata: |
| 31 | 31 |
annotations: |
| 32 |
- description: v1beta3 Route - used to test v1beta3 negotiation of origin objects |
|
| 33 |
- name: v1beta3-route |
|
| 32 |
+ description: v1 Route - used to test v1 negotiation of origin objects |
|
| 33 |
+ name: v1-route |
|
| 34 | 34 |
spec: |
| 35 | 35 |
to: |
| 36 | 36 |
kind: Service |
| ... | ... |
@@ -10,13 +10,6 @@ items: |
| 10 | 10 |
description: v1 Secret - used to test v1 negotiation of k8s objects |
| 11 | 11 |
name: v1-secret |
| 12 | 12 |
|
| 13 |
-- apiVersion: v1beta3 |
|
| 14 |
- kind: Secret |
|
| 15 |
- metadata: |
|
| 16 |
- annotations: |
|
| 17 |
- description: v1beta3 Secret - used to test v1beta3 negotiation of k8s objects |
|
| 18 |
- name: v1beta3-secret |
|
| 19 |
- |
|
| 20 | 13 |
- apiVersion: v1 |
| 21 | 14 |
kind: Route |
| 22 | 15 |
metadata: |
| ... | ... |
@@ -28,17 +21,6 @@ items: |
| 28 | 28 |
kind: Service |
| 29 | 29 |
name: test |
| 30 | 30 |
|
| 31 |
-- apiVersion: v1beta3 |
|
| 32 |
- kind: Route |
|
| 33 |
- metadata: |
|
| 34 |
- annotations: |
|
| 35 |
- description: v1beta3 Route - used to test v1beta3 negotiation of origin objects |
|
| 36 |
- name: v1beta3-route |
|
| 37 |
- spec: |
|
| 38 |
- to: |
|
| 39 |
- kind: Service |
|
| 40 |
- name: test |
|
| 41 |
- |
|
| 42 | 31 |
- apiVersion: extensions/v1beta1 |
| 43 | 32 |
kind: Job |
| 44 | 33 |
metadata: |
| ... | ... |
@@ -59,6 +41,23 @@ items: |
| 59 | 59 |
name: hello-container |
| 60 | 60 |
restartPolicy: Never |
| 61 | 61 |
|
| 62 |
+- apiVersion: batch/v1 |
|
| 63 |
+ kind: Job |
|
| 64 |
+ metadata: |
|
| 65 |
+ annotations: |
|
| 66 |
+ description: v1 Job - used to test v1 negotation of group k8s objects |
|
| 67 |
+ name: v1-job |
|
| 68 |
+ spec: |
|
| 69 |
+ template: |
|
| 70 |
+ metadata: |
|
| 71 |
+ labels: |
|
| 72 |
+ run: v1-job |
|
| 73 |
+ spec: |
|
| 74 |
+ containers: |
|
| 75 |
+ - image: openshift/hello-openshift |
|
| 76 |
+ name: hello-container |
|
| 77 |
+ restartPolicy: Never |
|
| 78 |
+ |
|
| 62 | 79 |
- apiVersion: v1 |
| 63 | 80 |
dockerImageMetadata: |
| 64 | 81 |
Author: me |