@@ -7,10 +7,15 @@ import (
77)
88
99const (
10- cniVersion = "0.3.0" //nolint:unused,deadcode,varcheck // used in linux
11- cniName = "azure" //nolint:unused,deadcode,varcheck // used in linux
12- cniType = "azure-vnet" //nolint:unused,deadcode,varcheck // used in linux
13- nodeLocalDNSIP = "169.254.20.10" //nolint:unused,deadcode,varcheck // used in linux
10+ ciliumcniVersion = "0.3.1" //nolint:unused,deadcode,varcheck // used in linux
11+ ciliumcniName = "cilium" //nolint:unused,deadcode,varcheck // used in linux
12+ ciliumcniType = "cilium-cni" //nolint:unused,deadcode,varcheck // used in linux
13+ ciliumLogFile = "/var/log/cilium-cni.log" //nolint:unused,deadcode,varcheck // used in linux
14+ ciliumIPAM = "azure-ipam" //nolint:unused,deadcode,varcheck // used in linux
15+ overlaycniVersion = "0.3.0" //nolint:unused,deadcode,varcheck // used in linux
16+ overlaycniName = "azure" //nolint:unused,deadcode,varcheck // used in linux
17+ overlaycniType = "azure-vnet" //nolint:unused,deadcode,varcheck // used in linux
18+ nodeLocalDNSIP = "169.254.20.10" //nolint:unused,deadcode,varcheck // used in linux
1419)
1520
1621// cniConflist represents the containernetworking/cni/pkg/types.NetConfList
@@ -21,15 +26,45 @@ type cniConflist struct { //nolint:unused,deadcode // used in linux
2126 Plugins []any `json:"plugins,omitempty"`
2227}
2328
29+ // NetConf describes a network. It represents the Cilium specific containernetworking/cni/pkg/types.NetConf
30+ type NetConf struct {
31+ CNIVersion string `json:"cniVersion,omitempty"`
32+ Name string `json:"name,omitempty"`
33+ Type string `json:"type,omitempty"`
34+ Capabilities map [string ]bool `json:"capabilities,omitempty"`
35+ IPAM IPAM `json:"ipam,omitempty"`
36+ EnableDebug bool `json:"enable-debug"`
37+ LogFile string `json:"log-file"`
38+
39+ RawPrevResult map [string ]interface {} `json:"prevResult,omitempty"`
40+ }
41+
42+ type IPAM struct {
43+ Type string `json:"type,omitempty"`
44+ }
45+
2446// V4OverlayGenerator generates the Azure CNI conflist for the ipv4 Overlay scenario
2547type V4OverlayGenerator struct {
2648 Writer io.WriteCloser
2749}
2850
51+ // CiliumGenerator generates the Azure CNI conflist for the Cilium scenario
52+ type CiliumGenerator struct {
53+ Writer io.WriteCloser
54+ }
55+
2956func (v * V4OverlayGenerator ) Close () error {
3057 if err := v .Writer .Close (); err != nil {
3158 return errors .Wrap (err , "error closing generator" )
3259 }
3360
3461 return nil
3562}
63+
64+ func (v * CiliumGenerator ) Close () error {
65+ if err := v .Writer .Close (); err != nil {
66+ return errors .Wrap (err , "error closing generator" )
67+ }
68+
69+ return nil
70+ }
0 commit comments