Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unit test for previously removed consul-cni validation #3794

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions control-plane/cni/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,6 @@ func Test_cmdAdd(t *testing.T) {
expectedErr: fmt.Errorf("not running in a pod, namespace and pod should have values"),
expectedRules: false, // Rules won't be applied because the command will throw an error first
},
{
name: "Missing prevResult in stdin data, should throw error",
cmd: &Command{
client: fake.NewSimpleClientset(),
},
podName: "missing-prev-result",
stdInData: missingPrevResultStdinData,
configuredPod: func(pod *corev1.Pod, cmd *Command) *corev1.Pod {
_, err := cmd.client.CoreV1().Pods(defaultNamespace).Create(context.Background(), pod, metav1.CreateOptions{})
require.NoError(t, err)

return pod
},
expectedErr: fmt.Errorf("must be called as final chained plugin"),
expectedRules: false, // Rules won't be applied because the command will throw an error first
},
{
name: "Missing IPs in prevResult in stdin data, should throw error",
cmd: &Command{
Expand Down Expand Up @@ -336,31 +320,6 @@ const goodStdinData = `{
"type": "consul-cni"
}`

const missingPrevResultStdinData = `{
"cniVersion": "0.3.1",
"name": "kindnet",
"type": "kindnet",
"capabilities": {
"testCapability": false
},
"ipam": {
"type": "host-local"
},
"dns": {
"nameservers": ["nameserver"],
"domain": "domain",
"search": ["search"],
"options": ["option"]
},
"cni_bin_dir": "/opt/cni/bin",
"cni_net_dir": "/etc/cni/net.d",
"kubeconfig": "ZZZ-consul-cni-kubeconfig",
"log_level": "info",
"multus": false,
"name": "consul-cni",
"type": "consul-cni"
}`

const missingIPsStdinData = `{
"cniVersion": "0.3.1",
"name": "kindnet",
Expand Down
Loading