From 030aab29a146d12cb0d6c9d714a2457cec57c910 Mon Sep 17 00:00:00 2001 From: Andy Bursavich Date: Wed, 11 Sep 2019 10:55:57 -0700 Subject: [PATCH] Make API constants constant --- pkg/apis/autoscaling/types.go | 6 +++--- pkg/apis/policy/types.go | 2 +- staging/src/k8s.io/api/autoscaling/v1/types.go | 4 ++-- staging/src/k8s.io/api/autoscaling/v2beta1/types.go | 4 ++-- staging/src/k8s.io/api/autoscaling/v2beta2/types.go | 6 +++--- staging/src/k8s.io/api/extensions/v1beta1/types.go | 2 +- staging/src/k8s.io/api/policy/v1beta1/types.go | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkg/apis/autoscaling/types.go b/pkg/apis/autoscaling/types.go index bd461a02fe6..43f42d64ec9 100644 --- a/pkg/apis/autoscaling/types.go +++ b/pkg/apis/autoscaling/types.go @@ -100,7 +100,7 @@ type HorizontalPodAutoscalerSpec struct { // MetricSourceType indicates the type of metric. type MetricSourceType string -var ( +const ( // ObjectMetricSourceType is a metric describing a kubernetes object // (for example, hits-per-second on an Ingress object). ObjectMetricSourceType MetricSourceType = "Object" @@ -228,7 +228,7 @@ type MetricTarget struct { // "Value", "AverageValue", or "Utilization" type MetricTargetType string -var ( +const ( // UtilizationMetricType is a possible value for MetricTarget.Type. UtilizationMetricType MetricTargetType = "Utilization" // ValueMetricType is a possible value for MetricTarget.Type. @@ -282,7 +282,7 @@ const ( // a HorizontalPodAutoscaler. type HorizontalPodAutoscalerConditionType string -var ( +const ( // ScalingActive indicates that the HPA controller is able to scale if necessary: // it's correctly configured, can fetch the desired metrics, and isn't disabled. ScalingActive HorizontalPodAutoscalerConditionType = "ScalingActive" diff --git a/pkg/apis/policy/types.go b/pkg/apis/policy/types.go index 1691d3a0c35..ea927f4cebb 100644 --- a/pkg/apis/policy/types.go +++ b/pkg/apis/policy/types.go @@ -275,7 +275,7 @@ var AllowAllCapabilities api.Capability = "*" // FSType gives strong typing to different file systems that are used by volumes. type FSType string -var ( +const ( AzureFile FSType = "azureFile" Flocker FSType = "flocker" FlexVolume FSType = "flexVolume" diff --git a/staging/src/k8s.io/api/autoscaling/v1/types.go b/staging/src/k8s.io/api/autoscaling/v1/types.go index 519bd786940..55b2a0d6b68 100644 --- a/staging/src/k8s.io/api/autoscaling/v1/types.go +++ b/staging/src/k8s.io/api/autoscaling/v1/types.go @@ -151,7 +151,7 @@ type ScaleStatus struct { // MetricSourceType indicates the type of metric. type MetricSourceType string -var ( +const ( // ObjectMetricSourceType is a metric describing a kubernetes object // (for example, hits-per-second on an Ingress object). ObjectMetricSourceType MetricSourceType = "Object" @@ -322,7 +322,7 @@ type MetricStatus struct { // a HorizontalPodAutoscaler. type HorizontalPodAutoscalerConditionType string -var ( +const ( // ScalingActive indicates that the HPA controller is able to scale if necessary: // it's correctly configured, can fetch the desired metrics, and isn't disabled. ScalingActive HorizontalPodAutoscalerConditionType = "ScalingActive" diff --git a/staging/src/k8s.io/api/autoscaling/v2beta1/types.go b/staging/src/k8s.io/api/autoscaling/v2beta1/types.go index 92fe5a2b156..53a53a3a9c7 100644 --- a/staging/src/k8s.io/api/autoscaling/v2beta1/types.go +++ b/staging/src/k8s.io/api/autoscaling/v2beta1/types.go @@ -62,7 +62,7 @@ type HorizontalPodAutoscalerSpec struct { // MetricSourceType indicates the type of metric. type MetricSourceType string -var ( +const ( // ObjectMetricSourceType is a metric describing a kubernetes object // (for example, hits-per-second on an Ingress object). ObjectMetricSourceType MetricSourceType = "Object" @@ -231,7 +231,7 @@ type HorizontalPodAutoscalerStatus struct { // a HorizontalPodAutoscaler. type HorizontalPodAutoscalerConditionType string -var ( +const ( // ScalingActive indicates that the HPA controller is able to scale if necessary: // it's correctly configured, can fetch the desired metrics, and isn't disabled. ScalingActive HorizontalPodAutoscalerConditionType = "ScalingActive" diff --git a/staging/src/k8s.io/api/autoscaling/v2beta2/types.go b/staging/src/k8s.io/api/autoscaling/v2beta2/types.go index 314d70950c5..4480c7da8d2 100644 --- a/staging/src/k8s.io/api/autoscaling/v2beta2/types.go +++ b/staging/src/k8s.io/api/autoscaling/v2beta2/types.go @@ -120,7 +120,7 @@ type MetricSpec struct { // MetricSourceType indicates the type of metric. type MetricSourceType string -var ( +const ( // ObjectMetricSourceType is a metric describing a kubernetes object // (for example, hits-per-second on an Ingress object). ObjectMetricSourceType MetricSourceType = "Object" @@ -221,7 +221,7 @@ type MetricTarget struct { // "Value", "AverageValue", or "Utilization" type MetricTargetType string -var ( +const ( // UtilizationMetricType declares a MetricTarget is an AverageUtilization value UtilizationMetricType MetricTargetType = "Utilization" // ValueMetricType declares a MetricTarget is a raw value @@ -262,7 +262,7 @@ type HorizontalPodAutoscalerStatus struct { // a HorizontalPodAutoscaler. type HorizontalPodAutoscalerConditionType string -var ( +const ( // ScalingActive indicates that the HPA controller is able to scale if necessary: // it's correctly configured, can fetch the desired metrics, and isn't disabled. ScalingActive HorizontalPodAutoscalerConditionType = "ScalingActive" diff --git a/staging/src/k8s.io/api/extensions/v1beta1/types.go b/staging/src/k8s.io/api/extensions/v1beta1/types.go index 8f581ef1d59..eb255341f40 100644 --- a/staging/src/k8s.io/api/extensions/v1beta1/types.go +++ b/staging/src/k8s.io/api/extensions/v1beta1/types.go @@ -985,7 +985,7 @@ type AllowedHostPath struct { // Deprecated: use FSType from policy API Group instead. type FSType string -var ( +const ( AzureFile FSType = "azureFile" Flocker FSType = "flocker" FlexVolume FSType = "flexVolume" diff --git a/staging/src/k8s.io/api/policy/v1beta1/types.go b/staging/src/k8s.io/api/policy/v1beta1/types.go index b3001bb5c0d..f6b3cc819aa 100644 --- a/staging/src/k8s.io/api/policy/v1beta1/types.go +++ b/staging/src/k8s.io/api/policy/v1beta1/types.go @@ -276,7 +276,7 @@ var AllowAllCapabilities v1.Capability = "*" // FSType gives strong typing to different file systems that are used by volumes. type FSType string -var ( +const ( AzureFile FSType = "azureFile" Flocker FSType = "flocker" FlexVolume FSType = "flexVolume"