@@ -170,8 +170,8 @@ func tov1beta1TA(in OpenTelemetryTargetAllocator) v1beta1.TargetAllocatorEmbedde
170
170
Replicas : in .Replicas ,
171
171
NodeSelector : in .NodeSelector ,
172
172
Resources : in .Resources ,
173
- AllocationStrategy : v1beta1 . TargetAllocatorAllocationStrategy (in .AllocationStrategy ),
174
- FilterStrategy : v1beta1 . TargetAllocatorFilterStrategy (in .FilterStrategy ),
173
+ AllocationStrategy : tov1beta1TAAllocationStrategy (in .AllocationStrategy ),
174
+ FilterStrategy : tov1beta1TAFilterStrategy (in .FilterStrategy ),
175
175
ServiceAccount : in .ServiceAccount ,
176
176
Image : in .Image ,
177
177
Enabled : in .Enabled ,
@@ -440,8 +440,8 @@ func tov1alpha1TA(in v1beta1.TargetAllocatorEmbedded) OpenTelemetryTargetAllocat
440
440
Replicas : in .Replicas ,
441
441
NodeSelector : in .NodeSelector ,
442
442
Resources : in .Resources ,
443
- AllocationStrategy : OpenTelemetryTargetAllocatorAllocationStrategy (in .AllocationStrategy ),
444
- FilterStrategy : string (in .FilterStrategy ),
443
+ AllocationStrategy : tov1alpha1TAAllocationStrategy (in .AllocationStrategy ),
444
+ FilterStrategy : tov1alpha1TAFilterStrategy (in .FilterStrategy ),
445
445
ServiceAccount : in .ServiceAccount ,
446
446
Image : in .Image ,
447
447
Enabled : in .Enabled ,
@@ -466,3 +466,42 @@ func tov1alpha1TA(in v1beta1.TargetAllocatorEmbedded) OpenTelemetryTargetAllocat
466
466
PodDisruptionBudget : tov1alpha1PodDisruptionBudget (in .PodDisruptionBudget ),
467
467
}
468
468
}
469
+
470
+ func tov1alpha1TAFilterStrategy (strategy v1beta1.TargetAllocatorFilterStrategy ) string {
471
+ switch strategy {
472
+ case v1beta1 .TargetAllocatorFilterStrategyRelabelConfig :
473
+ return string (strategy )
474
+ }
475
+ return ""
476
+ }
477
+
478
+ func tov1alpha1TAAllocationStrategy (strategy v1beta1.TargetAllocatorAllocationStrategy ) OpenTelemetryTargetAllocatorAllocationStrategy {
479
+ switch strategy {
480
+ case v1beta1 .TargetAllocatorAllocationStrategyConsistentHashing :
481
+ return OpenTelemetryTargetAllocatorAllocationStrategyConsistentHashing
482
+ case v1beta1 .TargetAllocatorAllocationStrategyPerNode :
483
+ return OpenTelemetryTargetAllocatorAllocationStrategyPerNode
484
+ case v1beta1 .TargetAllocatorAllocationStrategyLeastWeighted :
485
+ return OpenTelemetryTargetAllocatorAllocationStrategyLeastWeighted
486
+ }
487
+ return ""
488
+ }
489
+
490
+ func tov1beta1TAFilterStrategy (strategy string ) v1beta1.TargetAllocatorFilterStrategy {
491
+ if strategy == string (v1beta1 .TargetAllocatorFilterStrategyRelabelConfig ) {
492
+ return v1beta1 .TargetAllocatorFilterStrategyRelabelConfig
493
+ }
494
+ return ""
495
+ }
496
+
497
+ func tov1beta1TAAllocationStrategy (strategy OpenTelemetryTargetAllocatorAllocationStrategy ) v1beta1.TargetAllocatorAllocationStrategy {
498
+ switch strategy {
499
+ case OpenTelemetryTargetAllocatorAllocationStrategyPerNode :
500
+ return v1beta1 .TargetAllocatorAllocationStrategyPerNode
501
+ case OpenTelemetryTargetAllocatorAllocationStrategyConsistentHashing :
502
+ return v1beta1 .TargetAllocatorAllocationStrategyConsistentHashing
503
+ case OpenTelemetryTargetAllocatorAllocationStrategyLeastWeighted :
504
+ return v1beta1 .TargetAllocatorAllocationStrategyLeastWeighted
505
+ }
506
+ return ""
507
+ }
0 commit comments