Skip to content

Commit 9d55657

Browse files
committed
enable and update endpoint for telemetry for longevity tests
1 parent f56f525 commit 9d55657

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
181181
AZURE_BUCKET_NAME: ${{ secrets.AZURE_BUCKET_NAME }}
182182
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
183-
TELEMETRY_ENDPOINT: oss.edge.df.f5.com:443
183+
TELEMETRY_ENDPOINT: ${{ github.ref_type == 'branch' && github.event_name == 'push' && github.ref == 'refs/heads/release' && 'oss-dev.edge.df.f5.com:443' || 'oss.edge.df.f5.com:443' }}
184184
TELEMETRY_ENDPOINT_INSECURE: "false"
185185

186186
- name: Cache Artifacts

tests/framework/ngf.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type InstallationConfig struct {
3535
ServiceType string
3636
IsGKEInternalLB bool
3737
Plus bool
38+
Telemetry bool
3839
}
3940

4041
// InstallGatewayAPI installs the specified version of the Gateway API resources.
@@ -70,14 +71,14 @@ func InstallNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) {
7071
"--create-namespace",
7172
"--namespace", cfg.Namespace,
7273
"--wait",
73-
"--set", "nginxGateway.productTelemetry.enable=false",
7474
"--set", "nginxGateway.snippetsFilters.enable=true",
7575
}
7676
if cfg.ChartVersion != "" {
7777
args = append(args, "--version", cfg.ChartVersion)
7878
}
7979

8080
args = append(args, setImageArgs(cfg)...)
81+
args = append(args, setTelemetryArgs(cfg)...)
8182
fullArgs := append(args, extraArgs...) //nolint:gocritic
8283

8384
GinkgoWriter.Printf("Installing NGF with command: helm %v\n", strings.Join(fullArgs, " "))
@@ -136,7 +137,6 @@ func UpgradeNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) {
136137
cfg.ChartPath,
137138
"--namespace", cfg.Namespace,
138139
"--wait",
139-
"--set", "nginxGateway.productTelemetry.enable=false",
140140
"--set", "nginxGateway.config.logging.level=debug",
141141
"--set", "nginxGateway.snippetsFilter.enable=true",
142142
}
@@ -145,6 +145,7 @@ func UpgradeNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) {
145145
}
146146

147147
args = append(args, setImageArgs(cfg)...)
148+
args = append(args, setTelemetryArgs(cfg)...)
148149
fullArgs := append(args, extraArgs...) //nolint:gocritic
149150

150151
GinkgoWriter.Printf("Upgrading NGF with command: helm %v\n", strings.Join(fullArgs, " "))
@@ -188,6 +189,16 @@ func UninstallNGF(cfg InstallationConfig, k8sClient client.Client) ([]byte, erro
188189
return nil, nil
189190
}
190191

192+
func setTelemetryArgs(cfg InstallationConfig) []string {
193+
var args []string
194+
195+
args = append(args, formatValueSet("nginxGateway.productTelemetry.enable", "false")...)
196+
if cfg.Telemetry {
197+
args = append(args, formatValueSet("nginxGateway.productTelemetry.enable", "true")...)
198+
}
199+
return args
200+
}
201+
191202
func setImageArgs(cfg InstallationConfig) []string {
192203
var args []string
193204

tests/suite/system_suite_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ type setupConfig struct {
9999
deploy bool
100100
nfr bool
101101
debugLogLevel bool
102+
telemetry bool
102103
}
103104

104105
func setup(cfg setupConfig, extraInstallArgs ...string) {
@@ -151,6 +152,10 @@ func setup(cfg setupConfig, extraInstallArgs ...string) {
151152
Skip("Graceful Recovery test must be run on Kind")
152153
}
153154

155+
if clusterInfo.IsGKE && strings.Contains(GinkgoLabelFilter(), "longevity") {
156+
cfg.telemetry = true
157+
}
158+
154159
switch {
155160
case *versionUnderTest != "":
156161
version = *versionUnderTest
@@ -196,6 +201,7 @@ func createNGFInstallConfig(cfg setupConfig, extraInstallArgs ...string) framewo
196201
ServiceType: *serviceType,
197202
IsGKEInternalLB: *isGKEInternalLB,
198203
Plus: *plusEnabled,
204+
Telemetry: cfg.telemetry,
199205
}
200206

201207
// if we aren't installing from the public charts, then set the custom images

0 commit comments

Comments
 (0)