From 1da8622d489aee184c99eadf2fbd31129a81dc1e Mon Sep 17 00:00:00 2001 From: David van der Spek Date: Fri, 14 Jul 2023 13:50:24 +0200 Subject: [PATCH] fix: some more type changes Signed-off-by: David van der Spek --- .../v1alpha1/tempo_limit_types.go | 24 +-- .../v1alpha1/zz_generated.deepcopy.go | 180 ++++++++++++++---- 2 files changed, 155 insertions(+), 49 deletions(-) diff --git a/api/observability/v1alpha1/tempo_limit_types.go b/api/observability/v1alpha1/tempo_limit_types.go index bf602e9..b86e34e 100644 --- a/api/observability/v1alpha1/tempo_limit_types.go +++ b/api/observability/v1alpha1/tempo_limit_types.go @@ -27,7 +27,7 @@ type TempoLimits struct { // Forwarders // +kubebuilder:validation:Optional - Forwarders []string `yaml:"forwarders,omitempty" json:"forwarders,omitempty"` + Forwarders []*string `yaml:"forwarders,omitempty" json:"forwarders,omitempty"` // Metrics-generator config // +kubebuilder:validation:Optional @@ -48,23 +48,23 @@ type TempoLimits struct { // +kubebuilder:validation:Optional MetricsGeneratorForwarderWorkers *int `yaml:"metrics_generator_forwarder_workers,omitempty" json:"metrics_generator_forwarder_workers,omitempty"` // +kubebuilder:validation:Optional - MetricsGeneratorProcessorServiceGraphsHistogramBuckets []float64 `yaml:"metrics_generator_processor_service_graphs_histogram_buckets,omitempty" json:"metrics_generator_processor_service_graphs_histogram_buckets,omitempty"` + MetricsGeneratorProcessorServiceGraphsHistogramBuckets []*float64 `yaml:"metrics_generator_processor_service_graphs_histogram_buckets,omitempty" json:"metrics_generator_processor_service_graphs_histogram_buckets,omitempty"` // +kubebuilder:validation:Optional - MetricsGeneratorProcessorServiceGraphsDimensions []string `yaml:"metrics_generator_processor_service_graphs_dimensions,omitempty" json:"metrics_generator_processor_service_graphs_dimensions,omitempty"` + MetricsGeneratorProcessorServiceGraphsDimensions []*string `yaml:"metrics_generator_processor_service_graphs_dimensions,omitempty" json:"metrics_generator_processor_service_graphs_dimensions,omitempty"` // +kubebuilder:validation:Optional - MetricsGeneratorProcessorServiceGraphsPeerAttributes []string `yaml:"metrics_generator_processor_service_graphs_peer_attributes,omitempty" json:"metrics_generator_processor_service_graphs_peer_attributes,omitempty"` + MetricsGeneratorProcessorServiceGraphsPeerAttributes []*string `yaml:"metrics_generator_processor_service_graphs_peer_attributes,omitempty" json:"metrics_generator_processor_service_graphs_peer_attributes,omitempty"` // +kubebuilder:validation:Optional MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix *bool `yaml:"metrics_generator_processor_service_graphs_enable_client_server_prefix,omitempty" json:"metrics_generator_processor_service_graphs_enable_client_server_prefix,omitempty"` // +kubebuilder:validation:Optional - MetricsGeneratorProcessorSpanMetricsHistogramBuckets []float64 `yaml:"metrics_generator_processor_span_metrics_histogram_buckets,omitempty" json:"metrics_generator_processor_span_metrics_histogram_buckets,omitempty"` + MetricsGeneratorProcessorSpanMetricsHistogramBuckets []*float64 `yaml:"metrics_generator_processor_span_metrics_histogram_buckets,omitempty" json:"metrics_generator_processor_span_metrics_histogram_buckets,omitempty"` // +kubebuilder:validation:Optional - MetricsGeneratorProcessorSpanMetricsDimensions []string `yaml:"metrics_generator_processor_span_metrics_dimensions,omitempty" json:"metrics_generator_processor_span_metrics_dimensions,omitempty"` + MetricsGeneratorProcessorSpanMetricsDimensions []*string `yaml:"metrics_generator_processor_span_metrics_dimensions,omitempty" json:"metrics_generator_processor_span_metrics_dimensions,omitempty"` // +kubebuilder:validation:Optional MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions map[string]bool `yaml:"metrics_generator_processor_span_metrics_intrinsic_dimensions,omitempty" json:"metrics_generator_processor_span_metrics_intrinsic_dimensions,omitempty"` // +kubebuilder:validation:Optional - MetricsGeneratorProcessorSpanMetricsFilterPolicies []FilterPolicy `yaml:"metrics_generator_processor_span_metrics_filter_policies,omitempty" json:"metrics_generator_processor_span_metrics_filter_policies,omitempty"` + MetricsGeneratorProcessorSpanMetricsFilterPolicies []*FilterPolicy `yaml:"metrics_generator_processor_span_metrics_filter_policies,omitempty" json:"metrics_generator_processor_span_metrics_filter_policies,omitempty"` // +kubebuilder:validation:Optional - MetricsGeneratorProcessorSpanMetricsDimensionMappings []DimensionMappings `yaml:"metrics_generator_processor_span_metrics_dimension_mappings,omitempty" json:"metrics_generator_processor_span_metrics_dimension_mapings,omitempty"` + MetricsGeneratorProcessorSpanMetricsDimensionMappings []*DimensionMappings `yaml:"metrics_generator_processor_span_metrics_dimension_mappings,omitempty" json:"metrics_generator_processor_span_metrics_dimension_mapings,omitempty"` // +kubebuilder:validation:Optional MetricsGeneratorProcessorSpanMetricsEnableTargetInfo *bool `yaml:"metrics_generator_processor_span_metrics_enable_target_info,omitempty" json:"metrics_generator_processor_span_metrics_enable_target_info,omitempty"` // +kubebuilder:validation:Optional @@ -165,9 +165,9 @@ func (e MatchType) MarshalGQL(w io.Writer) { type PolicyMatch struct { // +kubebuilder:validation:Optional // +kubebuilder:validation:Enum=strict;regex - MatchType MatchType `yaml:"match_type,omitempty" json:"match_type,omitempty"` + MatchType *MatchType `yaml:"match_type,omitempty" json:"match_type,omitempty"` // +kubebuilder:validation:Optional - Attributes []MatchPolicyAttribute `yaml:"attributes,omitempty" json:"attributes,omitempty"` + Attributes []*MatchPolicyAttribute `yaml:"attributes,omitempty" json:"attributes,omitempty"` } type MatchPolicyAttribute struct { @@ -178,7 +178,7 @@ type MatchPolicyAttribute struct { // +kubebuilder:pruning:PreserveUnknownFields // +kubebuilder:validation:Schemaless // +kubebuilder:validation:Type=object - Value WrappedMap `yaml:"value,omitempty" json:"value,omitempty"` + Value *WrappedMap `yaml:"value,omitempty" json:"value,omitempty"` } type WrappedMap struct { @@ -238,7 +238,7 @@ type DimensionMappings struct { // +kubebuilder:validation:Optional Name *string `yaml:"name,omitempty" json:"name,omitempty"` // +kubebuilder:validation:Optional - SourceLabel []string `yaml:"source_labels,omitempty" json:"source_labels,omitempty"` + SourceLabel []*string `yaml:"source_labels,omitempty" json:"source_labels,omitempty"` // +kubebuilder:validation:Optional Join *string `yaml:"join,omitempty" json:"join,omitempty"` } diff --git a/api/observability/v1alpha1/zz_generated.deepcopy.go b/api/observability/v1alpha1/zz_generated.deepcopy.go index 80bb35f..2738588 100644 --- a/api/observability/v1alpha1/zz_generated.deepcopy.go +++ b/api/observability/v1alpha1/zz_generated.deepcopy.go @@ -211,8 +211,14 @@ func (in *DimensionMappings) DeepCopyInto(out *DimensionMappings) { } if in.SourceLabel != nil { in, out := &in.SourceLabel, &out.SourceLabel - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } if in.Join != nil { in, out := &in.Join, &out.Join @@ -1061,7 +1067,10 @@ func (in *MatchPolicyAttribute) DeepCopyInto(out *MatchPolicyAttribute) { *out = new(string) **out = **in } - in.Value.DeepCopyInto(&out.Value) + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = (*in).DeepCopy() + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MatchPolicyAttribute. @@ -2284,11 +2293,20 @@ func (in *OAuth2) DeepCopy() *OAuth2 { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PolicyMatch) DeepCopyInto(out *PolicyMatch) { *out = *in + if in.MatchType != nil { + in, out := &in.MatchType, &out.MatchType + *out = new(MatchType) + **out = **in + } if in.Attributes != nil { in, out := &in.Attributes, &out.Attributes - *out = make([]MatchPolicyAttribute, len(*in)) + *out = make([]*MatchPolicyAttribute, len(*in)) for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(MatchPolicyAttribute) + (*in).DeepCopyInto(*out) + } } } } @@ -2718,8 +2736,14 @@ func (in *TempoLimits) DeepCopyInto(out *TempoLimits) { } if in.Forwarders != nil { in, out := &in.Forwarders, &out.Forwarders - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } if in.MetricsGeneratorRingSize != nil { in, out := &in.MetricsGeneratorRingSize, &out.MetricsGeneratorRingSize @@ -2764,18 +2788,36 @@ func (in *TempoLimits) DeepCopyInto(out *TempoLimits) { } if in.MetricsGeneratorProcessorServiceGraphsHistogramBuckets != nil { in, out := &in.MetricsGeneratorProcessorServiceGraphsHistogramBuckets, &out.MetricsGeneratorProcessorServiceGraphsHistogramBuckets - *out = make([]float64, len(*in)) - copy(*out, *in) + *out = make([]*float64, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(float64) + **out = **in + } + } } if in.MetricsGeneratorProcessorServiceGraphsDimensions != nil { in, out := &in.MetricsGeneratorProcessorServiceGraphsDimensions, &out.MetricsGeneratorProcessorServiceGraphsDimensions - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } if in.MetricsGeneratorProcessorServiceGraphsPeerAttributes != nil { in, out := &in.MetricsGeneratorProcessorServiceGraphsPeerAttributes, &out.MetricsGeneratorProcessorServiceGraphsPeerAttributes - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } if in.MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix != nil { in, out := &in.MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix, &out.MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix @@ -2784,13 +2826,25 @@ func (in *TempoLimits) DeepCopyInto(out *TempoLimits) { } if in.MetricsGeneratorProcessorSpanMetricsHistogramBuckets != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsHistogramBuckets, &out.MetricsGeneratorProcessorSpanMetricsHistogramBuckets - *out = make([]float64, len(*in)) - copy(*out, *in) + *out = make([]*float64, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(float64) + **out = **in + } + } } if in.MetricsGeneratorProcessorSpanMetricsDimensions != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsDimensions, &out.MetricsGeneratorProcessorSpanMetricsDimensions - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } if in.MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions, &out.MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions @@ -2801,16 +2855,24 @@ func (in *TempoLimits) DeepCopyInto(out *TempoLimits) { } if in.MetricsGeneratorProcessorSpanMetricsFilterPolicies != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsFilterPolicies, &out.MetricsGeneratorProcessorSpanMetricsFilterPolicies - *out = make([]FilterPolicy, len(*in)) + *out = make([]*FilterPolicy, len(*in)) for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(FilterPolicy) + (*in).DeepCopyInto(*out) + } } } if in.MetricsGeneratorProcessorSpanMetricsDimensionMappings != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsDimensionMappings, &out.MetricsGeneratorProcessorSpanMetricsDimensionMappings - *out = make([]DimensionMappings, len(*in)) + *out = make([]*DimensionMappings, len(*in)) for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(DimensionMappings) + (*in).DeepCopyInto(*out) + } } } if in.MetricsGeneratorProcessorSpanMetricsEnableTargetInfo != nil { @@ -2915,8 +2977,14 @@ func (in *TempoLimitsInput) DeepCopyInto(out *TempoLimitsInput) { } if in.Forwarders != nil { in, out := &in.Forwarders, &out.Forwarders - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } if in.MetricsGeneratorRingSize != nil { in, out := &in.MetricsGeneratorRingSize, &out.MetricsGeneratorRingSize @@ -2961,18 +3029,36 @@ func (in *TempoLimitsInput) DeepCopyInto(out *TempoLimitsInput) { } if in.MetricsGeneratorProcessorServiceGraphsHistogramBuckets != nil { in, out := &in.MetricsGeneratorProcessorServiceGraphsHistogramBuckets, &out.MetricsGeneratorProcessorServiceGraphsHistogramBuckets - *out = make([]float64, len(*in)) - copy(*out, *in) + *out = make([]*float64, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(float64) + **out = **in + } + } } if in.MetricsGeneratorProcessorServiceGraphsDimensions != nil { in, out := &in.MetricsGeneratorProcessorServiceGraphsDimensions, &out.MetricsGeneratorProcessorServiceGraphsDimensions - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } if in.MetricsGeneratorProcessorServiceGraphsPeerAttributes != nil { in, out := &in.MetricsGeneratorProcessorServiceGraphsPeerAttributes, &out.MetricsGeneratorProcessorServiceGraphsPeerAttributes - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } if in.MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix != nil { in, out := &in.MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix, &out.MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix @@ -2981,13 +3067,25 @@ func (in *TempoLimitsInput) DeepCopyInto(out *TempoLimitsInput) { } if in.MetricsGeneratorProcessorSpanMetricsHistogramBuckets != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsHistogramBuckets, &out.MetricsGeneratorProcessorSpanMetricsHistogramBuckets - *out = make([]float64, len(*in)) - copy(*out, *in) + *out = make([]*float64, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(float64) + **out = **in + } + } } if in.MetricsGeneratorProcessorSpanMetricsDimensions != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsDimensions, &out.MetricsGeneratorProcessorSpanMetricsDimensions - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } if in.MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions, &out.MetricsGeneratorProcessorSpanMetricsIntrinsicDimensions @@ -2998,16 +3096,24 @@ func (in *TempoLimitsInput) DeepCopyInto(out *TempoLimitsInput) { } if in.MetricsGeneratorProcessorSpanMetricsFilterPolicies != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsFilterPolicies, &out.MetricsGeneratorProcessorSpanMetricsFilterPolicies - *out = make([]FilterPolicy, len(*in)) + *out = make([]*FilterPolicy, len(*in)) for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(FilterPolicy) + (*in).DeepCopyInto(*out) + } } } if in.MetricsGeneratorProcessorSpanMetricsDimensionMappings != nil { in, out := &in.MetricsGeneratorProcessorSpanMetricsDimensionMappings, &out.MetricsGeneratorProcessorSpanMetricsDimensionMappings - *out = make([]DimensionMappings, len(*in)) + *out = make([]*DimensionMappings, len(*in)) for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(DimensionMappings) + (*in).DeepCopyInto(*out) + } } } if in.MetricsGeneratorProcessorSpanMetricsEnableTargetInfo != nil {