- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for hasParams (0.18 sec)
-
staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/compile_test.go
expressions: []string{"object.foo < params.x"}, hasParams: true, }, { name: "namespaceObject", expressions: []string{"namespaceObject.metadata.name.startsWith('test')"}, hasParams: true, }, { name: "without params", errorExpressions: map[string]string{"object.foo < params.x": "undeclared reference to 'params'"}, hasParams: false, }, {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 10.8K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/validating/plugin.go
func compilePolicy(policy *Policy) Validator { hasParam := false if policy.Spec.ParamKind != nil { hasParam = true } strictCost := utilfeature.DefaultFeatureGate.Enabled(features.StrictCostEnforcementForVAP) optionalVars := cel.OptionalVariableDeclarations{HasParams: hasParam, HasAuthorizer: true, StrictCost: strictCost} expressionOptionalVars := cel.OptionalVariableDeclarations{HasParams: hasParam, HasAuthorizer: false, StrictCost: strictCost}
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 7.5K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/interface.go
} // OptionalVariableDeclarations declares which optional CEL variables // are declared for an expression. type OptionalVariableDeclarations struct { // HasParams specifies if the "params" variable is declared. // The "params" variable may still be bound to "null" when declared. HasParams bool // HasAuthorizer specifies if the "authorizer" and "authorizer.requestResource" // variables are declared. When declared, the authorizer variables are
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 3.9K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/composition_test.go
t.Fatal(err) } compiler.CompileAndStoreVariables(tc.variables, OptionalVariableDeclarations{HasParams: false, HasAuthorizer: false, StrictCost: tc.strictCostEnforcement}, environment.NewExpressions) validations := []ExpressionAccessor{&condition{Expression: tc.expression}} f := compiler.Compile(validations, OptionalVariableDeclarations{HasParams: false, HasAuthorizer: false, StrictCost: tc.strictCostEnforcement}, environment.NewExpressions)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 8.2K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/compile.go
envs := make(variableDeclEnvs, 8) // since the number of variable combinations is small, pre-build a environment for each for _, hasParams := range []bool{false, true} { for _, hasAuthorizer := range []bool{false, true} { for _, strictCost := range []bool{false, true} { var envOpts []cel.EnvOption if hasParams { envOpts = append(envOpts, cel.Variable(ParamsVarName, cel.DynType)) } if hasAuthorizer {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 10.5K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/validating/typechecking.go
ctx.variables = policy.Spec.Variables return ctx } func (c *TypeChecker) compiler(ctx *TypeCheckingContext, typeOverwrite typeOverwrite) (*plugincel.CompositedCompiler, error) { envSet, err := buildEnvSet( /* hasParams */ ctx.paramDeclType != nil, /* hasAuthorizer */ true, typeOverwrite) if err != nil { return nil, err } env, err := plugincel.NewCompositionEnv(plugincel.VariablesTypeName, envSet) if err != nil {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 15.3K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/accessors.go
strictCost = true } m.compiledMatcher = matchconditions.NewMatcher(compiler.Compile( expressions, cel.OptionalVariableDeclarations{ HasParams: false, HasAuthorizer: true, StrictCost: strictCost, }, environment.StoredExpressions, ), m.FailurePolicy, "webhook", "admit", m.Name) }) return m.compiledMatcher }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 12.4K bytes - Viewed (0) -
pkg/apis/admissionregistration/validation/validation.go
} return validateCELCondition(compiler, &validatingadmissionpolicy.ValidationCondition{ Expression: expression, }, plugincel.OptionalVariableDeclarations{ HasParams: hasParams, HasAuthorizer: true, StrictCost: opts.strictCostEnforcement, }, envType, fldPath) } func validateMatchConditionsExpression(expression string, opts validationOptions, fldPath *field.Path) field.ErrorList {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 56.6K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/filter_test.go
t.Run(tc.name, func(t *testing.T) { c := filterCompiler{compiler: NewCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), true))} e := c.Compile(tc.validation, OptionalVariableDeclarations{HasParams: false, HasAuthorizer: false, StrictCost: true}, environment.NewExpressions) if e == nil { t.Fatalf("unexpected nil validator") } validations := tc.validation
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 40.4K bytes - Viewed (0) -
pkg/apis/admissionregistration/validation/validation_test.go
r := admissionregistration.FailurePolicyType("Fail") return &r }(), MatchConditions: []admissionregistration.MatchCondition{{ Name: "hasParams", Expression: `params.foo == "okay"`, }}, Validations: []admissionregistration.Validation{{ Expression: "object.x < 100", }}, }, }, expectedError: "", }, {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 10 22:07:40 UTC 2024 - 147.1K bytes - Viewed (0)