v1helper

package
v1.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright (c) 2022 Tigera, Inc. All rights reserved.

Copyright 2014 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.

The contents of this file are mostly copied, with minor modifications, from: https://github.com/kubernetes/kubernetes/blob/f38615fb9d1188934213633ff92d523259ae8f6a/pkg/apis/core/v1/helper/helpers.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HugePageResourceName

func HugePageResourceName(pageSize resource.Quantity) v1.ResourceName

HugePageResourceName returns a ResourceName with the canonical hugepage prefix prepended for the specified page size. The page size is converted to its canonical representation.

func IsExtendedResourceName

func IsExtendedResourceName(name v1.ResourceName) bool

IsExtendedResourceName returns true if: 1. the resource name is not in the default namespace; 2. resource name does not have "requests." prefix, to avoid confusion with the convention in quota 3. it satisfies the rules in IsQualifiedName() after converted into quota resource name

func IsHugePageMedium

func IsHugePageMedium(medium v1.StorageMedium) bool

IsHugePageMedium returns true if the volume medium is in 'HugePages[-size]' format

func IsHugePageResourceName

func IsHugePageResourceName(name v1.ResourceName) bool

IsHugePageResourceName returns true if the resource name has the huge page resource prefix.

func IsNativeResource

func IsNativeResource(name v1.ResourceName) bool

IsNativeResource returns true if the resource name is in the *kubernetes.io/ namespace. Partially-qualified (unprefixed) names are implicitly in the kubernetes.io/ namespace.

func IsOvercommitAllowed

func IsOvercommitAllowed(name v1.ResourceName) bool

IsOvercommitAllowed returns true if the resource is in the default namespace and is not hugepages.

func IsPrefixedNativeResource

func IsPrefixedNativeResource(name v1.ResourceName) bool

IsPrefixedNativeResource returns true if the resource name is in the *kubernetes.io/ namespace.

func TopologySelectorRequirementsAsSelector

func TopologySelectorRequirementsAsSelector(tsm []v1.TopologySelectorLabelRequirement) (labels.Selector, error)

TopologySelectorRequirementsAsSelector converts the []TopologySelectorLabelRequirement api type into a struct that implements labels.Selector.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL