Skip to content

Commit

Permalink
Remove deprecated funcs in featuregate. (open-telemetry#7173)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored and pull[bot] committed Nov 22, 2023
1 parent 482ece0 commit c135a4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 43 deletions.
11 changes: 11 additions & 0 deletions .chloggen/rmdepfeaturegate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: featuregate

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated funcs in featuregate.

# One or more tracking issues or pull requests related to the change
issues: [7173]
43 changes: 0 additions & 43 deletions featuregate/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ func NewRegistry() *Registry {
return &Registry{}
}

// Deprecated: [v0.71.0] use RegisterOption.
type RegistryOption = RegisterOption

// RegisterOption allows to configure additional information about a Gate during registration.
type RegisterOption interface {
apply(g *Gate)
Expand Down Expand Up @@ -74,26 +71,6 @@ func WithRegisterRemovalVersion(version string) RegisterOption {
})
}

// Deprecated: [v0.71.0] use Set.
func (r *Registry) Apply(cfg map[string]bool) error {
for id, enabled := range cfg {
if err := r.Set(id, enabled); err != nil {
return err
}
}
return nil
}

// Deprecated: [v0.71.0] check the enable status on the returned Gate from Register or MustRegister.
func (r *Registry) IsEnabled(id string) bool {
v, ok := r.gates.Load(id)
if !ok {
return false
}
g := v.(*Gate)
return g.IsEnabled()
}

// MustRegister like Register but panics if an invalid ID or gate options are provided.
func (r *Registry) MustRegister(id string, stage Stage, opts ...RegisterOption) *Gate {
g, err := r.Register(id, stage, opts...)
Expand Down Expand Up @@ -129,17 +106,6 @@ func (r *Registry) Register(id string, stage Stage, opts ...RegisterOption) (*Ga
return g, nil
}

// Deprecated: [v0.71.0] use MustRegister.
func (r *Registry) MustRegisterID(id string, stage Stage, opts ...RegisterOption) {
r.MustRegister(id, stage, opts...)
}

// Deprecated: [v0.71.0] use Register.
func (r *Registry) RegisterID(id string, stage Stage, opts ...RegisterOption) error {
_, err := r.Register(id, stage, opts...)
return err
}

// Set the enabled valued for a Gate identified by the given id.
func (r *Registry) Set(id string, enabled bool) error {
v, ok := r.gates.Load(id)
Expand Down Expand Up @@ -168,12 +134,3 @@ func (r *Registry) VisitAll(fn func(*Gate)) {
fn(gates[i])
}
}

// Deprecated: [v0.71.0] use VisitAll.
func (r *Registry) List() []Gate {
var ret []Gate
r.VisitAll(func(gate *Gate) {
ret = append(ret, *gate)
})
return ret
}

0 comments on commit c135a4a

Please sign in to comment.