File tree Expand file tree Collapse file tree 12 files changed +105
-14
lines changed
internal/storage/v1/elasticsearch/spanstore Expand file tree Collapse file tree 12 files changed +105
-14
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
19
19
"github.com/jaegertracing/jaeger/cmd/collector/app/flags"
20
20
"github.com/jaegertracing/jaeger/cmd/internal/docs"
21
21
"github.com/jaegertracing/jaeger/cmd/internal/env"
22
+ "github.com/jaegertracing/jaeger/cmd/internal/featuregate"
22
23
cmdFlags "github.com/jaegertracing/jaeger/cmd/internal/flags"
23
24
"github.com/jaegertracing/jaeger/cmd/internal/printconfig"
24
25
"github.com/jaegertracing/jaeger/cmd/internal/status"
@@ -139,6 +140,7 @@ func main() {
139
140
command .AddCommand (docs .Command (v ))
140
141
command .AddCommand (status .Command (v , ports .CollectorAdminHTTP ))
141
142
command .AddCommand (printconfig .Command (v ))
143
+ command .AddCommand (featuregate .Command ())
142
144
143
145
config .AddFlags (
144
146
v ,
Original file line number Diff line number Diff line change 8
8
9
9
"github.com/spf13/viper"
10
10
"go.opentelemetry.io/collector/config/configtls"
11
+ "go.opentelemetry.io/collector/featuregate"
11
12
12
13
"github.com/jaegertracing/jaeger/pkg/config/tlscfg"
13
14
)
@@ -47,6 +48,7 @@ func (*Config) AddFlags(flags *flag.FlagSet) {
47
48
flags .String (username , "" , "The username required by storage" )
48
49
flags .String (password , "" , "The password required by storage" )
49
50
tlsFlagsCfg .AddFlags (flags )
51
+ featuregate .GlobalRegistry ().RegisterFlags (flags )
50
52
}
51
53
52
54
// InitFromViper initializes config from viper.Viper.
Original file line number Diff line number Diff line change 7
7
"context"
8
8
"encoding/base64"
9
9
"errors"
10
- "flag"
11
10
"fmt"
12
11
"log"
13
12
"net/http"
@@ -35,9 +34,6 @@ func init() {
35
34
featuregate .WithRegisterDescription ("Controls whether the indices will be deleted relative to the current time or tomorrow midnight." ),
36
35
featuregate .WithRegisterReferenceURL ("https://github.com/jaegertracing/jaeger/issues/6236" ),
37
36
)
38
- featureGateFlagSet := flag .NewFlagSet ("feature-gates" , flag .ExitOnError )
39
- featuregate .GlobalRegistry ().RegisterFlags (featureGateFlagSet )
40
- pflag .CommandLine .AddGoFlagSet (featureGateFlagSet )
41
37
}
42
38
43
39
func main () {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
18
18
"github.com/jaegertracing/jaeger/cmd/ingester/app/builder"
19
19
"github.com/jaegertracing/jaeger/cmd/internal/docs"
20
20
"github.com/jaegertracing/jaeger/cmd/internal/env"
21
+ "github.com/jaegertracing/jaeger/cmd/internal/featuregate"
21
22
"github.com/jaegertracing/jaeger/cmd/internal/flags"
22
23
"github.com/jaegertracing/jaeger/cmd/internal/printconfig"
23
24
"github.com/jaegertracing/jaeger/cmd/internal/status"
@@ -96,6 +97,7 @@ func main() {
96
97
command .AddCommand (docs .Command (v ))
97
98
command .AddCommand (status .Command (v , ports .IngesterAdminHTTP ))
98
99
command .AddCommand (printconfig .Command (v ))
100
+ command .AddCommand (featuregate .Command ())
99
101
100
102
config .AddFlags (
101
103
v ,
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2025 The Jaeger Authors.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ package featuregate
5
+
6
+ import (
7
+ "github.com/spf13/cobra"
8
+ "go.opentelemetry.io/collector/otelcol"
9
+ )
10
+
11
+ func Command () * cobra.Command {
12
+ return command (func () * cobra.Command {
13
+ settings := otelcol.CollectorSettings {}
14
+ return otelcol .NewCommand (settings )
15
+ })
16
+ }
17
+
18
+ func command (otelCmdFn func () * cobra.Command ) * cobra.Command {
19
+ otelCmd := otelCmdFn ()
20
+ for _ , cmd := range otelCmd .Commands () {
21
+ if cmd .Name () == "featuregate" {
22
+ otelCmd .RemoveCommand (cmd )
23
+ return cmd
24
+ }
25
+ }
26
+ panic ("could not find 'featuregate' command" )
27
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2025 The Jaeger Authors.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ package featuregate
5
+
6
+ import (
7
+ "testing"
8
+
9
+ "github.com/spf13/cobra"
10
+ "github.com/stretchr/testify/assert"
11
+ )
12
+
13
+ func TestCommand (t * testing.T ) {
14
+ cmd := Command ()
15
+ assert .Equal (t , "featuregate [feature-id]" , cmd .Use )
16
+ }
17
+
18
+ func TestCommand_Panic (t * testing.T ) {
19
+ assert .PanicsWithValue (t , "could not find 'featuregate' command" , func () {
20
+ command (func () * cobra.Command {
21
+ return & cobra.Command {}
22
+ })
23
+ })
24
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2025 The Jaeger Authors.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ package featuregate
5
+
6
+ import (
7
+ "testing"
8
+
9
+ "github.com/jaegertracing/jaeger/internal/testutils"
10
+ )
11
+
12
+ func TestMain (m * testing.M ) {
13
+ testutils .VerifyGoLeaks (m )
14
+ }
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
"syscall"
13
13
14
14
"github.com/spf13/viper"
15
+ "go.opentelemetry.io/collector/featuregate"
15
16
"go.uber.org/zap"
16
17
"go.uber.org/zap/zapgrpc"
17
18
"google.golang.org/grpc/grpclog"
@@ -87,6 +88,7 @@ func (s *Service) AddFlags(flagSet *flag.FlagSet) {
87
88
}
88
89
metricsbuilder .AddFlags (flagSet )
89
90
s .Admin .AddFlags (flagSet )
91
+ featuregate .GlobalRegistry ().RegisterFlags (flagSet )
90
92
}
91
93
92
94
// Start bootstraps the service and starts the admin server.
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import (
17
17
18
18
"github.com/jaegertracing/jaeger/cmd/internal/docs"
19
19
"github.com/jaegertracing/jaeger/cmd/internal/env"
20
+ "github.com/jaegertracing/jaeger/cmd/internal/featuregate"
20
21
"github.com/jaegertracing/jaeger/cmd/internal/flags"
21
22
"github.com/jaegertracing/jaeger/cmd/internal/printconfig"
22
23
"github.com/jaegertracing/jaeger/cmd/internal/status"
@@ -161,6 +162,7 @@ func main() {
161
162
command .AddCommand (docs .Command (v ))
162
163
command .AddCommand (status .Command (v , ports .QueryAdminHTTP ))
163
164
command .AddCommand (printconfig .Command (v ))
165
+ command .AddCommand (featuregate .Command ())
164
166
165
167
config .AddFlags (
166
168
v ,
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import (
16
16
17
17
"github.com/jaegertracing/jaeger/cmd/internal/docs"
18
18
"github.com/jaegertracing/jaeger/cmd/internal/env"
19
+ "github.com/jaegertracing/jaeger/cmd/internal/featuregate"
19
20
"github.com/jaegertracing/jaeger/cmd/internal/flags"
20
21
"github.com/jaegertracing/jaeger/cmd/internal/printconfig"
21
22
"github.com/jaegertracing/jaeger/cmd/internal/status"
@@ -101,6 +102,7 @@ func main() {
101
102
command .AddCommand (docs .Command (v ))
102
103
command .AddCommand (status .Command (v , ports .QueryAdminHTTP ))
103
104
command .AddCommand (printconfig .Command (v ))
105
+ command .AddCommand (featuregate .Command ())
104
106
105
107
config .AddFlags (
106
108
v ,
You can’t perform that action at this time.
0 commit comments