Skip to content

Commit

Permalink
enable verify-description.sh for pkg/expapi/v1/types.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Xu committed Sep 8, 2015
1 parent 2443052 commit 10c8179
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 24 deletions.
5 changes: 4 additions & 1 deletion hack/after-build/verify-description.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ find_files() {
-o -wholename '*/third_party/*' \
-o -wholename '*/Godeps/*' \
\) -prune \
\) -wholename '*pkg/api/v*/types.go'
\) \
\( -wholename '*pkg/api/v*/types.go' \
-o -wholename '*pkg/expapi/v*/types.go' \
\)
}

if [[ $# -eq 0 ]]; then
Expand Down
33 changes: 23 additions & 10 deletions pkg/expapi/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ type SubresourceReference struct {

// ResourceConsumption is an object for specifying average resource consumption of a particular resource.
type ResourceConsumption struct {
Resource v1.ResourceName `json:"resource,omitempty"`
// Resource specifies either the name of the target resource when present in the spec, or the name of the observed resource when present in the status.
Resource v1.ResourceName `json:"resource,omitempty"`
// Quantity specifies either the target average consumption of the resource when present in the spec, or the observed average consumption when present in the status.
Quantity resource.Quantity `json:"quantity,omitempty"`
}

Expand Down Expand Up @@ -109,7 +111,8 @@ type HorizontalPodAutoscalerStatus struct {

// HorizontalPodAutoscaler represents the configuration of a horizontal pod autoscaler.
type HorizontalPodAutoscaler struct {
v1.TypeMeta `json:",inline"`
v1.TypeMeta `json:",inline"`
// Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
v1.ObjectMeta `json:"metadata,omitempty"`

// Spec defines the behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
Expand All @@ -119,12 +122,13 @@ type HorizontalPodAutoscaler struct {
Status *HorizontalPodAutoscalerStatus `json:"status,omitempty"`
}

// HorizontalPodAutoscaler is a collection of pod autoscalers.
// HorizontalPodAutoscalerList is a list of HorizontalPodAutoscalers.
type HorizontalPodAutoscalerList struct {
v1.TypeMeta `json:",inline"`
// Standard list metadata.
v1.ListMeta `json:"metadata,omitempty"`

// Items is the list of horizontal pod autoscalers.
// Items is the list of HorizontalPodAutoscalers.
Items []HorizontalPodAutoscaler `json:"items"`
}

Expand All @@ -143,13 +147,14 @@ type ThirdPartyResource struct {
Versions []APIVersion `json:"versions,omitempty"`
}

// ThirdPartyResourceList is a list of ThirdPartyResources.
type ThirdPartyResourceList struct {
v1.TypeMeta `json:",inline"`

// Standard list metadata.
v1.ListMeta `json:"metadata,omitempty"`

// Items is the list of horizontal pod autoscalers.
// Items is the list of ThirdPartyResources.
Items []ThirdPartyResource `json:"items"`
}

Expand All @@ -172,8 +177,10 @@ type ThirdPartyResourceData struct {
Data []byte `json:"name,omitempty"`
}

// Deployment enables declarative updates for Pods and ReplicationControllers.
type Deployment struct {
v1.TypeMeta `json:",inline"`
v1.TypeMeta `json:",inline"`
// Standard object metadata.
v1.ObjectMeta `json:"metadata,omitempty"`

// Specification of the desired behavior of the Deployment.
Expand All @@ -183,6 +190,7 @@ type Deployment struct {
Status DeploymentStatus `json:"status,omitempty"`
}

// DeploymentSpec is the specification of the desired behavior of the Deployment.
type DeploymentSpec struct {
// Number of desired pods. This is a pointer to distinguish between explicit
// zero and not specified. Defaults to 1.
Expand All @@ -209,6 +217,7 @@ type DeploymentSpec struct {
UniqueLabelKey *string `json:"uniqueLabelKey,omitempty"`
}

// DeploymentStrategy describes how to replace existing pods with new ones.
type DeploymentStrategy struct {
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
Type DeploymentType `json:"type,omitempty"`
Expand Down Expand Up @@ -263,6 +272,7 @@ type RollingUpdateDeployment struct {
MinReadySeconds int `json:"minReadySeconds,omitempty"`
}

// DeploymentStatus is the most recently observed status of the Deployment.
type DeploymentStatus struct {
// Total number of ready pods targeted by this deployment (this
// includes both the old and new pods).
Expand All @@ -272,11 +282,13 @@ type DeploymentStatus struct {
UpdatedReplicas int `json:"updatedReplicas,omitempty"`
}

// DeploymentList is a list of Deployments.
type DeploymentList struct {
v1.TypeMeta `json:",inline"`
// Standard list metadata.
v1.ListMeta `json:"metadata,omitempty"`

// Items is the list of deployments.
// Items is the list of Deployments.
Items []Deployment `json:"items"`
}

Expand Down Expand Up @@ -330,23 +342,24 @@ type Daemon struct {
Status DaemonStatus `json:"status,omitempty"`
}

// DaemonList is a collection of daemon.
// DaemonList is a list of Daemons.
type DaemonList struct {
v1.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
v1.ListMeta `json:"metadata,omitempty"`

// Items is a list of daemons.
// Items is the list of Daemons.
Items []Daemon `json:"items"`
}

// ThirdPartyResrouceDataList is a list of ThirdPartyResourceData.
type ThirdPartyResourceDataList struct {
v1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
v1.ListMeta `json:"metadata,omitempty"`

// Items is a list of third party objects
// Items is the list of ThirdpartyResourceData.
Items []ThirdPartyResourceData `json:"items"`
}
39 changes: 26 additions & 13 deletions pkg/expapi/v1/types_swagger_doc_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ func (Daemon) SwaggerDoc() map[string]string {
}

var map_DaemonList = map[string]string{
"": "DaemonList is a collection of daemon.",
"": "DaemonList is a list of Daemons.",
"metadata": "Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
"items": "Items is a list of daemons.",
"items": "Items is the list of Daemons.",
}

func (DaemonList) SwaggerDoc() map[string]string {
Expand Down Expand Up @@ -80,23 +80,28 @@ func (DaemonStatus) SwaggerDoc() map[string]string {
}

var map_Deployment = map[string]string{
"spec": "Specification of the desired behavior of the Deployment.",
"status": "Most recently observed status of the Deployment.",
"": "Deployment enables declarative updates for Pods and ReplicationControllers.",
"metadata": "Standard object metadata.",
"spec": "Specification of the desired behavior of the Deployment.",
"status": "Most recently observed status of the Deployment.",
}

func (Deployment) SwaggerDoc() map[string]string {
return map_Deployment
}

var map_DeploymentList = map[string]string{
"items": "Items is the list of deployments.",
"": "DeploymentList is a list of Deployments.",
"metadata": "Standard list metadata.",
"items": "Items is the list of Deployments.",
}

func (DeploymentList) SwaggerDoc() map[string]string {
return map_DeploymentList
}

var map_DeploymentSpec = map[string]string{
"": "DeploymentSpec is the specification of the desired behavior of the Deployment.",
"replicas": "Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.",
"selector": "Label selector for pods. Existing ReplicationControllers whose pods are selected by this will be scaled down.",
"template": "Template describes the pods that will be created.",
Expand All @@ -109,6 +114,7 @@ func (DeploymentSpec) SwaggerDoc() map[string]string {
}

var map_DeploymentStatus = map[string]string{
"": "DeploymentStatus is the most recently observed status of the Deployment.",
"replicas": "Total number of ready pods targeted by this deployment (this includes both the old and new pods).",
"updatedReplicas": "Total number of new ready pods with the desired template spec.",
}
Expand All @@ -118,6 +124,7 @@ func (DeploymentStatus) SwaggerDoc() map[string]string {
}

var map_DeploymentStrategy = map[string]string{
"": "DeploymentStrategy describes how to replace existing pods with new ones.",
"type": "Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate.",
"rollingUpdate": "Rolling update config params. Present only if DeploymentType = RollingUpdate.",
}
Expand All @@ -127,18 +134,20 @@ func (DeploymentStrategy) SwaggerDoc() map[string]string {
}

var map_HorizontalPodAutoscaler = map[string]string{
"": "HorizontalPodAutoscaler represents the configuration of a horizontal pod autoscaler.",
"spec": "Spec defines the behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.",
"status": "Status represents the current information about the autoscaler.",
"": "HorizontalPodAutoscaler represents the configuration of a horizontal pod autoscaler.",
"metadata": "Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
"spec": "Spec defines the behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.",
"status": "Status represents the current information about the autoscaler.",
}

func (HorizontalPodAutoscaler) SwaggerDoc() map[string]string {
return map_HorizontalPodAutoscaler
}

var map_HorizontalPodAutoscalerList = map[string]string{
"": "HorizontalPodAutoscaler is a collection of pod autoscalers.",
"items": "Items is the list of horizontal pod autoscalers.",
"": "HorizontalPodAutoscalerList is a list of HorizontalPodAutoscalers.",
"metadata": "Standard list metadata.",
"items": "Items is the list of HorizontalPodAutoscalers.",
}

func (HorizontalPodAutoscalerList) SwaggerDoc() map[string]string {
Expand Down Expand Up @@ -178,7 +187,9 @@ func (ReplicationControllerDummy) SwaggerDoc() map[string]string {
}

var map_ResourceConsumption = map[string]string{
"": "ResourceConsumption is an object for specifying average resource consumption of a particular resource.",
"": "ResourceConsumption is an object for specifying average resource consumption of a particular resource.",
"resource": "Resource specifies either the name of the target resource when present in the spec, or the name of the observed resource when present in the status.",
"quantity": "Quantity specifies either the target average consumption of the resource when present in the spec, or the observed average consumption when present in the status.",
}

func (ResourceConsumption) SwaggerDoc() map[string]string {
Expand Down Expand Up @@ -261,17 +272,19 @@ func (ThirdPartyResourceData) SwaggerDoc() map[string]string {
}

var map_ThirdPartyResourceDataList = map[string]string{
"": "ThirdPartyResrouceDataList is a list of ThirdPartyResourceData.",
"metadata": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
"items": "Items is a list of third party objects",
"items": "Items is the list of ThirdpartyResourceData.",
}

func (ThirdPartyResourceDataList) SwaggerDoc() map[string]string {
return map_ThirdPartyResourceDataList
}

var map_ThirdPartyResourceList = map[string]string{
"": "ThirdPartyResourceList is a list of ThirdPartyResources.",
"metadata": "Standard list metadata.",
"items": "Items is the list of horizontal pod autoscalers.",
"items": "Items is the list of ThirdPartyResources.",
}

func (ThirdPartyResourceList) SwaggerDoc() map[string]string {
Expand Down

0 comments on commit 10c8179

Please sign in to comment.