mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-24 02:15:10 +00:00
Bump cel-go to v0.23.2.
This commit is contained in:
22
vendor/github.com/google/cel-go/interpreter/activation.go
generated
vendored
22
vendor/github.com/google/cel-go/interpreter/activation.go
generated
vendored
@@ -156,6 +156,11 @@ type PartialActivation interface {
|
||||
UnknownAttributePatterns() []*AttributePattern
|
||||
}
|
||||
|
||||
// partialActivationConverter indicates whether an Activation implementation supports conversion to a PartialActivation
|
||||
type partialActivationConverter interface {
|
||||
asPartialActivation() (PartialActivation, bool)
|
||||
}
|
||||
|
||||
// partActivation is the default implementations of the PartialActivation interface.
|
||||
type partActivation struct {
|
||||
Activation
|
||||
@@ -166,3 +171,20 @@ type partActivation struct {
|
||||
func (a *partActivation) UnknownAttributePatterns() []*AttributePattern {
|
||||
return a.unknowns
|
||||
}
|
||||
|
||||
// asPartialActivation returns the partActivation as a PartialActivation interface.
|
||||
func (a *partActivation) asPartialActivation() (PartialActivation, bool) {
|
||||
return a, true
|
||||
}
|
||||
|
||||
func asPartialActivation(vars Activation) (PartialActivation, bool) {
|
||||
// Only internal activation instances may implement this interface
|
||||
if pv, ok := vars.(partialActivationConverter); ok {
|
||||
return pv.asPartialActivation()
|
||||
}
|
||||
// Since Activations may be hierarchical, test whether a parent converts to a PartialActivation
|
||||
if vars.Parent() != nil {
|
||||
return asPartialActivation(vars.Parent())
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user