Skip to content

Bug: ENO Azure Override Condition Ignores CEL double() Function #459

@SRodi

Description

@SRodi

Summary

The eno.azure.io/overrides annotation in ConfigMap resources is not working as expected when using the CEL double() function in the condition. The override condition is being ignored, causing ENO to reset user-modified values back to the default even when the condition should prevent this behavior.

Current Behavior

When a user patches the some-field-name field to a value ≤ 0.01 using kubectl, ENO reconciles and resets the value back to the default 0.0025, despite the override condition that should prevent this.

Expected Behavior

The override condition should prevent ENO from resetting the value when all the following conditions evaluate to true:

  1. The field some-field-name is not null
  2. The path is not managed by ENO (!pathManagedByEno)
  3. The numeric value is ≤ 0.01 (double(self.data['some-field-name']) <= 0.01)

Reproduction Steps

  1. Apply the test ConfigMap with the current configuration:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: test-config
      annotations:
        eno.azure.io/overrides: |
          [
            { "path": "self.data['some-field-name']", "value": null, "condition": "self.data['some-field-name'] != null && !pathManagedByEno && double(self.data['some-field-name']) <= 0.01" }
          ]
    data:
      some-field-name: "0.0025"
  2. Patch the field to a value ≤ 0.01:

    kubectl patch configmap test-config -n kube-system --type='merge' -p='{"data":{"some-field-name":"0.005"}}'
  3. Wait for ENO to reconcile

  4. Observe that the value is reset to 0.0025 instead of preserving the user's 0.005 value

Root Cause Analysis

The issue appears to be related to the use of the CEL double() function in the condition. Possible causes:

  • ENO may not properly support or evaluate the double() CEL function
  • String-to-numeric conversion may be failing silently
  • CEL expression evaluation context may not include the double() function

Impact

  • User Impact: Users cannot override the some-field-name value, limiting customization capabilities
  • Workaround: None currently available through standard kubectl operations

Additional Context

  • This is a customer-facing configuration that should allow overrides
  • The issue specifically affects double types, suggesting the numeric comparison logic is the problem

Environment

  • AKS Version: v2.32.6
  • ENO Version: v0.1.27

Next Steps

  1. Investigate ENO's CEL function support and documentation
  2. Test alternative condition syntaxes
  3. Consider adding integration tests for ENO override conditions
  4. Update documentation if CEL function limitations exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions