Skip to content

Commit 32dc751

Browse files
authored
Merge pull request #6399 from Algo-devops-service/relbeta4.2.1
2 parents 0c59a4f + 0c6dbbb commit 32dc751

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

.github/workflows/ci-pr.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
pull_request:
44
branches:
55
- master
6+
- 'rel/**'
67

78
env:
89
CODECOV_TOKEN: "8b4a1f91-f154-4c26-b84c-c9aaa90159c6" # Same public token from CircleCI config
@@ -11,7 +12,7 @@ env:
1112
BUILD_TYPE: integration
1213
ALGOTEST: 1
1314
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
14-
15+
1516
concurrency:
1617
group: pr-${{ github.event.pull_request.number || github.ref }}
1718
cancel-in-progress: true

buildnumber.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0
1+
1

cmd/diagcfg/telemetry.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ func maybeUpdateDataDirFromEnv() {
5555

5656
func readTelemetryConfigOrExit() logging.TelemetryConfig {
5757
maybeUpdateDataDirFromEnv()
58-
cfg, err := logging.ReadTelemetryConfigOrDefault(dataDir, "")
58+
globalDir, err := config.GetGlobalConfigFileRoot()
59+
if err != nil {
60+
fmt.Fprintf(os.Stderr, telemetryConfigReadError, err)
61+
os.Exit(1)
62+
}
63+
cfg, err := logging.ReadTelemetryConfigOrDefault(dataDir, globalDir)
5964
if err != nil {
6065
fmt.Fprintf(os.Stderr, telemetryConfigReadError, err)
6166
os.Exit(1)
@@ -112,7 +117,12 @@ var telemetryStatusCmd = &cobra.Command{
112117
Long: `Print the node's telemetry status`,
113118
Run: func(cmd *cobra.Command, args []string) {
114119
maybeUpdateDataDirFromEnv()
115-
cfg, err := logging.ReadTelemetryConfigOrDefault(dataDir, "")
120+
globalDir, err := config.GetGlobalConfigFileRoot()
121+
if err != nil {
122+
fmt.Fprintf(os.Stderr, telemetryConfigReadError, err)
123+
os.Exit(1)
124+
}
125+
cfg, err := logging.ReadTelemetryConfigOrDefault(dataDir, globalDir)
116126

117127
// If error loading config, can't disable / no need to disable
118128
if err != nil {

logging/telemetry.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func makeTelemetryStateContext(ctx context.Context, cfg TelemetryConfig, hookFac
8989
}
9090

9191
// ReadTelemetryConfigOrDefault reads telemetry config from file or defaults if no config file found.
92-
func ReadTelemetryConfigOrDefault(dataDir string, configDir string) (cfg TelemetryConfig, err error) {
92+
func ReadTelemetryConfigOrDefault(dataDir string, globalDir string) (cfg TelemetryConfig, err error) {
9393
err = nil
9494
dataDirProvided := dataDir != ""
9595
var configPath string
@@ -106,7 +106,7 @@ func ReadTelemetryConfigOrDefault(dataDir string, configDir string) (cfg Telemet
106106
// If the reason is because the directory doesn't exist or we didn't provide a data directory then...
107107
if (err != nil && os.IsNotExist(err)) || !dataDirProvided {
108108

109-
configPath = filepath.Join(configDir, TelemetryConfigFilename)
109+
configPath = filepath.Join(globalDir, TelemetryConfigFilename)
110110
cfg, err = LoadTelemetryConfig(configPath)
111111
}
112112

@@ -129,8 +129,8 @@ func ReadTelemetryConfigOrDefault(dataDir string, configDir string) (cfg Telemet
129129
// EnsureTelemetryConfig creates a new TelemetryConfig structure with a generated GUID and the appropriate Telemetry endpoint
130130
// Err will be non-nil if the file doesn't exist, or if error loading.
131131
// Cfg will always be valid.
132-
func EnsureTelemetryConfig(dataDir *string, configDir *string) (TelemetryConfig, error) {
133-
cfg, _, err := EnsureTelemetryConfigCreated(dataDir, configDir)
132+
func EnsureTelemetryConfig(dataDir *string, globalDir *string) (TelemetryConfig, error) {
133+
cfg, _, err := EnsureTelemetryConfigCreated(dataDir, globalDir)
134134
return cfg, err
135135
}
136136

0 commit comments

Comments
 (0)