diff --git a/federation/apis/swagger-spec/extensions_v1beta1.json b/federation/apis/swagger-spec/extensions_v1beta1.json index ee02e8b0223..960e686c05d 100644 --- a/federation/apis/swagger-spec/extensions_v1beta1.json +++ b/federation/apis/swagger-spec/extensions_v1beta1.json @@ -4649,7 +4649,7 @@ }, "nodeSelector": { "type": "object", - "description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: http://kubernetes.io/docs/user-guide/node-selection/README" + "description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: http://kubernetes.io/docs/user-guide/node-selection/README.md" }, "serviceAccountName": { "type": "string", @@ -4712,6 +4712,13 @@ "$ref": "v1.Toleration" }, "description": "If specified, the pod's tolerations." + }, + "hostMappings": { + "type": "array", + "items": { + "$ref": "v1.HostAlias" + }, + "description": "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods." } } }, @@ -5039,6 +5046,28 @@ "type": "string" }, "description": "iSCSI target portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260)." + }, + "chapAuthDiscovery": { + "type": "boolean", + "description": "whether support iSCSI Discovery CHAP authentication" + }, + "chapAuthSession": { + "type": "boolean", + "description": "whether support iSCSI Session CHAP authentication" + }, + "secretRef": { + "$ref": "v1.LocalObjectReference", + "description": "CHAP secret for iSCSI target and initiator authentication" + } + } + }, + "v1.LocalObjectReference": { + "id": "v1.LocalObjectReference", + "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", + "properties": { + "name": { + "type": "string", + "description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names" } } }, @@ -5126,16 +5155,6 @@ } } }, - "v1.LocalObjectReference": { - "id": "v1.LocalObjectReference", - "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names" - } - } - }, "v1.FlexVolumeSource": { "id": "v1.FlexVolumeSource", "description": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future.", @@ -5871,7 +5890,7 @@ "properties": { "fieldRef": { "$ref": "v1.ObjectFieldSelector", - "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP." + "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP." }, "resourceFieldRef": { "$ref": "v1.ResourceFieldSelector", @@ -6141,8 +6160,7 @@ "description": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence." }, "runAsUser": { - "type": "integer", - "format": "int64", + "$ref": "types.UnixUserID", "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence." }, "runAsNonRoot": { @@ -6201,6 +6219,10 @@ } } }, + "types.UnixUserID": { + "id": "types.UnixUserID", + "properties": {} + }, "v1.PodSecurityContext": { "id": "v1.PodSecurityContext", "description": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", @@ -6210,8 +6232,7 @@ "description": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container." }, "runAsUser": { - "type": "integer", - "format": "int64", + "$ref": "types.UnixUserID", "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container." }, "runAsNonRoot": { @@ -6221,17 +6242,20 @@ "supplementalGroups": { "type": "array", "items": { - "type": "integer" + "$ref": "types.UnixGroupID" }, "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container." }, "fsGroup": { - "type": "integer", - "format": "int64", + "$ref": "types.UnixGroupID", "description": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw " } } }, + "types.UnixGroupID": { + "id": "types.UnixGroupID", + "properties": {} + }, "v1.Affinity": { "id": "v1.Affinity", "description": "Affinity is a group of affinity scheduling rules.", @@ -6450,6 +6474,23 @@ } } }, + "v1.HostAlias": { + "id": "v1.HostAlias", + "description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.", + "properties": { + "ip": { + "type": "string", + "description": "IP address of the host file entry." + }, + "hostnames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Hostnames for the the above IP address." + } + } + }, "v1beta1.DaemonSetUpdateStrategy": { "id": "v1beta1.DaemonSetUpdateStrategy", "properties": { diff --git a/federation/apis/swagger-spec/v1.json b/federation/apis/swagger-spec/v1.json index b21ba57d0a3..9756891cb6d 100644 --- a/federation/apis/swagger-spec/v1.json +++ b/federation/apis/swagger-spec/v1.json @@ -4287,7 +4287,7 @@ }, "data": { "type": "object", - "description": "Data contains the configuration data. Each key must be a valid DNS_SUBDOMAIN with an optional leading dot." + "description": "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'." } } }, @@ -4815,7 +4815,7 @@ }, "data": { "type": "object", - "description": "Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading dot followed by valid DNS_SUBDOMAIN. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4" + "description": "Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4" }, "stringData": { "type": "object", @@ -4909,14 +4909,7 @@ "items": { "type": "string" }, - "description": "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. A previous form of this functionality exists as the deprecatedPublicIPs field. When using this field, callers should also clear the deprecatedPublicIPs field." - }, - "deprecatedPublicIPs": { - "type": "array", - "items": { - "type": "string" - }, - "description": "deprecatedPublicIPs is deprecated and replaced by the externalIPs field with almost the exact same semantics. This field is retained in the v1 API for compatibility until at least 8/20/2016. It will be removed from any new API revisions. If both deprecatedPublicIPs *and* externalIPs are set, deprecatedPublicIPs is used." + "description": "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system." }, "sessionAffinity": { "type": "string", @@ -4936,6 +4929,15 @@ "externalName": { "type": "string", "description": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires Type to be ExternalName." + }, + "externalTrafficPolicy": { + "type": "string", + "description": "externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services." + }, + "healthCheckNodePort": { + "type": "integer", + "format": "int32", + "description": "healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local." } } }, diff --git a/federation/docs/api-reference/extensions/v1beta1/definitions.html b/federation/docs/api-reference/extensions/v1beta1/definitions.html index c04fb6f6172..b4d7285b0f2 100755 --- a/federation/docs/api-reference/extensions/v1beta1/definitions.html +++ b/federation/docs/api-reference/extensions/v1beta1/definitions.html @@ -2027,68 +2027,6 @@ Populated by the system when a graceful deletion is requested. Read-only. More i - -
-

v1beta1.DaemonSetSpec

-
-

DaemonSetSpec is the specification of a daemon set.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

selector

A label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors

false

v1.LabelSelector

template

An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template’s node selector (or on every node if no node selector is specified). More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template

true

v1.PodTemplateSpec

updateStrategy

An update strategy to replace existing DaemonSet pods with new pods.

false

v1beta1.DaemonSetUpdateStrategy

minReadySeconds

The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready).

false

integer (int32)

templateGeneration

A sequence number representing a specific generation of the template. Populated by the system. It can be set only during the creation.

false

integer (int64)

-

v1beta1.Deployment

@@ -2151,6 +2089,68 @@ Populated by the system when a graceful deletion is requested. Read-only. More i +
+
+

v1beta1.DaemonSetSpec

+
+

DaemonSetSpec is the specification of a daemon set.

+
+ +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionRequiredSchemaDefault

selector

A label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors

false

v1.LabelSelector

template

An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template’s node selector (or on every node if no node selector is specified). More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template

true

v1.PodTemplateSpec

updateStrategy

An update strategy to replace existing DaemonSet pods with new pods.

false

v1beta1.DaemonSetUpdateStrategy

minReadySeconds

The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready).

