Skip to content

Commit 62a2ab6

Browse files
committed
Remove v1alpha2 shared types file
1 parent b62fb4c commit 62a2ab6

File tree

6 files changed

+12
-103
lines changed

6 files changed

+12
-103
lines changed

apis/v1alpha2/observabilitypolicy_types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package v1alpha2
33
import (
44
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
55
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
6+
7+
ngfAPIv1alpha1 "github.com/nginxinc/nginx-gateway-fabric/apis/v1alpha1"
68
)
79

810
// +genclient
@@ -100,7 +102,7 @@ type Tracing struct {
100102
// +listType=map
101103
// +listMapKey=key
102104
// +kubebuilder:validation:MaxItems=64
103-
SpanAttributes []SpanAttribute `json:"spanAttributes,omitempty"`
105+
SpanAttributes []ngfAPIv1alpha1.SpanAttribute `json:"spanAttributes,omitempty"`
104106
}
105107

106108
// TraceStrategy defines the tracing strategy.

apis/v1alpha2/shared_types.go

Lines changed: 0 additions & 28 deletions
This file was deleted.

apis/v1alpha2/zz_generated.deepcopy.go

Lines changed: 2 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/mode/static/nginx/config/policies/observability/generator_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func TestGenerate(t *testing.T) {
162162
policy: &ngfAPIv1alpha2.ObservabilityPolicy{
163163
Spec: ngfAPIv1alpha2.ObservabilityPolicySpec{
164164
Tracing: &ngfAPIv1alpha2.Tracing{
165-
SpanAttributes: []ngfAPIv1alpha2.SpanAttribute{
165+
SpanAttributes: []ngfAPIv1alpha1.SpanAttribute{
166166
{Key: "test-key", Value: "test-value"},
167167
},
168168
},
@@ -212,7 +212,7 @@ func TestGenerate(t *testing.T) {
212212
Strategy: ngfAPIv1alpha2.TraceStrategyRatio,
213213
Context: context,
214214
SpanName: spanName,
215-
SpanAttributes: []ngfAPIv1alpha2.SpanAttribute{
215+
SpanAttributes: []ngfAPIv1alpha1.SpanAttribute{
216216
{Key: "test-key", Value: "test-value"},
217217
},
218218
},

internal/mode/static/nginx/config/policies/observability/validator_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
99
"sigs.k8s.io/gateway-api/apis/v1alpha2"
1010

11+
ngfAPIv1alpha1 "github.com/nginxinc/nginx-gateway-fabric/apis/v1alpha1"
1112
ngfAPIv1alpha2 "github.com/nginxinc/nginx-gateway-fabric/apis/v1alpha2"
1213
"github.com/nginxinc/nginx-gateway-fabric/internal/framework/conditions"
1314
"github.com/nginxinc/nginx-gateway-fabric/internal/framework/helpers"
@@ -38,7 +39,7 @@ func createValidPolicy() *ngfAPIv1alpha2.ObservabilityPolicy {
3839
Strategy: ngfAPIv1alpha2.TraceStrategyRatio,
3940
Context: helpers.GetPointer(ngfAPIv1alpha2.TraceContextExtract),
4041
SpanName: helpers.GetPointer("spanName"),
41-
SpanAttributes: []ngfAPIv1alpha2.SpanAttribute{
42+
SpanAttributes: []ngfAPIv1alpha1.SpanAttribute{
4243
{Key: "key", Value: "value"},
4344
},
4445
},

site/content/reference/api.md

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,8 @@ and the status of the SnippetsFilter with respect to each controller.</p>
18291829
<p>
18301830
(<em>Appears on: </em>
18311831
<a href="#gateway.nginx.org/v1alpha1.Telemetry">Telemetry</a>,
1832-
<a href="#gateway.nginx.org/v1alpha1.Tracing">Tracing</a>)
1832+
<a href="#gateway.nginx.org/v1alpha1.Tracing">Tracing</a>,
1833+
<a href="#gateway.nginx.org/v1alpha2.Tracing">Tracing</a>)
18331834
</p>
18341835
<p>
18351836
<p>SpanAttribute is a key value pair to be added to a tracing span.</p>
@@ -2419,15 +2420,6 @@ sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus
24192420
</tr>
24202421
</tbody>
24212422
</table>
2422-
<h3 id="gateway.nginx.org/v1alpha2.Duration">Duration
2423-
(<code>string</code> alias)</p><a class="headerlink" href="#gateway.nginx.org%2fv1alpha2.Duration" title="Permanent link">¶</a>
2424-
</h3>
2425-
<p>
2426-
<p>Duration is a string value representing a duration in time.
2427-
Duration can be specified in milliseconds (ms), seconds (s), minutes (m), hours (h).
2428-
A value without a suffix is seconds.
2429-
Examples: 120s, 50ms, 5m, 1h.</p>
2430-
</p>
24312423
<h3 id="gateway.nginx.org/v1alpha2.ObservabilityPolicySpec">ObservabilityPolicySpec
24322424
<a class="headerlink" href="#gateway.nginx.org%2fv1alpha2.ObservabilityPolicySpec" title="Permanent link">¶</a>
24332425
</h3>
@@ -2479,50 +2471,6 @@ be unique across all targetRef entries in the ObservabilityPolicy.</p>
24792471
</tr>
24802472
</tbody>
24812473
</table>
2482-
<h3 id="gateway.nginx.org/v1alpha2.SpanAttribute">SpanAttribute
2483-
<a class="headerlink" href="#gateway.nginx.org%2fv1alpha2.SpanAttribute" title="Permanent link">¶</a>
2484-
</h3>
2485-
<p>
2486-
(<em>Appears on: </em>
2487-
<a href="#gateway.nginx.org/v1alpha2.Tracing">Tracing</a>)
2488-
</p>
2489-
<p>
2490-
<p>SpanAttribute is a key value pair to be added to a tracing span.</p>
2491-
</p>
2492-
<table class="table table-bordered table-striped">
2493-
<thead>
2494-
<tr>
2495-
<th>Field</th>
2496-
<th>Description</th>
2497-
</tr>
2498-
</thead>
2499-
<tbody>
2500-
<tr>
2501-
<td>
2502-
<code>key</code><br/>
2503-
<em>
2504-
string
2505-
</em>
2506-
</td>
2507-
<td>
2508-
<p>Key is the key for a span attribute.
2509-
Format: must have all &lsquo;&ldquo;&rsquo; escaped and must not contain any &lsquo;$&rsquo; or end with an unescaped &lsquo;\&rsquo;</p>
2510-
</td>
2511-
</tr>
2512-
<tr>
2513-
<td>
2514-
<code>value</code><br/>
2515-
<em>
2516-
string
2517-
</em>
2518-
</td>
2519-
<td>
2520-
<p>Value is the value for a span attribute.
2521-
Format: must have all &lsquo;&ldquo;&rsquo; escaped and must not contain any &lsquo;$&rsquo; or end with an unescaped &lsquo;\&rsquo;</p>
2522-
</td>
2523-
</tr>
2524-
</tbody>
2525-
</table>
25262474
<h3 id="gateway.nginx.org/v1alpha2.TraceContext">TraceContext
25272475
(<code>string</code> alias)</p><a class="headerlink" href="#gateway.nginx.org%2fv1alpha2.TraceContext" title="Permanent link">¶</a>
25282476
</h3>
@@ -2659,7 +2607,7 @@ Examples of invalid names: some-$value, quoted-&ldquo;value&rdquo;-name, unescap
26592607
<td>
26602608
<code>spanAttributes</code><br/>
26612609
<em>
2662-
<a href="#gateway.nginx.org/v1alpha2.SpanAttribute">
2610+
<a href="#gateway.nginx.org/v1alpha1.SpanAttribute">
26632611
[]SpanAttribute
26642612
</a>
26652613
</em>

0 commit comments

Comments
 (0)