Skip to content

Commit b26685b

Browse files
committed
Formatting
1 parent 561f9c4 commit b26685b

13 files changed

+204
-13
lines changed

cluster-autoscaler/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ func createAutoscalingOptions() config.AutoscalingOptions {
454454
ProvisioningRequestInitialBackoffTime: *provisioningRequestInitialBackoffTime,
455455
ProvisioningRequestMaxBackoffTime: *provisioningRequestMaxBackoffTime,
456456
ProvisioningRequestMaxBackoffCacheSize: *provisioningRequestMaxBackoffCacheSize,
457-
PodShardingEnabled: *podShardingEnabled,
458-
PodShardingNodeSelectors: *podShardingNodeSelector,
457+
PodShardingEnabled: *podShardingEnabled,
458+
PodShardingNodeSelectors: *podShardingNodeSelector,
459459
}
460460
}
461461

cluster-autoscaler/utils/podsharding/composite_pod_sharder.go

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (
@@ -58,4 +74,4 @@ func (sharder *CompositePodSharder) ComputePodShards(pods []*v1.Pod) []*PodShard
5874
result = append(result, podShard)
5975
}
6076
return result
61-
}
77+
}

cluster-autoscaler/utils/podsharding/composite_pod_sharder_test.go

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
116

217
package podsharding
318

@@ -248,4 +263,4 @@ func getAllFeaturesSorted(features podFeatureParts) []string {
248263
}
249264
sort.Strings(allFeatures)
250265
return allFeatures
251-
}
266+
}

cluster-autoscaler/utils/podsharding/lru_shard_selector.go

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
// LruPodShardSelector is a PodShardSelector which picks shards in least-recently picked order
@@ -42,4 +58,4 @@ func (selector *LruPodShardSelector) SelectPodShard(shards []*PodShard) *PodShar
4258
}
4359
selector.lruMap[selectedShard.Signature()] = selector.useCounter
4460
return selectedShard
45-
}
61+
}

cluster-autoscaler/utils/podsharding/lru_shard_selector_test.go

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (
@@ -53,4 +69,4 @@ func signatures(podShards ...*PodShard) []ShardSignature {
5369
result = append(result, podShard.Signature())
5470
}
5571
return result
56-
}
72+
}

cluster-autoscaler/utils/podsharding/oss_pod_sharder.go

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (
@@ -21,11 +37,11 @@ func computeLabelNameShard(podShardingLabels map[string]string) func(*v1.Pod, *N
2137
if len(podShardingLabels) == 0 {
2238
return
2339
}
24-
40+
2541
for labelKey, labelValue := range podShardingLabels {
2642
if podLabelValue, ok := pod.Spec.NodeSelector[labelKey]; ok && podLabelValue == labelValue {
2743
nodeGroupDescriptor.Labels[labelKey] = labelValue
2844
}
2945
}
3046
}
31-
}
47+
}

cluster-autoscaler/utils/podsharding/oss_pod_sharder_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (

cluster-autoscaler/utils/podsharding/oss_pod_sharding_processor.go

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (
@@ -77,4 +93,4 @@ func (p *PodShardingProcessor) Process(context *context.AutoscalingContext,
7793

7894
// CleanUp does nothing for PodShardingProcessor
7995
func (p *PodShardingProcessor) CleanUp() {
80-
}
96+
}

cluster-autoscaler/utils/podsharding/pod_sharder.go

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (
@@ -146,4 +162,4 @@ func (descriptor NodeGroupDescriptor) DeepCopy() NodeGroupDescriptor {
146162
}
147163
copy.ProvisioningClassName = descriptor.ProvisioningClassName
148164
return copy
149-
}
165+
}

cluster-autoscaler/utils/podsharding/pod_sharder_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (

cluster-autoscaler/utils/podsharding/predicate_pod_shard_filter.go

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (
@@ -54,6 +70,6 @@ func (p *PredicatePodShardFilter) FilterPods(context *context.AutoscalingContext
5470
}
5571

5672
return PodFilteringResult{
57-
Pods: selectedPods,
73+
Pods: selectedPods,
5874
}, nil
59-
}
75+
}

cluster-autoscaler/utils/podsharding/predicate_pod_shard_filter_test.go

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (
@@ -92,4 +108,4 @@ func createTestPod(uid string) *apiv1.Pod {
92108
},
93109
}
94110
return pod
95-
}
111+
}

cluster-autoscaler/utils/podsharding/test_helpers.go

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package podsharding
218

319
import (

0 commit comments

Comments
 (0)