false

integer (int32)

templateGeneration

A sequence number representing a specific generation of the template. Populated by the system. It can be set only during the creation.

false

integer (int64)

+

v1.AzureFileVolumeSource

@@ -2276,6 +2276,27 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

string array

+ +

chapAuthDiscovery

+

whether support iSCSI Discovery CHAP authentication

+

false

+

boolean

+

false

+ + +

chapAuthSession

+

whether support iSCSI Session CHAP authentication

+

false

+

boolean

+

false

+ + +

secretRef

+

CHAP secret for iSCSI target and initiator authentication

+

false

+

v1.LocalObjectReference

+ + @@ -2839,7 +2860,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

fieldRef

-

Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP.

+

Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP.

false

v1.ObjectFieldSelector

@@ -3930,7 +3951,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

nodeSelector

-

NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node’s labels for the pod to be scheduled on that node. More info: http://kubernetes.io/docs/user-guide/node-selection/README

+

NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node’s labels for the pod to be scheduled on that node. More info: http://kubernetes.io/docs/user-guide/node-selection/README.md

false

object

@@ -4033,6 +4054,13 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

v1.Toleration array

+ +

hostMappings

+

HostAliases is an optional list of hosts and IPs that will be injected into the pod’s hosts file if specified. This is only valid for non-hostNetwork pods.

