Skip to content

Commit 81c1455

Browse files
authored
Merge branch 'main' into tests/functional-ginkgo
2 parents f58f38d + 1157c45 commit 81c1455

21 files changed

+844
-87
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- 5000:5000
3636
steps:
3737
- name: Checkout Repository
38-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
38+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
3939
with:
4040
ref: ${{ inputs.tag != '' && format('refs/tags/v{0}', inputs.tag) || github.ref }}
4141

@@ -160,7 +160,7 @@ jobs:
160160
if: always()
161161

162162
- name: Upload Scan Results
163-
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
163+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
164164
continue-on-error: true
165165
with:
166166
name: scan-results-${{ inputs.image }}

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
min_k8s_version: ${{ steps.vars.outputs.min_k8s_version }}
3232
steps:
3333
- name: Checkout Repository
34-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
34+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
3535

3636
- name: Setup Golang Environment
3737
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
@@ -62,7 +62,7 @@ jobs:
6262
needs: vars
6363
steps:
6464
- name: Checkout Repository
65-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
65+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
6666

6767
- name: Setup Golang Environment
6868
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
@@ -78,7 +78,7 @@ jobs:
7878
token: ${{ secrets.CODECOV_TOKEN }}
7979

8080
- name: Upload Coverage Report
81-
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
81+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
8282
with:
8383
name: cover-${{ github.run_id }}.html
8484
path: ${{ github.workspace }}/cover.html
@@ -90,7 +90,7 @@ jobs:
9090
needs: vars
9191
steps:
9292
- name: Checkout Repository
93-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
93+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
9494

9595
- name: Setup Node.js Environment
9696
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
@@ -115,7 +115,7 @@ jobs:
115115
issues: write # for goreleaser/goreleaser-action to close milestone
116116
steps:
117117
- name: Checkout Repository
118-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
118+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
119119
with:
120120
fetch-depth: 0
121121

@@ -236,7 +236,7 @@ jobs:
236236
needs: [vars, build-oss]
237237
steps:
238238
- name: Checkout Repository
239-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
239+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
240240

241241
- name: Fetch Cached Artifacts
242242
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
@@ -333,7 +333,7 @@ jobs:
333333
packages: write # for helm to push to GHCR
334334
steps:
335335
- name: Checkout Repository
336-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
336+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
337337

338338
- name: Login to GitHub Container Registry
339339
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
steps:
4242
- name: Checkout repository
43-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
43+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
4444

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL

.github/workflows/conformance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
contents: write # needed for uploading release artifacts
2929
steps:
3030
- name: Checkout Repository
31-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
31+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
3232

3333
- name: Fetch Cached Artifacts
3434
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
pull-requests: write
1313
steps:
1414
- name: "Checkout Repository"
15-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
15+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
1616

1717
- name: "Dependency Review"
1818
uses: actions/dependency-review-action@5bbc3ba658137598168acb2ab73b21c432dd411b # v4.2.5

.github/workflows/fossa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
if: ${{ github.event.repository.fork == false }}
2020
steps:
2121
- name: Checkout Repository
22-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
22+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
2323

2424
- name: Scan
2525
uses: fossas/fossa-action@47ef11b1e1e3812e88dae436ccbd2d0cbd1adab0 # v1.3.3

.github/workflows/functional.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-22.04
2424
steps:
2525
- name: Checkout Repository
26-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
26+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
2727

2828
- name: Setup Golang Environment
2929
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0

.github/workflows/lint.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-22.04
2424
steps:
2525
- name: Checkout Repository
26-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
26+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
2727

2828
- name: Setup Golang Environment
2929
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
@@ -42,7 +42,7 @@ jobs:
4242
runs-on: ubuntu-22.04
4343
steps:
4444
- name: Checkout Repository
45-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
45+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
4646

4747
- name: Get Prettier version
4848
id: prettier-version
@@ -75,7 +75,7 @@ jobs:
7575
runs-on: ubuntu-22.04
7676
steps:
7777
- name: Checkout Repository
78-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
78+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
7979

8080
- uses: reviewdog/action-actionlint@9d8b58041eed1373f173e91b9a3db5a844197236 # v1.44.0
8181
with:
@@ -86,7 +86,7 @@ jobs:
8686
runs-on: ubuntu-22.04
8787
steps:
8888
- name: Checkout Repository
89-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
89+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
9090

