Skip to content

Commit

Permalink
Remove v1alpha2 shared types file
Browse files Browse the repository at this point in the history
  • Loading branch information
bjee19 committed Jan 8, 2025
1 parent b62fb4c commit 62a2ab6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 103 deletions.
4 changes: 3 additions & 1 deletion apis/v1alpha2/observabilitypolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"

ngfAPIv1alpha1 "github.com/nginxinc/nginx-gateway-fabric/apis/v1alpha1"
)

// +genclient
Expand Down Expand Up @@ -100,7 +102,7 @@ type Tracing struct {
// +listType=map
// +listMapKey=key
// +kubebuilder:validation:MaxItems=64
SpanAttributes []SpanAttribute `json:"spanAttributes,omitempty"`
SpanAttributes []ngfAPIv1alpha1.SpanAttribute `json:"spanAttributes,omitempty"`
}

// TraceStrategy defines the tracing strategy.
Expand Down
28 changes: 0 additions & 28 deletions apis/v1alpha2/shared_types.go

This file was deleted.

18 changes: 2 additions & 16 deletions apis/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func TestGenerate(t *testing.T) {
policy: &ngfAPIv1alpha2.ObservabilityPolicy{
Spec: ngfAPIv1alpha2.ObservabilityPolicySpec{
Tracing: &ngfAPIv1alpha2.Tracing{
SpanAttributes: []ngfAPIv1alpha2.SpanAttribute{
SpanAttributes: []ngfAPIv1alpha1.SpanAttribute{
{Key: "test-key", Value: "test-value"},
},
},
Expand Down Expand Up @@ -212,7 +212,7 @@ func TestGenerate(t *testing.T) {
Strategy: ngfAPIv1alpha2.TraceStrategyRatio,
Context: context,
SpanName: spanName,
SpanAttributes: []ngfAPIv1alpha2.SpanAttribute{
SpanAttributes: []ngfAPIv1alpha1.SpanAttribute{
{Key: "test-key", Value: "test-value"},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
"sigs.k8s.io/gateway-api/apis/v1alpha2"

ngfAPIv1alpha1 "github.com/nginxinc/nginx-gateway-fabric/apis/v1alpha1"
ngfAPIv1alpha2 "github.com/nginxinc/nginx-gateway-fabric/apis/v1alpha2"
"github.com/nginxinc/nginx-gateway-fabric/internal/framework/conditions"
"github.com/nginxinc/nginx-gateway-fabric/internal/framework/helpers"
Expand Down Expand Up @@ -38,7 +39,7 @@ func createValidPolicy() *ngfAPIv1alpha2.ObservabilityPolicy {
Strategy: ngfAPIv1alpha2.TraceStrategyRatio,
Context: helpers.GetPointer(ngfAPIv1alpha2.TraceContextExtract),
SpanName: helpers.GetPointer("spanName"),
SpanAttributes: []ngfAPIv1alpha2.SpanAttribute{
SpanAttributes: []ngfAPIv1alpha1.SpanAttribute{
{Key: "key", Value: "value"},
},
},
Expand Down
58 changes: 3 additions & 55 deletions site/content/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,8 @@ and the status of the SnippetsFilter with respect to each controller.</p>
<p>
(<em>Appears on: </em>
<a href="#gateway.nginx.org/v1alpha1.Telemetry">Telemetry</a>,
<a href="#gateway.nginx.org/v1alpha1.Tracing">Tracing</a>)
<a href="#gateway.nginx.org/v1alpha1.Tracing">Tracing</a>,
<a href="#gateway.nginx.org/v1alpha2.Tracing">Tracing</a>)
</p>
<p>
<p>SpanAttribute is a key value pair to be added to a tracing span.</p>
Expand Down Expand Up @@ -2419,15 +2420,6 @@ sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus
</tr>
</tbody>
</table>
<h3 id="gateway.nginx.org/v1alpha2.Duration">Duration
(<code>string</code> alias)</p><a class="headerlink" href="#gateway.nginx.org%2fv1alpha2.Duration" title="Permanent link">¶</a>
</h3>
<p>
<p>Duration is a string value representing a duration in time.
Duration can be specified in milliseconds (ms), seconds (s), minutes (m), hours (h).
A value without a suffix is seconds.
Examples: 120s, 50ms, 5m, 1h.</p>
</p>
<h3 id="gateway.nginx.org/v1alpha2.ObservabilityPolicySpec">ObservabilityPolicySpec
<a class="headerlink" href="#gateway.nginx.org%2fv1alpha2.ObservabilityPolicySpec" title="Permanent link">¶</a>
</h3>
Expand Down Expand Up @@ -2479,50 +2471,6 @@ be unique across all targetRef entries in the ObservabilityPolicy.</p>
</tr>
</tbody>
</table>
<h3 id="gateway.nginx.org/v1alpha2.SpanAttribute">SpanAttribute
<a class="headerlink" href="#gateway.nginx.org%2fv1alpha2.SpanAttribute" title="Permanent link">¶</a>
</h3>
<p>
(<em>Appears on: </em>
<a href="#gateway.nginx.org/v1alpha2.Tracing">Tracing</a>)
</p>
<p>
<p>SpanAttribute is a key value pair to be added to a tracing span.</p>
</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>key</code><br/>
<em>
string
</em>
</td>
<td>
<p>Key is the key for a span attribute.
Format: must have all &lsquo;&ldquo;&rsquo; escaped and must not contain any &lsquo;$&rsquo; or end with an unescaped &lsquo;\&rsquo;</p>
</td>
</tr>
<tr>
<td>
<code>value</code><br/>
<em>
string
</em>
</td>
<td>
<p>Value is the value for a span attribute.
Format: must have all &lsquo;&ldquo;&rsquo; escaped and must not contain any &lsquo;$&rsquo; or end with an unescaped &lsquo;\&rsquo;</p>
</td>
</tr>
</tbody>
</table>
<h3 id="gateway.nginx.org/v1alpha2.TraceContext">TraceContext
(<code>string</code> alias)</p><a class="headerlink" href="#gateway.nginx.org%2fv1alpha2.TraceContext" title="Permanent link">¶</a>
</h3>
Expand Down Expand Up @@ -2659,7 +2607,7 @@ Examples of invalid names: some-$value, quoted-&ldquo;value&rdquo;-name, unescap
<td>
<code>spanAttributes</code><br/>
<em>
<a href="#gateway.nginx.org/v1alpha2.SpanAttribute">
<a href="#gateway.nginx.org/v1alpha1.SpanAttribute">
[]SpanAttribute
</a>
</em>
Expand Down

0 comments on commit 62a2ab6

Please sign in to comment.