mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
dep: lift kube dependency to v0.18.6
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
be9e7cf956
commit
02b8cd0b4b
1
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/BUILD
generated
vendored
1
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/BUILD
generated
vendored
@ -10,6 +10,7 @@ go_library(
|
||||
srcs = [
|
||||
"annotations.go",
|
||||
"doc.go",
|
||||
"helpers.go",
|
||||
"register.go",
|
||||
"types.go",
|
||||
"zz_generated.deepcopy.go",
|
||||
|
58
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/helpers.go
generated
vendored
Normal file
58
vendor/k8s.io/kubernetes/pkg/apis/autoscaling/helpers.go
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright 2020 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 autoscaling
|
||||
|
||||
// DropRoundTripHorizontalPodAutoscalerAnnotations removes any annotations used to serialize round-tripped fields from later API versions,
|
||||
// and returns false if no changes were made and the original input object was returned.
|
||||
// It should always be called when converting internal -> external versions, prior
|
||||
// to setting any of the custom annotations:
|
||||
//
|
||||
// annotations, copiedAnnotations := DropRoundTripHorizontalPodAutoscalerAnnotations(externalObj.Annotations)
|
||||
// externalObj.Annotations = annotations
|
||||
//
|
||||
// if internal.SomeField != nil {
|
||||
// if !copiedAnnotations {
|
||||
// externalObj.Annotations = DeepCopyStringMap(externalObj.Annotations)
|
||||
// copiedAnnotations = true
|
||||
// }
|
||||
// externalObj.Annotations[...] = json.Marshal(...)
|
||||
// }
|
||||
func DropRoundTripHorizontalPodAutoscalerAnnotations(in map[string]string) (out map[string]string, copied bool) {
|
||||
_, hasMetricsSpecs := in[MetricSpecsAnnotation]
|
||||
_, hasBehaviorSpecs := in[BehaviorSpecsAnnotation]
|
||||
_, hasMetricsStatuses := in[MetricStatusesAnnotation]
|
||||
_, hasConditions := in[HorizontalPodAutoscalerConditionsAnnotation]
|
||||
if hasMetricsSpecs || hasBehaviorSpecs || hasMetricsStatuses || hasConditions {
|
||||
out = DeepCopyStringMap(in)
|
||||
delete(out, MetricSpecsAnnotation)
|
||||
delete(out, BehaviorSpecsAnnotation)
|
||||
delete(out, MetricStatusesAnnotation)
|
||||
delete(out, HorizontalPodAutoscalerConditionsAnnotation)
|
||||
return out, true
|
||||
}
|
||||
return in, false
|
||||
}
|
||||
|
||||
// DeepCopyStringMap returns a copy of the input map.
|
||||
// If input is nil, an empty map is returned.
|
||||
func DeepCopyStringMap(in map[string]string) map[string]string {
|
||||
out := make(map[string]string, len(in))
|
||||
for k, v := range in {
|
||||
out[k] = v
|
||||
}
|
||||
return out
|
||||
}
|
2
vendor/k8s.io/kubernetes/pkg/apis/core/types.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/apis/core/types.go
generated
vendored
@ -4250,7 +4250,7 @@ type PodLogOptions struct {
|
||||
// If this value is in the future, no logs will be returned.
|
||||
// Only one of sinceSeconds or sinceTime may be specified.
|
||||
SinceTime *metav1.Time
|
||||
// If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line
|
||||
// If true, add an RFC 3339 timestamp with 9 digits of fractional seconds at the beginning of every line
|
||||
// of log output.
|
||||
Timestamps bool
|
||||
// If set, the number of lines from the end of the logs to show. If not specified,
|
||||
|
5
vendor/k8s.io/kubernetes/pkg/kubelet/types/constants.go
generated
vendored
5
vendor/k8s.io/kubernetes/pkg/kubelet/types/constants.go
generated
vendored
@ -29,4 +29,9 @@ const (
|
||||
SystemReservedEnforcementKey = "system-reserved"
|
||||
KubeReservedEnforcementKey = "kube-reserved"
|
||||
NodeAllocatableNoneKey = "none"
|
||||
|
||||
// fixed width version of time.RFC3339Nano
|
||||
RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00"
|
||||
// variable width RFC3339 time format for lenient parsing of strings into timestamps
|
||||
RFC3339NanoLenient = "2006-01-02T15:04:05.999999999Z07:00"
|
||||
)
|
||||
|
8
vendor/k8s.io/kubernetes/pkg/kubelet/types/types.go
generated
vendored
8
vendor/k8s.io/kubernetes/pkg/kubelet/types/types.go
generated
vendored
@ -43,10 +43,10 @@ func NewTimestamp() *Timestamp {
|
||||
return &Timestamp{time.Now()}
|
||||
}
|
||||
|
||||
// ConvertToTimestamp takes a string, parses it using the RFC3339Nano layout,
|
||||
// ConvertToTimestamp takes a string, parses it using the RFC3339NanoLenient layout,
|
||||
// and converts it to a Timestamp object.
|
||||
func ConvertToTimestamp(timeString string) *Timestamp {
|
||||
parsed, _ := time.Parse(time.RFC3339Nano, timeString)
|
||||
parsed, _ := time.Parse(RFC3339NanoLenient, timeString)
|
||||
return &Timestamp{parsed}
|
||||
}
|
||||
|
||||
@ -55,10 +55,10 @@ func (t *Timestamp) Get() time.Time {
|
||||
return t.time
|
||||
}
|
||||
|
||||
// GetString returns the time in the string format using the RFC3339Nano
|
||||
// GetString returns the time in the string format using the RFC3339NanoFixed
|
||||
// layout.
|
||||
func (t *Timestamp) GetString() string {
|
||||
return t.time.Format(time.RFC3339Nano)
|
||||
return t.time.Format(RFC3339NanoFixed)
|
||||
}
|
||||
|
||||
// A type to help sort container statuses based on container names.
|
||||
|
@ -117,6 +117,7 @@ func calculateResourceAllocatableRequest(nodeInfo *schedulernodeinfo.NodeInfo, p
|
||||
|
||||
// calculatePodResourceRequest returns the total non-zero requests. If Overhead is defined for the pod and the
|
||||
// PodOverhead feature is enabled, the Overhead is added to the result.
|
||||
// podResourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead
|
||||
func calculatePodResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64 {
|
||||
var podRequest int64
|
||||
for i := range pod.Spec.Containers {
|
||||
@ -125,11 +126,20 @@ func calculatePodResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64 {
|
||||
podRequest += value
|
||||
}
|
||||
|
||||
for i := range pod.Spec.InitContainers {
|
||||
initContainer := &pod.Spec.InitContainers[i]
|
||||
value := schedutil.GetNonzeroRequestForResource(resource, &initContainer.Resources.Requests)
|
||||
if podRequest < value {
|
||||
podRequest = value
|
||||
}
|
||||
}
|
||||
|
||||
// If Overhead is being utilized, add to the total requests for the pod
|
||||
if pod.Spec.Overhead != nil && utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) {
|
||||
if quantity, found := pod.Spec.Overhead[resource]; found {
|
||||
podRequest += quantity.Value()
|
||||
}
|
||||
}
|
||||
|
||||
return podRequest
|
||||
}
|
||||
|
20
vendor/k8s.io/kubernetes/pkg/scheduler/nodeinfo/node_info.go
generated
vendored
20
vendor/k8s.io/kubernetes/pkg/scheduler/nodeinfo/node_info.go
generated
vendored
@ -173,7 +173,10 @@ func (r *Resource) Add(rl v1.ResourceList) {
|
||||
case v1.ResourcePods:
|
||||
r.AllowedPodNumber += int(rQuant.Value())
|
||||
case v1.ResourceEphemeralStorage:
|
||||
r.EphemeralStorage += rQuant.Value()
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) {
|
||||
// if the local storage capacity isolation feature gate is disabled, pods request 0 disk.
|
||||
r.EphemeralStorage += rQuant.Value()
|
||||
}
|
||||
default:
|
||||
if v1helper.IsScalarResourceName(rName) {
|
||||
r.AddScalar(rName, rQuant.Value())
|
||||
@ -565,21 +568,32 @@ func (n *NodeInfo) resetSlicesIfEmpty() {
|
||||
}
|
||||
}
|
||||
|
||||
// resourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead
|
||||
func calculateResource(pod *v1.Pod) (res Resource, non0CPU int64, non0Mem int64) {
|
||||
resPtr := &res
|
||||
for _, c := range pod.Spec.Containers {
|
||||
resPtr.Add(c.Resources.Requests)
|
||||
|
||||
non0CPUReq, non0MemReq := schedutil.GetNonzeroRequests(&c.Resources.Requests)
|
||||
non0CPU += non0CPUReq
|
||||
non0Mem += non0MemReq
|
||||
// No non-zero resources for GPUs or opaque resources.
|
||||
}
|
||||
|
||||
for _, ic := range pod.Spec.InitContainers {
|
||||
resPtr.SetMaxResource(ic.Resources.Requests)
|
||||
non0CPUReq, non0MemReq := schedutil.GetNonzeroRequests(&ic.Resources.Requests)
|
||||
if non0CPU < non0CPUReq {
|
||||
non0CPU = non0CPUReq
|
||||
}
|
||||
|
||||
if non0Mem < non0MemReq {
|
||||
non0Mem = non0MemReq
|
||||
}
|
||||
}
|
||||
|
||||
// If Overhead is being utilized, add to the total requests for the pod
|
||||
if pod.Spec.Overhead != nil && utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) {
|
||||
resPtr.Add(pod.Spec.Overhead)
|
||||
|
||||
if _, found := pod.Spec.Overhead[v1.ResourceCPU]; found {
|
||||
non0CPU += pod.Spec.Overhead.Cpu().MilliValue()
|
||||
}
|
||||
|
2
vendor/k8s.io/kubernetes/pkg/scheduler/util/BUILD
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/scheduler/util/BUILD
generated
vendored
@ -40,10 +40,12 @@ go_library(
|
||||
deps = [
|
||||
"//pkg/api/v1/pod:go_default_library",
|
||||
"//pkg/apis/core/v1/helper:go_default_library",
|
||||
"//pkg/features:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
|
||||
"//staging/src/k8s.io/kube-scheduler/extender/v1:go_default_library",
|
||||
"//vendor/k8s.io/klog:go_default_library",
|
||||
],
|
||||
|
7
vendor/k8s.io/kubernetes/pkg/scheduler/util/non_zero.go
generated
vendored
7
vendor/k8s.io/kubernetes/pkg/scheduler/util/non_zero.go
generated
vendored
@ -18,7 +18,9 @@ package util
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
|
||||
"k8s.io/kubernetes/pkg/features"
|
||||
)
|
||||
|
||||
// For each of these resources, a pod that doesn't request the resource explicitly
|
||||
@ -60,6 +62,11 @@ func GetNonzeroRequestForResource(resource v1.ResourceName, requests *v1.Resourc
|
||||
}
|
||||
return requests.Memory().Value()
|
||||
case v1.ResourceEphemeralStorage:
|
||||
// if the local storage capacity isolation feature gate is disabled, pods request 0 disk.
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) {
|
||||
return 0
|
||||
}
|
||||
|
||||
quantity, found := (*requests)[v1.ResourceEphemeralStorage]
|
||||
if !found {
|
||||
return 0
|
||||
|
2
vendor/k8s.io/kubernetes/pkg/volume/plugins.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/volume/plugins.go
generated
vendored
@ -351,6 +351,8 @@ type AttachDetachVolumeHost interface {
|
||||
// CSIDriverLister returns the informer lister for the CSIDriver API Object
|
||||
CSIDriverLister() storagelistersv1.CSIDriverLister
|
||||
|
||||
// VolumeAttachmentLister returns the informer lister for the VolumeAttachment API Object
|
||||
VolumeAttachmentLister() storagelistersv1.VolumeAttachmentLister
|
||||
// IsAttachDetachController is an interface marker to strictly tie AttachDetachVolumeHost
|
||||
// to the attachDetachController
|
||||
IsAttachDetachController() bool
|
||||
|
Reference in New Issue
Block a user