9191
- uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0
9292
with:
@@ -98,7 +98,7 @@ jobs:
9898
runs-on: ubuntu-22.04
9999
steps:
100100
- name: Checkout Repository
101-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
101+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
102102
- name: Lint chart
103103
run: make lint-helm
104104

@@ -107,7 +107,7 @@ jobs:
107107
runs-on: ubuntu-22.04
108108
steps:
109109
- name: Checkout Repository
110-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
110+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
111111

112112
- name: Install yamllint
113113
run: pip install yamllint

.github/workflows/mend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
if: ${{ github.event.repository.fork == false }}
2525
steps:
2626
- name: Checkout Repository
27-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
27+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
2828
- name: Download agent
2929
run: curl -LJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar
3030
- name: Verify JAR

.github/workflows/nfr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
steps:
4747
- name: Checkout Repository
48-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
48+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
4949

5050
- name: Setup Golang Environment
5151
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0

.github/workflows/release-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
echo "branch=release-$version" >> $GITHUB_OUTPUT
2828
2929
- name: Checkout Repository
30-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
30+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
3131
with:
3232
ref: ${{ steps.branch.outputs.branch }}
3333

.github/workflows/scorecards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- name: "Checkout code"
32-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
32+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
3333
with:
3434
persist-credentials: false
3535

@@ -52,7 +52,7 @@ jobs:
5252
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
5353
# format to the repository Actions tab.
5454
- name: "Upload artifact"
55-
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
55+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
5656
with:
5757
name: SARIF file
5858
path: results.sarif

.github/workflows/update-docker-images.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
nginx_version: ${{ steps.nginx.outputs.nginx_version }}
2525
steps:
2626
- name: Checkout Repository
27-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
27+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
2828
with:
2929
fetch-depth: 0
3030

@@ -35,7 +35,7 @@ jobs:
3535
echo "tag=${tag//v}" >> $GITHUB_OUTPUT
3636
3737
- name: Checkout Repository at ${{ steps.ngf.outputs.tag }}
38-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
38+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
3939
with:
4040
ref: refs/tags/v${{ steps.ngf.outputs.tag }}
4141

