-
Notifications
You must be signed in to change notification settings - Fork 40k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96527 from adtac/apfbeta
promote API priority and fairness types and APIs to beta
- Loading branch information
Showing
103 changed files
with
13,301 additions
and
648 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = [ | ||
"defaults.go", | ||
"doc.go", | ||
"register.go", | ||
"zz_generated.conversion.go", | ||
"zz_generated.defaults.go", | ||
], | ||
importpath = "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/apis/flowcontrol:go_default_library", | ||
"//staging/src/k8s.io/api/flowcontrol/v1beta1:go_default_library", | ||
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", | ||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", | ||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "package-srcs", | ||
srcs = glob(["**"]), | ||
tags = ["automanaged"], | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
filegroup( | ||
name = "all-srcs", | ||
srcs = [":package-srcs"], | ||
tags = ["automanaged"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
Copyright 2019 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. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
"k8s.io/api/flowcontrol/v1beta1" | ||
) | ||
|
||
// Default settings for flow-schema | ||
const ( | ||
FlowSchemaDefaultMatchingPrecedence int32 = 1000 | ||
) | ||
|
||
// Default settings for priority-level-configuration | ||
const ( | ||
PriorityLevelConfigurationDefaultHandSize int32 = 8 | ||
PriorityLevelConfigurationDefaultQueues int32 = 64 | ||
PriorityLevelConfigurationDefaultQueueLengthLimit int32 = 50 | ||
PriorityLevelConfigurationDefaultAssuredConcurrencyShares int32 = 30 | ||
) | ||
|
||
// SetDefaults_FlowSchema sets default values for flow schema | ||
func SetDefaults_FlowSchemaSpec(spec *v1beta1.FlowSchemaSpec) { | ||
if spec.MatchingPrecedence == 0 { | ||
spec.MatchingPrecedence = FlowSchemaDefaultMatchingPrecedence | ||
} | ||
} | ||
|
||
func SetDefaults_LimitedPriorityLevelConfiguration(lplc *v1beta1.LimitedPriorityLevelConfiguration) { | ||
if lplc.AssuredConcurrencyShares == 0 { | ||
lplc.AssuredConcurrencyShares = PriorityLevelConfigurationDefaultAssuredConcurrencyShares | ||
} | ||
} | ||
|
||
// SetDefaults_FlowSchema sets default values for flow schema | ||
func SetDefaults_QueuingConfiguration(cfg *v1beta1.QueuingConfiguration) { | ||
if cfg.HandSize == 0 { | ||
cfg.HandSize = PriorityLevelConfigurationDefaultHandSize | ||
} | ||
if cfg.Queues == 0 { | ||
cfg.Queues = PriorityLevelConfigurationDefaultQueues | ||
} | ||
if cfg.QueueLengthLimit == 0 { | ||
cfg.QueueLengthLimit = PriorityLevelConfigurationDefaultQueueLengthLimit | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Copyright 2019 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. | ||
*/ | ||
|
||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/flowcontrol | ||
// +k8s:conversion-gen-external-types=k8s.io/api/flowcontrol/v1beta1 | ||
// +k8s:defaulter-gen=TypeMeta | ||
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/flowcontrol/v1beta1 | ||
|
||
// +groupName=flowcontrol.apiserver.k8s.io | ||
|
||
package v1beta1 // import "k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
Copyright 2015 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. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
) | ||
|
||
// GroupName is the group name use in this package | ||
const GroupName = "flowcontrol.apiserver.k8s.io" | ||
|
||
// SchemeGroupVersion is group version used to register these objects | ||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} | ||
|
||
// Resource takes an unqualified resource and returns a Group qualified GroupResource | ||
func Resource(resource string) schema.GroupResource { | ||
return SchemeGroupVersion.WithResource(resource).GroupResource() | ||
} | ||
|
||
var ( | ||
localSchemeBuilder = &flowcontrolv1beta1.SchemeBuilder | ||
// AddToScheme adds api to a scheme | ||
AddToScheme = localSchemeBuilder.AddToScheme | ||
) | ||
|
||
func init() { | ||
// We only register manually written functions here. The registration of the | ||
// generated functions takes place in the generated files. The separation | ||
// makes the code compile even when the generated files are missing. | ||
localSchemeBuilder.Register(RegisterDefaults) | ||
} |
Oops, something went wrong.