This repository has been archived by the owner on Jan 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
install-cni: properly detect CNI conf file (match kubelet approach) (#96
) * install-cni: properly detect CNI conf file (match kubelet approach) - Add test cases for skipping invalid .conf and .conflist files * Allow cniVersion to be unset in .conflist
- Loading branch information
1 parent
73bc89a
commit f22f27d
Showing
10 changed files
with
263 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
deployments/kubernetes/install/test/data/pre/bad_minikube_cni.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "rkt.kubernetes.io", | ||
"bridge": "mybridge", | ||
"mtu": 1460, | ||
"addIf": "true", | ||
"isGateway": true, | ||
"ipMasq": true, | ||
"ipam": { | ||
"type": "host-local", | ||
"subnet": "10.1.0.0/16", | ||
"gateway": "10.1.0.1", | ||
"routes": [ | ||
{ | ||
"dst": "0.0.0.0/0" | ||
} | ||
] | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"This is not json" | ||
|
||
Maybe it magically parses but shouldn't |
27 changes: 27 additions & 0 deletions
27
deployments/kubernetes/install/test/data/pre/noname_calico.conflist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"cniVersion": "0.3.0", | ||
"plugins": [ | ||
{ | ||
"type": "calico", | ||
"etcd_endpoints": "http://10.110.0.136:6666", | ||
"log_level": "info", | ||
"mtu": 1500, | ||
"ipam": { | ||
"type": "calico-ipam" | ||
}, | ||
"policy": { | ||
"type": "k8s" | ||
}, | ||
"kubernetes": { | ||
"kubeconfig": "/etc/cni/net.d/calico-kubeconfig" | ||
} | ||
}, | ||
{ | ||
"type": "portmap", | ||
"snat": true, | ||
"capabilities": { | ||
"portMappings": true | ||
} | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
deployments/kubernetes/install/test/data/pre/noplugins_calico.conflist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "k8s-pod-network", | ||
"cniVersion": "0.3.0", | ||
"pugins": [ | ||
{ | ||
"type": "calico", | ||
"etcd_endpoints": "http://10.110.0.136:6666", | ||
"log_level": "info", | ||
"mtu": 1500, | ||
"ipam": { | ||
"type": "calico-ipam" | ||
}, | ||
"policy": { | ||
"type": "k8s" | ||
}, | ||
"kubernetes": { | ||
"kubeconfig": "/etc/cni/net.d/calico-kubeconfig" | ||
} | ||
}, | ||
{ | ||
"type": "portmap", | ||
"snat": true, | ||
"capabilities": { | ||
"portMappings": true | ||
} | ||
} | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
deployments/kubernetes/install/test/data/pre/nover_calico.conflist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "k8s-pod-network", | ||
"plugins": [ | ||
{ | ||
"type": "calico", | ||
"etcd_endpoints": "http://10.110.0.136:6666", | ||
"log_level": "info", | ||
"mtu": 1500, | ||
"ipam": { | ||
"type": "calico-ipam" | ||
}, | ||
"policy": { | ||
"type": "k8s" | ||
}, | ||
"kubernetes": { | ||
"kubeconfig": "/etc/cni/net.d/calico-kubeconfig" | ||
} | ||
}, | ||
{ | ||
"type": "portmap", | ||
"snat": true, | ||
"capabilities": { | ||
"portMappings": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.