apis/v1alpha1/nginxproxy_types.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,3 @@ type TelemetryExporter struct {
8888
// +kubebuilder:validation:Pattern=`^(?:http?:\/\/)?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*(?::\d{1,5})?$`
8989
Endpoint string `json:"endpoint"`
9090
}
91-
92-
// SpanAttribute is a key value pair to be added to a tracing span.
93-
type SpanAttribute struct {
94-
// Key is the key for a span attribute.
95-
//
96-
// +kubebuilder:validation:MinLength=1
97-
// +kubebuilder:validation:MaxLength=255
98-
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9_-]+$`
99-
Key string `json:"key"`
100-
101-
// Value is the value for a span attribute.
102-
//
103-
// +kubebuilder:validation:MinLength=1
104-
// +kubebuilder:validation:MaxLength=255
105-
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9_-]+$`
106-
Value string `json:"value"`
107-
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
package v1alpha1
2+
3+
import (
4+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5+
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
6+
)
7+
8+
// +kubebuilder:object:root=true
9+
// +kubebuilder:storageversion
10+
// +kubebuilder:subresource:status
11+
// +kubebuilder:resource:categories=nginx-gateway-fabric,scope=Namespaced
12+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
13+
// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=direct"
14+
15+
// ObservabilityPolicy is a Direct Attached Policy. It provides a way to configure observability settings for
16+
// the NGINX Gateway Fabric data plane. Used in conjunction with the NginxProxy CRD that is attached to the
17+
// GatewayClass parametersRef.
18+
type ObservabilityPolicy struct {
19+
metav1.TypeMeta `json:",inline"`
20+
metav1.ObjectMeta `json:"metadata,omitempty"`
21+
22+
// Spec defines the desired state of the ObservabilityPolicy.
23+
Spec ObservabilityPolicySpec `json:"spec"`
24+
25+
// Status defines the state of the ObservabilityPolicy.
26+
Status gatewayv1alpha2.PolicyStatus `json:"status,omitempty"`
27+
}
28+
29+
// +kubebuilder:object:root=true
30+
31+
// ObservabilityPolicyList contains a list of ObservabilityPolicies.
32+
type ObservabilityPolicyList struct {
33+
metav1.TypeMeta `json:",inline"`
34+
metav1.ListMeta `json:"metadata,omitempty"`
35+
Items []ObservabilityPolicy `json:"items"`
36+
}
37+
38+
// ObservabilityPolicySpec defines the desired state of the ObservabilityPolicy.
39+
type ObservabilityPolicySpec struct {
40+
// TargetRef identifies an API object to apply the policy to.
41+
// Object must be in the same namespace as the policy.
42+
//
43+
// Support: HTTPRoute
44+
TargetRef gatewayv1alpha2.PolicyTargetReference `json:"targetRef"`
45+
46+
// Tracing allows for enabling and configuring tracing.
47+
//
48+
// +optional
49+
Tracing *Tracing `json:"tracing,omitempty"`
50+
}
51+
52+
// Tracing allows for enabling and configuring OpenTelemetry tracing.
53+
//
54+
// +kubebuilder:validation:XValidation:message="ratio can only be specified if strategy is of type ratio",rule="!(has(self.ratio) && self.strategy != 'ratio')"
55+
//
56+
//nolint:lll
57+
type Tracing struct {
58+
// Strategy defines if tracing is ratio-based or parent-based.
59+
Strategy TraceStrategy `json:"strategy"`
60+
61+
// Ratio is the percentage of traffic that should be sampled. Integer from 0 to 100.
62+
// By default, 100% of http requests are traced. Not applicable for parent-based tracing.
63+
//
64+
// +optional
65+
// +kubebuilder:validation:Minimum=0
66+
// +kubebuilder:validation:Maximum=100
67+
Ratio *int32 `json:"ratio,omitempty"`
68+
69+
// Context specifies how to propagate traceparent/tracestate headers.
70+
// Default: https://nginx.org/en/docs/ngx_otel_module.html#otel_trace_context
71+
//
72+
// +optional
73+
Context *TraceContext `json:"context,omitempty"`
74+
75+
// SpanName defines the name of the Otel span. By default is the name of the location for a request.
76+
// If specified, applies to all locations that are created for a route.
77+
// Format: must have all '"' escaped and must not contain any '$' or end with an unescaped '\'
78+
// Examples of invalid names: some-$value, quoted-"value"-name, unescaped\
79+
//
80+
// +optional
81+
// +kubebuilder:validation:MinLength=1
82+
// +kubebuilder:validation:MaxLength=255
83+
// +kubebuilder:validation:Pattern=`^([^"$\\]|\\[^$])*$`
84+
SpanName *string `json:"spanName,omitempty"`
85+
86+
// SpanAttributes are custom key/value attributes that are added to each span.
87+
//
88+
// +optional
89+
// +listType=map
90+
// +listMapKey=key
91+
// +kubebuilder:validation:MaxItems=64
92+
SpanAttributes []SpanAttribute `json:"spanAttributes,omitempty"`
93+
}
94+
95+
// TraceStrategy defines the tracing strategy.
96+
//
97+
// +kubebuilder:validation:Enum=ratio;parent
98+
type TraceStrategy string
99+
100+
const (
101+
// TraceStrategyRatio enables ratio-based tracing, defaulting to 100% sampling rate.
102+
TraceStrategyRatio TraceStrategy = "ratio"
103+
104+
// TraceStrategyParent enables tracing and only records spans if the parent span was sampled.
105+
TraceStrategyParent TraceStrategy = "parent"
106+
)
107+
108+
// TraceContext specifies how to propagate traceparent/tracestate headers.
109+
//
110+
// +kubebuilder:validation:Enum=extract;inject;propagate;ignore
111+
type TraceContext string
112+
113+
const (
114+
// TraceContextExtract uses an existing trace context from the request, so that the identifiers
115+
// of a trace and the parent span are inherited from the incoming request.
116+
TraceContextExtract TraceContext = "extract"
117+
118+
// TraceContextInject adds a new context to the request, overwriting existing headers, if any.
119+
TraceContextInject TraceContext = "inject"
120+
121+
// TraceContextPropagate updates the existing context (combines extract and inject).
122+
TraceContextPropagate TraceContext = "propagate"
123+
124+
// TraceContextIgnore skips context headers processing.
125+
TraceContextIgnore TraceContext = "ignore"
126+
)

apis/v1alpha1/register.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
3636
&NginxGatewayList{},
3737
&NginxProxy{},
3838
&NginxProxyList{},
39+
&ObservabilityPolicy{},
40+
&ObservabilityPolicyList{},
3941
&ClientSettingsPolicy{},
4042
&ClientSettingsPolicyList{},
4143
)

0 commit comments

Comments
 (0)