+

false

+

v1.HostAlias array

+ + @@ -4586,6 +4614,10 @@ Examples:
+
+
+

types.UnixUserID

+

v1.ScaleIOVolumeSource

@@ -4958,6 +4990,10 @@ Examples:
+
+
+

types.UnixGroupID

+

v1beta1.DeploymentRollback

@@ -5233,6 +5269,13 @@ Examples:

string

+ +

host

+

Optional: Host name to connect to, defaults to the pod IP.

+

false

+

string

+ + @@ -5642,7 +5685,7 @@ Both these may change in the future. Incoming requests are matched against the h

runAsUser

The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.

false

-

integer (int64)

+

types.UnixUserID

@@ -5656,7 +5699,7 @@ Both these may change in the future. Incoming requests are matched against the h

supplementalGroups

A list of groups applied to the first process run in each container, in addition to the container’s primary GID. If unspecified, no groups will be added to any container.

false

-

integer (int32) array

+

types.UnixGroupID array

@@ -5665,7 +5708,7 @@ Both these may change in the future. Incoming requests are matched against the h
1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR’d with rw-rw

false

-

integer (int64)

+

types.UnixGroupID

@@ -6232,7 +6275,7 @@ Both these may change in the future. Incoming requests are matched against the h

runAsUser

The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

false

-

integer (int64)

+

types.UnixUserID

@@ -6547,6 +6590,47 @@ Both these may change in the future. Incoming requests are matched against the h +
+
+

v1.HostAlias

+
+

HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s hosts file.

+
+ +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionRequiredSchemaDefault

ip

IP address of the host file entry.

false

string

hostnames

Hostnames for the the above IP address.

false

string array

+

v1.PodTemplateSpec

@@ -6990,7 +7074,7 @@ Both these may change in the future. Incoming requests are matched against the h
diff --git a/federation/docs/api-reference/v1/definitions.html b/federation/docs/api-reference/v1/definitions.html index a1fa3a6d0e4..95a8f65a12e 100755 --- a/federation/docs/api-reference/v1/definitions.html +++ b/federation/docs/api-reference/v1/definitions.html @@ -816,7 +816,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }

data

-

Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading dot followed by valid DNS_SUBDOMAIN. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4

+

Data contains the secret data. Each key must consist of alphanumeric characters, -, _ or .. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4

false

object

@@ -1449,7 +1449,7 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }

data

-

Data contains the configuration data. Each key must be a valid DNS_SUBDOMAIN with an optional leading dot.

+

Data contains the configuration data. Each key must consist of alphanumeric characters, -, _ or ..

false

object

@@ -2081,14 +2081,7 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

externalIPs

-

externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. A previous form of this functionality exists as the deprecatedPublicIPs field. When using this field, callers should also clear the deprecatedPublicIPs field.

-

false

-

string array

- - - -

deprecatedPublicIPs

-

deprecatedPublicIPs is deprecated and replaced by the externalIPs field with almost the exact same semantics. This field is retained in the v1 API for compatibility until at least 8/20/2016. It will be removed from any new API revisions. If both deprecatedPublicIPs and externalIPs are set, deprecatedPublicIPs is used.

+

externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.

false

string array

@@ -2121,6 +2114,20 @@ Populated by the system when a graceful deletion is requested. Read-only. More i

string

+ +

externalTrafficPolicy

+

externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services.

+

false

+

string

+ + + +

healthCheckNodePort

+

healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local.

+

false

+

integer (int32)

