v1

package
v0.0.0-...-ec72bf4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

v1 版本的api包

  • Copyright (c) 2023 Baidu, Inc. All Rights Reserved. *
  • 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. *

Index

Constants

View Source
const (
	// CustomResourceDefinitionGroup is the name of the third party resource group
	CustomResourceDefinitionGroup = k8sconst.CustomResourceDefinitionGroup

	// CustomResourceDefinitionVersion is the current version of the resource
	CustomResourceDefinitionVersion = "v2"

	SubnetPluralName = "subnets"
	// ENIName is the full name of CCE Node
	SubnetName = SubnetPluralName + "." + CustomResourceDefinitionGroup
)
View Source
const (
	GroupName = "cce.baidubce.com"
)

GroupName is the group name used in this package

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Functions

func IsInSubnet

func IsInSubnet(sbn *Subnet, privateIPStr string) bool

IsInSubnet checks if the privateIPStr is in the subnet

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Subnet

type Subnet struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   SubnetSpec   `json:"spec,omitempty"`
	Status SubnetStatus `json:"status,omitempty"`
}

func (*Subnet) DeepCopy

func (in *Subnet) DeepCopy() *Subnet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet.

func (*Subnet) DeepCopyInto

func (in *Subnet) DeepCopyInto(out *Subnet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Subnet) DeepCopyObject

func (in *Subnet) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SubnetList

type SubnetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Subnet `json:"items"`
}

func (*SubnetList) DeepCopy

func (in *SubnetList) DeepCopy() *SubnetList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetList.

func (*SubnetList) DeepCopyInto

func (in *SubnetList) DeepCopyInto(out *SubnetList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SubnetList) DeepCopyObject

func (in *SubnetList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SubnetSpec

type SubnetSpec struct {
	ID               string            `json:"id,omitempty"`
	Name             string            `json:"name,omitempty"`
	AvailabilityZone string            `json:"availabilityZone,omitempty"`
	CIDR             string            `json:"cidr,omitempty"`
	IPv6CIDR         string            `json:"ipv6CIDR,omitempty"`
	VPCID            string            `json:"vpcId,omitempty"`
	Tags             map[string]string `json:"tags,omitempty"`
	Description      string            `json:"description,omitempty"`
	SubnetType       string            `json:"subnetType,omitempty"`
	// Exclusive subnet flag
	// Exclusive subnet only allows manual IP assignment
	// If a subnet is marked as a Exclusive subnet, it can no longer be
	// used as a subnet for automatic IP allocation
	//
	// WARN: Marking as an exclusive subnet only allows you to manually
	// allocate IP. If the default subnet for IPAM is marked as an exclusive
	// subnet, it may cause all pods to fail to allocate IP
	Exclusive bool `json:"exclusive,omitempty"`
}

func (*SubnetSpec) DeepCopy

func (in *SubnetSpec) DeepCopy() *SubnetSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetSpec.

func (*SubnetSpec) DeepCopyInto

func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SubnetStatus

type SubnetStatus struct {
	AvailableIPNum int    `json:"availableIPNum,omitempty"`
	Enable         bool   `json:"enable,omitempty"`
	HasNoMoreIP    bool   `json:"hasNoMoreIP,omitempty"`
	Reason         string `json:"reason,omitempty"`
}

func (*SubnetStatus) DeepCopy

func (in *SubnetStatus) DeepCopy() *SubnetStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetStatus.

func (*SubnetStatus) DeepCopyInto

func (in *SubnetStatus) DeepCopyInto(out *SubnetStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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