Skip to content

Commit 3846f6b

Browse files
authored
Merge pull request kubernetes#82599 from abursavich/consts
Make API constants constant
2 parents f674747 + 030aab2 commit 3846f6b

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

pkg/apis/autoscaling/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ type HorizontalPodAutoscalerSpec struct {
100100
// MetricSourceType indicates the type of metric.
101101
type MetricSourceType string
102102

103-
var (
103+
const (
104104
// ObjectMetricSourceType is a metric describing a kubernetes object
105105
// (for example, hits-per-second on an Ingress object).
106106
ObjectMetricSourceType MetricSourceType = "Object"
@@ -228,7 +228,7 @@ type MetricTarget struct {
228228
// "Value", "AverageValue", or "Utilization"
229229
type MetricTargetType string
230230

231-
var (
231+
const (
232232
// UtilizationMetricType is a possible value for MetricTarget.Type.
233233
UtilizationMetricType MetricTargetType = "Utilization"
234234
// ValueMetricType is a possible value for MetricTarget.Type.
@@ -282,7 +282,7 @@ const (
282282
// a HorizontalPodAutoscaler.
283283
type HorizontalPodAutoscalerConditionType string
284284

285-
var (
285+
const (
286286
// ScalingActive indicates that the HPA controller is able to scale if necessary:
287287
// it's correctly configured, can fetch the desired metrics, and isn't disabled.
288288
ScalingActive HorizontalPodAutoscalerConditionType = "ScalingActive"

pkg/apis/policy/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ var AllowAllCapabilities api.Capability = "*"
275275
// FSType gives strong typing to different file systems that are used by volumes.
276276
type FSType string
277277

278-
var (
278+
const (
279279
AzureFile FSType = "azureFile"
280280
Flocker FSType = "flocker"
281281
FlexVolume FSType = "flexVolume"

staging/src/k8s.io/api/autoscaling/v1/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ type ScaleStatus struct {
151151
// MetricSourceType indicates the type of metric.
152152
type MetricSourceType string
153153

154-
var (
154+
const (
155155
// ObjectMetricSourceType is a metric describing a kubernetes object
156156
// (for example, hits-per-second on an Ingress object).
157157
ObjectMetricSourceType MetricSourceType = "Object"
@@ -322,7 +322,7 @@ type MetricStatus struct {
322322
// a HorizontalPodAutoscaler.
323323
type HorizontalPodAutoscalerConditionType string
324324

325-
var (
325+
const (
326326
// ScalingActive indicates that the HPA controller is able to scale if necessary:
327327
// it's correctly configured, can fetch the desired metrics, and isn't disabled.
328328
ScalingActive HorizontalPodAutoscalerConditionType = "ScalingActive"

staging/src/k8s.io/api/autoscaling/v2beta1/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type HorizontalPodAutoscalerSpec struct {
6262
// MetricSourceType indicates the type of metric.
6363
type MetricSourceType string
6464

65-
var (
65+
const (
6666
// ObjectMetricSourceType is a metric describing a kubernetes object
6767
// (for example, hits-per-second on an Ingress object).
6868
ObjectMetricSourceType MetricSourceType = "Object"
@@ -231,7 +231,7 @@ type HorizontalPodAutoscalerStatus struct {
231231
// a HorizontalPodAutoscaler.
232232
type HorizontalPodAutoscalerConditionType string
233233

234-
var (
234+
const (
235235
// ScalingActive indicates that the HPA controller is able to scale if necessary:
236236
// it's correctly configured, can fetch the desired metrics, and isn't disabled.
237237
ScalingActive HorizontalPodAutoscalerConditionType = "ScalingActive"

staging/src/k8s.io/api/autoscaling/v2beta2/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ type MetricSpec struct {
120120
// MetricSourceType indicates the type of metric.
121121
type MetricSourceType string
122122

123-
var (
123+
const (
124124
// ObjectMetricSourceType is a metric describing a kubernetes object
125125
// (for example, hits-per-second on an Ingress object).
126126
ObjectMetricSourceType MetricSourceType = "Object"
@@ -221,7 +221,7 @@ type MetricTarget struct {
221221
// "Value", "AverageValue", or "Utilization"
222222
type MetricTargetType string
223223

224-
var (
224+
const (
225225
// UtilizationMetricType declares a MetricTarget is an AverageUtilization value
226226
UtilizationMetricType MetricTargetType = "Utilization"
227227
// ValueMetricType declares a MetricTarget is a raw value
@@ -262,7 +262,7 @@ type HorizontalPodAutoscalerStatus struct {
262262
// a HorizontalPodAutoscaler.
263263
type HorizontalPodAutoscalerConditionType string
264264

265-
var (
265+
const (
266266
// ScalingActive indicates that the HPA controller is able to scale if necessary:
267267
// it's correctly configured, can fetch the desired metrics, and isn't disabled.
268268
ScalingActive HorizontalPodAutoscalerConditionType = "ScalingActive"

staging/src/k8s.io/api/extensions/v1beta1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ type AllowedHostPath struct {
985985
// Deprecated: use FSType from policy API Group instead.
986986
type FSType string
987987

988-
var (
988+
const (
989989
AzureFile FSType = "azureFile"
990990
Flocker FSType = "flocker"
991991
FlexVolume FSType = "flexVolume"

staging/src/k8s.io/api/policy/v1beta1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ var AllowAllCapabilities v1.Capability = "*"
276276
// FSType gives strong typing to different file systems that are used by volumes.
277277
type FSType string
278278

279-
var (
279+
const (
280280
AzureFile FSType = "azureFile"
281281
Flocker FSType = "flocker"
282282
FlexVolume FSType = "flexVolume"

0 commit comments

Comments
 (0)