Skip to content

Commit bd67e68

Browse files
committed
remove unit test for previously removed consul-cni validation
In #1527, we added support for OpenShift and Multus, which meant that the `consul-cni` plugin was no longer necessarily the final CNI plugin run. While working on a patch to allow compatibility with Nomad transparent proxy, I discovered we'd never removed a now-failing unit test of the plugin for the validation step. It looks like the remaining unit tests still cover the remaining validation, so we can safely remove this test. Ref: #1527 Ref: hashicorp/nomad#10628
1 parent 411c821 commit bd67e68

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

control-plane/cni/main_test.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,6 @@ func Test_cmdAdd(t *testing.T) {
6666
expectedErr: fmt.Errorf("not running in a pod, namespace and pod should have values"),
6767
expectedRules: false, // Rules won't be applied because the command will throw an error first
6868
},
69-
{
70-
name: "Missing prevResult in stdin data, should throw error",
71-
cmd: &Command{
72-
client: fake.NewSimpleClientset(),
73-
},
74-
podName: "missing-prev-result",
75-
stdInData: missingPrevResultStdinData,
76-
configuredPod: func(pod *corev1.Pod, cmd *Command) *corev1.Pod {
77-
_, err := cmd.client.CoreV1().Pods(defaultNamespace).Create(context.Background(), pod, metav1.CreateOptions{})
78-
require.NoError(t, err)
79-
80-
return pod
81-
},
82-
expectedErr: fmt.Errorf("must be called as final chained plugin"),
83-
expectedRules: false, // Rules won't be applied because the command will throw an error first
84-
},
8569
{
8670
name: "Missing IPs in prevResult in stdin data, should throw error",
8771
cmd: &Command{
@@ -336,31 +320,6 @@ const goodStdinData = `{
336320
"type": "consul-cni"
337321
}`
338322

339-
const missingPrevResultStdinData = `{
340-
"cniVersion": "0.3.1",
341-
"name": "kindnet",
342-
"type": "kindnet",
343-
"capabilities": {
344-
"testCapability": false
345-
},
346-
"ipam": {
347-
"type": "host-local"
348-
},
349-
"dns": {
350-
"nameservers": ["nameserver"],
351-
"domain": "domain",
352-
"search": ["search"],
353-
"options": ["option"]
354-
},
355-
"cni_bin_dir": "/opt/cni/bin",
356-
"cni_net_dir": "/etc/cni/net.d",
357-
"kubeconfig": "ZZZ-consul-cni-kubeconfig",
358-
"log_level": "info",
359-
"multus": false,
360-
"name": "consul-cni",
361-
"type": "consul-cni"
362-
}`
363-
364323
const missingIPsStdinData = `{
365324
"cniVersion": "0.3.1",
366325
"name": "kindnet",

0 commit comments

Comments
 (0)