@@ -475,15 +475,19 @@ func TestOTELColValidatingWebhook(t *testing.T) {
475
475
thrift_http:
476
476
endpoint: 0.0.0.0:15268
477
477
` ,
478
- Ports : []v1. ServicePort {
478
+ Ports : []PortsSpec {
479
479
{
480
- Name : "port1" ,
481
- Port : 5555 ,
480
+ ServicePort : v1.ServicePort {
481
+ Name : "port1" ,
482
+ Port : 5555 ,
483
+ },
482
484
},
483
485
{
484
- Name : "port2" ,
485
- Port : 5554 ,
486
- Protocol : v1 .ProtocolUDP ,
486
+ ServicePort : v1.ServicePort {
487
+ Name : "port2" ,
488
+ Port : 5554 ,
489
+ Protocol : v1 .ProtocolUDP ,
490
+ },
487
491
},
488
492
},
489
493
Autoscaler : & AutoscalerSpec {
@@ -533,15 +537,19 @@ func TestOTELColValidatingWebhook(t *testing.T) {
533
537
thrift_http:
534
538
endpoint: 0.0.0.0:15268
535
539
` ,
536
- Ports : []v1. ServicePort {
540
+ Ports : []PortsSpec {
537
541
{
538
- Name : "port1" ,
539
- Port : 5555 ,
542
+ ServicePort : v1.ServicePort {
543
+ Name : "port1" ,
544
+ Port : 5555 ,
545
+ },
540
546
},
541
547
{
542
- Name : "port2" ,
543
- Port : 5554 ,
544
- Protocol : v1 .ProtocolUDP ,
548
+ ServicePort : v1.ServicePort {
549
+ Name : "port2" ,
550
+ Port : 5554 ,
551
+ Protocol : v1 .ProtocolUDP ,
552
+ },
545
553
},
546
554
},
547
555
Autoscaler : & AutoscalerSpec {
@@ -601,15 +609,19 @@ func TestOTELColValidatingWebhook(t *testing.T) {
601
609
thrift_http:
602
610
endpoint: 0.0.0.0:15268
603
611
` ,
604
- Ports : []v1. ServicePort {
612
+ Ports : []PortsSpec {
605
613
{
606
- Name : "port1" ,
607
- Port : 5555 ,
614
+ ServicePort : v1.ServicePort {
615
+ Name : "port1" ,
616
+ Port : 5555 ,
617
+ },
608
618
},
609
619
{
610
- Name : "port2" ,
611
- Port : 5554 ,
612
- Protocol : v1 .ProtocolUDP ,
620
+ ServicePort : v1.ServicePort {
621
+ Name : "port2" ,
622
+ Port : 5554 ,
623
+ Protocol : v1 .ProtocolUDP ,
624
+ },
613
625
},
614
626
},
615
627
Autoscaler : & AutoscalerSpec {
@@ -687,12 +699,14 @@ func TestOTELColValidatingWebhook(t *testing.T) {
687
699
name : "invalid port name" ,
688
700
otelcol : OpenTelemetryCollector {
689
701
Spec : OpenTelemetryCollectorSpec {
690
- Ports : []v1. ServicePort {
702
+ Ports : []PortsSpec {
691
703
{
692
- // this port name contains a non alphanumeric character, which is invalid.
693
- Name : "-test🦄port" ,
694
- Port : 12345 ,
695
- Protocol : v1 .ProtocolTCP ,
704
+ ServicePort : v1.ServicePort {
705
+ // this port name contains a non alphanumeric character, which is invalid.
706
+ Name : "-test🦄port" ,
707
+ Port : 12345 ,
708
+ Protocol : v1 .ProtocolTCP ,
709
+ },
696
710
},
697
711
},
698
712
},
@@ -703,10 +717,12 @@ func TestOTELColValidatingWebhook(t *testing.T) {
703
717
name : "invalid port name, too long" ,
704
718
otelcol : OpenTelemetryCollector {
705
719
Spec : OpenTelemetryCollectorSpec {
706
- Ports : []v1. ServicePort {
720
+ Ports : []PortsSpec {
707
721
{
708
- Name : "aaaabbbbccccdddd" , // len: 16, too long
709
- Port : 5555 ,
722
+ ServicePort : v1.ServicePort {
723
+ Name : "aaaabbbbccccdddd" , // len: 16, too long
724
+ Port : 5555 ,
725
+ },
710
726
},
711
727
},
712
728
},
@@ -717,10 +733,12 @@ func TestOTELColValidatingWebhook(t *testing.T) {
717
733
name : "invalid port num" ,
718
734
otelcol : OpenTelemetryCollector {
719
735
Spec : OpenTelemetryCollectorSpec {
720
- Ports : []v1. ServicePort {
736
+ Ports : []PortsSpec {
721
737
{
722
- Name : "aaaabbbbccccddd" , // len: 15
723
- // no port set means it's 0, which is invalid
738
+ ServicePort : v1.ServicePort {
739
+ Name : "aaaabbbbccccddd" , // len: 15
740
+ // no port set means it's 0, which is invalid
741
+ },
724
742
},
725
743
},
726
744
},
0 commit comments