+ + @@ -2233,7 +2240,7 @@ Examples:
diff --git a/hack/verify-federation-api-reference-docs.sh b/hack/verify-federation-api-reference-docs.sh new file mode 100755 index 00000000000..6cf951866ec --- /dev/null +++ b/hack/verify-federation-api-reference-docs.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Verifies that api reference docs are up to date. + +set -o errexit +set -o nounset +set -o pipefail + +KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. +source "${KUBE_ROOT}/hack/lib/init.sh" + +kube::golang::setup_env + +API_REFERENCE_DOCS_ROOT="${KUBE_ROOT}/federation/docs/api-reference" +OUTPUT_DIR="${KUBE_ROOT}/_tmp_federation/api-reference" +mkdir -p ${OUTPUT_DIR} +TMP_ROOT="${KUBE_ROOT}/_tmp_federation" +trap "rm -rf ${TMP_ROOT}" EXIT SIGINT + +# Generate API reference docs in tmp. +"./hack/update-federation-api-reference-docs.sh" "${OUTPUT_DIR}" + +echo "diffing ${API_REFERENCE_DOCS_ROOT} against freshly generated docs" +ret=0 +diff -NauprB -I 'Last update' --exclude=*.md "${API_REFERENCE_DOCS_ROOT}" "${OUTPUT_DIR}" || ret=$? +if [[ $ret -eq 0 ]] +then + echo "${API_REFERENCE_DOCS_ROOT} up to date." +else + echo "${API_REFERENCE_DOCS_ROOT} is out of date. Please run hack/update-federation-api-reference-docs.sh" + exit 1 +fi + +# ex: ts=2 sw=2 et filetype=sh diff --git a/hack/verify-federation-generated-swagger-docs.sh b/hack/verify-federation-generated-swagger-docs.sh new file mode 100755 index 00000000000..36e25a970e0 --- /dev/null +++ b/hack/verify-federation-generated-swagger-docs.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. +source "${KUBE_ROOT}/hack/lib/init.sh" + +kube::golang::setup_env + +make -C "${KUBE_ROOT}" WHAT=cmd/genswaggertypedocs + +# Find binary +genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs") + +if [[ ! -x "$genswaggertypedocs" ]]; then + { + echo "It looks as if you don't have a compiled genswaggertypedocs binary" + echo + echo "If you are running from a clone of the git repo, please run" + echo "'make WHAT=cmd/genswaggertypedocs'." + } >&2 + exit 1 +fi + +DIFFROOT="${KUBE_ROOT}/federation" +TMP_DIFFROOT="${KUBE_ROOT}/_tmp/federation" +_tmp="${KUBE_ROOT}/_tmp_federation" + +cleanup() { + rm -rf "${_tmp}" +} +trap "cleanup" EXIT SIGINT + +cleanup + +mkdir -p "${TMP_DIFFROOT}" +cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}/" + +"${KUBE_ROOT}/hack/update-federation-generated-swagger-docs.sh" +echo "diffing ${DIFFROOT} against freshly generated swagger type documentation" +ret=0 +diff -Naupr -I 'Auto generated by' "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? +cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}/" +if [[ $ret -eq 0 ]] +then + echo "${DIFFROOT} up to date." +else + echo "${DIFFROOT} is out of date. Please run hack/update-federation-generated-swagger-docs.sh" + exit 1 +fi diff --git a/hack/verify-federation-swagger-spec.sh b/hack/verify-federation-swagger-spec.sh new file mode 100755 index 00000000000..0a33f2ffaac --- /dev/null +++ b/hack/verify-federation-swagger-spec.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. +source "${KUBE_ROOT}/hack/lib/init.sh" + +kube::golang::setup_env + +make -C "${KUBE_ROOT}" WHAT=federation/cmd/federation-apiserver + +apiserver=$(kube::util::find-binary "federation-apiserver") + +SPECROOT="${KUBE_ROOT}/federation/apis/swagger-spec" +TMP_SPECROOT="${KUBE_ROOT}/_tmp_federation/swagger-spec" +_tmp="${KUBE_ROOT}/_tmp_federation" + +mkdir -p "${_tmp}" +trap "rm -rf ${_tmp}" EXIT SIGINT +cp -a "${SPECROOT}" "${TMP_SPECROOT}" + +"${KUBE_ROOT}/hack/update-federation-swagger-spec.sh" +echo "diffing ${SPECROOT} against freshly generated federation swagger spec" +ret=0 +diff -Naupr -I 'Auto generated by' "${SPECROOT}" "${TMP_SPECROOT}" || ret=$? +cp -a ${TMP_SPECROOT} "${KUBE_ROOT}/federation/apis" +if [[ $ret -eq 0 ]] +then + echo "${SPECROOT} up to date." +else + echo "${SPECROOT} is out of date. Please run hack/update-federation-swagger-spec.sh" + exit 1 +fi + +# ex: ts=2 sw=2 et filetype=sh