@@ -387,7 +387,7 @@ func TestVeleroReconciler_buildResticDaemonset(t *testing.T) {
387
387
},
388
388
},
389
389
{
390
- name : "Valid velero and daemonset for aws as bsl with non- default secret name" ,
390
+ name : "Valid velero with annotation and daemonset for aws as bsl with default secret name" ,
391
391
args : args {
392
392
& oadpv1alpha1.Velero {
393
393
Spec : oadpv1alpha1.VeleroSpec {
@@ -409,178 +409,7 @@ func TestVeleroReconciler_buildResticDaemonset(t *testing.T) {
409
409
},
410
410
Credential : & corev1.SecretKeySelector {
411
411
LocalObjectReference : corev1.LocalObjectReference {
412
- Name : "aws-creds" ,
413
- },
414
- },
415
- },
416
- },
417
- },
418
- }, & appsv1.DaemonSet {
419
- ObjectMeta : getResticObjectMeta (r ),
420
- },
421
- },
422
- wantErr : false ,
423
- want : & appsv1.DaemonSet {
424
- ObjectMeta : getResticObjectMeta (r ),
425
- TypeMeta : metav1.TypeMeta {
426
- Kind : "DaemonSet" ,
427
- APIVersion : appsv1 .SchemeGroupVersion .String (),
428
- },
429
- Spec : appsv1.DaemonSetSpec {
430
- UpdateStrategy : appsv1.DaemonSetUpdateStrategy {
431
- Type : appsv1 .RollingUpdateDaemonSetStrategyType ,
432
- },
433
- Selector : resticLabelSelector ,
434
- Template : corev1.PodTemplateSpec {
435
- ObjectMeta : metav1.ObjectMeta {
436
- Labels : map [string ]string {
437
- "component" : common .Velero ,
438
- "name" : common .Restic ,
439
- },
440
- },
441
- Spec : corev1.PodSpec {
442
- NodeSelector : velero .Spec .ResticNodeSelector ,
443
- ServiceAccountName : common .Velero ,
444
- SecurityContext : & corev1.PodSecurityContext {
445
- RunAsUser : pointer .Int64 (0 ),
446
- SupplementalGroups : velero .Spec .ResticSupplementalGroups ,
447
- },
448
- Volumes : []corev1.Volume {
449
- // Cloud Provider volumes are dynamically added in the for loop below
450
- {
451
- Name : HostPods ,
452
- VolumeSource : corev1.VolumeSource {
453
- HostPath : & corev1.HostPathVolumeSource {
454
- Path : resticPvHostPath ,
455
- },
456
- },
457
- },
458
- {
459
- Name : "scratch" ,
460
- VolumeSource : corev1.VolumeSource {
461
- EmptyDir : & corev1.EmptyDirVolumeSource {},
462
- },
463
- },
464
- {
465
- Name : "certs" ,
466
- VolumeSource : corev1.VolumeSource {
467
- EmptyDir : & corev1.EmptyDirVolumeSource {},
468
- },
469
- },
470
- {
471
- Name : "aws-creds" ,
472
- VolumeSource : corev1.VolumeSource {
473
- Secret : & corev1.SecretVolumeSource {
474
- SecretName : "aws-creds" ,
475
- },
476
- },
477
- },
478
- },
479
- Tolerations : velero .Spec .ResticTolerations ,
480
- Containers : []corev1.Container {
481
- {
482
- Name : common .Restic ,
483
- SecurityContext : & corev1.SecurityContext {
484
- Privileged : pointer .Bool (true ),
485
- },
486
- Image : getVeleroImage (& velero ),
487
- ImagePullPolicy : corev1 .PullAlways ,
488
- Resources : r .getVeleroResourceReqs (& velero ), //setting default.
489
- Command : []string {
490
- "/velero" ,
491
- },
492
- Args : []string {
493
- "restic" ,
494
- "server" ,
495
- },
496
- VolumeMounts : []corev1.VolumeMount {
497
- {
498
- Name : "host-pods" ,
499
- MountPath : "/host_pods" ,
500
- MountPropagation : & mountPropagationToHostContainer ,
501
- },
502
- {
503
- Name : "scratch" ,
504
- MountPath : "/scratch" ,
505
- },
506
- {
507
- Name : "certs" ,
508
- MountPath : "/etc/ssl/certs" ,
509
- },
510
- {
511
- Name : "aws-creds" ,
512
- MountPath : "/credentials" ,
513
- },
514
- },
515
- Env : []corev1.EnvVar {
516
- {
517
- Name : "NODE_NAME" ,
518
- ValueFrom : & corev1.EnvVarSource {
519
- FieldRef : & corev1.ObjectFieldSelector {
520
- FieldPath : "spec.nodeName" ,
521
- },
522
- },
523
- },
524
- {
525
- Name : "VELERO_NAMESPACE" ,
526
- ValueFrom : & corev1.EnvVarSource {
527
- FieldRef : & corev1.ObjectFieldSelector {
528
- FieldPath : "metadata.namespace" ,
529
- },
530
- },
531
- },
532
- {
533
- Name : "VELERO_SCRATCH_DIR" ,
534
- Value : "/scratch" ,
535
- },
536
- {
537
- Name : "HTTP_PROXY" ,
538
- Value : os .Getenv ("HTTP_PROXY" ),
539
- },
540
- {
541
- Name : "HTTPS_PROXY" ,
542
- Value : os .Getenv ("HTTPS_PROXY" ),
543
- },
544
- {
545
- Name : "NO_PROXY" ,
546
- Value : os .Getenv ("NO_PROXY" ),
547
- },
548
- {
549
- Name : common .AWSSharedCredentialsFileEnvKey ,
550
- Value : "/credentials/cloud" ,
551
- },
552
- },
553
- },
554
- },
555
- },
556
- },
557
- },
558
- },
559
- },
560
- {
561
- name : "Valid velero with annotation and daemonset for aws as bsl with non-default secret name" ,
562
- args : args {
563
- & oadpv1alpha1.Velero {
564
- Spec : oadpv1alpha1.VeleroSpec {
565
- DefaultVeleroPlugins : []oadpv1alpha1.DefaultPlugin {
566
- oadpv1alpha1 .DefaultPluginAWS ,
567
- },
568
- BackupStorageLocations : []velerov1.BackupStorageLocationSpec {
569
- {
570
- Provider : AWSProvider ,
571
- StorageType : velerov1.StorageType {
572
- ObjectStorage : & velerov1.ObjectStorageLocation {
573
- Bucket : "aws-bucket" ,
574
- },
575
- },
576
- Config : map [string ]string {
577
- Region : "aws-region" ,
578
- S3URL : "https://sr-url-aws-domain.com" ,
579
- InsecureSkipTLSVerify : "false" ,
580
- },
581
- Credential : & corev1.SecretKeySelector {
582
- LocalObjectReference : corev1.LocalObjectReference {
583
- Name : "aws-creds" ,
412
+ Name : "cloud-credentials" ,
584
413
},
585
414
},
586
415
},
@@ -645,10 +474,10 @@ func TestVeleroReconciler_buildResticDaemonset(t *testing.T) {
645
474
},
646
475
},
647
476
{
648
- Name : "aws-creds " ,
477
+ Name : "cloud-credentials " ,
649
478
VolumeSource : corev1.VolumeSource {
650
479
Secret : & corev1.SecretVolumeSource {
651
- SecretName : "aws-creds " ,
480
+ SecretName : "cloud-credentials " ,
652
481
},
653
482
},
654
483
},
@@ -685,7 +514,7 @@ func TestVeleroReconciler_buildResticDaemonset(t *testing.T) {
685
514
MountPath : "/etc/ssl/certs" ,
686
515
},
687
516
{
688
- Name : "aws-creds " ,
517
+ Name : "cloud-credentials " ,
689
518
MountPath : "/credentials" ,
690
519
},
691
520
},
@@ -735,7 +564,7 @@ func TestVeleroReconciler_buildResticDaemonset(t *testing.T) {
735
564
},
736
565
},
737
566
{
738
- name : "Valid velero with DNS Policy/Config with annotation and daemonset for aws as bsl with non- default secret name" ,
567
+ name : "Valid velero with DNS Policy/Config with annotation and daemonset for aws as bsl with default secret name" ,
739
568
args : args {
740
569
& oadpv1alpha1.Velero {
741
570
Spec : oadpv1alpha1.VeleroSpec {
@@ -757,7 +586,7 @@ func TestVeleroReconciler_buildResticDaemonset(t *testing.T) {
757
586
},
758
587
Credential : & corev1.SecretKeySelector {
759
588
LocalObjectReference : corev1.LocalObjectReference {
760
- Name : "aws-creds " ,
589
+ Name : "cloud-credentials " ,
761
590
},
762
591
},
763
592
},
@@ -854,10 +683,10 @@ func TestVeleroReconciler_buildResticDaemonset(t *testing.T) {
854
683
},
855
684
},
856
685
{
857
- Name : "aws-creds " ,
686
+ Name : "cloud-credentials " ,
858
687
VolumeSource : corev1.VolumeSource {
859
688
Secret : & corev1.SecretVolumeSource {
860
- SecretName : "aws-creds " ,
689
+ SecretName : "cloud-credentials " ,
861
690
},
862
691
},
863
692
},
@@ -894,7 +723,7 @@ func TestVeleroReconciler_buildResticDaemonset(t *testing.T) {
894
723
MountPath : "/etc/ssl/certs" ,
895
724
},
896
725
{
897
- Name : "aws-creds " ,
726
+ Name : "cloud-credentials " ,
898
727
MountPath : "/credentials" ,
899
728
},
900
729
},
0 commit comments