Skip to content

Commit

Permalink
Merge pull request #164 from sunya-ch/v1.2.2
Browse files Browse the repository at this point in the history
fix selector bug
  • Loading branch information
sunya-ch authored Dec 5, 2023
2 parents 0415fbc + f5e0550 commit 615d205
Show file tree
Hide file tree
Showing 12 changed files with 810 additions and 15 deletions.
4 changes: 4 additions & 0 deletions cni/plugins/main/multi-nic/multi-nic.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ func loadConf(args *skel.CmdArgs) (*NetConf, string, error) {
}
selectResponse, err := selectNICs(n.DaemonIP, n.DaemonPort, podName, podNamespace, hostName, n.Name, nicSet, n.MasterNetAddrs)
if err != nil {
if n.IPAM.Type == MultiConfigIPAMType {
// allow to have empty Masters
err = nil
}
return n, deviceType, err
}
n.Masters = selectResponse.Masters
Expand Down
127 changes: 127 additions & 0 deletions daemon/example/crd/multinic.fms.io_cidrs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: cidrs.multinic.fms.io
spec:
group: multinic.fms.io
names:
kind: CIDR
listKind: CIDRList
plural: cidrs
singular: cidr
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
description: CIDR is the Schema for the cidrs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: CIDRSpec defines the desired state of CIDR
properties:
cidr:
items:
properties:
hosts:
items:
properties:
hostIP:
type: string
hostIndex:
type: integer
hostName:
type: string
interfaceName:
type: string
ippool:
type: string
podCIDR:
type: string
required:
- hostIP
- hostIndex
- hostName
- interfaceName
- podCIDR
type: object
type: array
interfaceIndex:
type: integer
netAddress:
type: string
vlanCIDR:
type: string
required:
- hosts
- interfaceIndex
- netAddress
- vlanCIDR
type: object
type: array
config:
description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
Important: Run "make" to regenerate code after modifying this file'
properties:
excludeCIDRs:
items:
type: string
type: array
hostBlock:
type: integer
interfaceBlock:
type: integer
masterNets:
items:
type: string
type: array
name:
type: string
subnet:
type: string
type:
type: string
vlanMode:
type: string
required:
- hostBlock
- interfaceBlock
- masterNets
- name
- subnet
- type
type: object
required:
- cidr
- config
type: object
status:
description: CIDRStatus defines the observed state of CIDR
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit 615d205

Please sign in to comment.