You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
errorString: "error reading containers: spec.template.spec.containers accessor error: invalid-value is of the type string, expected map[string]interface{}",
493
+
fn: func(mmap[string]interface{}) error {
494
+
returnnil
495
+
},
496
+
},
497
+
{
498
+
name: "no manifest",
499
+
inputManifest: "",
500
+
expectedObject: nil,
501
+
error: true,
502
+
errorString: "containers not found",
503
+
fn: func(mmap[string]interface{}) error {
504
+
returnnil
505
+
},
506
+
},
507
+
{
508
+
name: "object has no containers list",
509
+
inputManifest: `---
510
+
apiVersion: apps/v1
511
+
kind: Deployment
512
+
metadata:
513
+
name: frontend
514
+
labels:
515
+
app: test-app
516
+
spec:
517
+
selector:
518
+
matchLabels:
519
+
app: guestbook
520
+
tier: frontend
521
+
replicas: 3
522
+
template:
523
+
metadata:
524
+
labels:
525
+
app: guestbook
526
+
tier: frontend
527
+
spec:
528
+
containers: invalid-value`,
529
+
expectedObject: nil,
530
+
error: true,
531
+
errorString: "containers was not a list",
532
+
fn: func(mmap[string]interface{}) error {
533
+
returnnil
534
+
},
535
+
},
536
+
{
537
+
name: "object has no containers normal structure",
538
+
inputManifest: `---
539
+
apiVersion: apps/v1
540
+
kind: Deployment
541
+
metadata:
542
+
name: frontend
543
+
labels:
544
+
app: test-app
545
+
spec:
546
+
selector:
547
+
matchLabels:
548
+
app: guestbook
549
+
tier: frontend
550
+
replicas: 3
551
+
template:
552
+
metadata:
553
+
labels:
554
+
app: guestbook
555
+
tier: frontend
556
+
spec:
557
+
containers:
558
+
- dummy-value`,
559
+
expectedObject: nil,
560
+
error: true,
561
+
errorString: "container was not an object",
562
+
fn: func(mmap[string]interface{}) error {
563
+
returnnil
564
+
},
565
+
},
566
+
{
567
+
name: "mutate function return error",
568
+
inputManifest: `---
569
+
apiVersion: apps/v1
570
+
kind: Deployment
571
+
metadata:
572
+
name: frontend
573
+
labels:
574
+
app: test-app
575
+
spec:
576
+
selector:
577
+
matchLabels:
578
+
app: guestbook
579
+
tier: frontend
580
+
replicas: 3
581
+
template:
582
+
metadata:
583
+
labels:
584
+
app: guestbook
585
+
tier: frontend
586
+
spec:
587
+
containers:
588
+
- name: php-redis
589
+
image: gcr.io/google-samples/gb-frontend:v4`,
590
+
expectedObject: nil,
591
+
error: true,
592
+
errorString: "error occures in mutate function",
593
+
fn: func(mmap[string]interface{}) error {
594
+
returnfmt.Errorf("error occures in mutate function")
0 commit comments