bug(policy): stabilize endpoint conflict diagnostics in policy lint

未关闭
#5,882 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
grpc, rust
领域
backend, cli

调研方向

The payload names no source files, so start from the openshell policy lint command and the endpoint conflict check that the gateway also uses. Run the 20-iteration loop on the YAML from the reproduction steps to confirm that rule and conflict order changes between runs. Done means repeated runs give the same order, and an integration test shows offline lint and gateway CreateSandbox reject the same YAML with the same details and return FailedPrecondition.

由索引模型根据 Issue 内容生成。

描述

state:triage-needed

User Story

I use openshell policy lint to check sandbox policy files locally. While reviewing #5358, I ran the command several times on the same YAML to check how it reported a conflict between two network rules.

Problem Statement

The two rules below match the same host and port. One uses the default TLS mode and the other sets tls: skip. Lint rejects the file every time. Some runs list alpha first and others list zeta first. The TLS values swap with the rule names. If the policy has several conflicts, the order of the pairs can change too. The gateway uses the same endpoint conflict check.

This follows up on the offline lint work in #4035. Review on #5358

Impact / Why This Matters

The same conflict can show up as a change when comparing lint output from two CI runs of the same policy.

Acceptance Criteria

  • Repeated lint and gateway checks of the same policy keep the order of conflicts and the order of the rules within each conflict stable.
  • An integration test checks that offline lint and gateway CreateSandbox without providers reject the same YAML and report the same conflict details. The gateway returns FailedPrecondition.

Reproduction Steps

  1. Save this as policy.yaml.

    version: 1
    network_policies:
      zeta:
        endpoints:
          - {host: example.com, port: 443, tls: skip}
      alpha:
        endpoints:
          - {host: example.com, port: 443}
    
  2. Run the offline check 20 times.

    for i in $(seq 1 20); do openshell policy lint policy.yaml; done
    
  3. Compare the rule names and TLS values across runs.

Environment

  • OpenShell built from main at 38c47412dd7e94b8efc44b128940e097590b7582, macOS 26.6.2 on arm64.
  • The reproduction runs entirely in the offline CLI.

Logs

All 20 runs exited with status 1.

 9 runs  'alpha' … 'zeta' … tls=0 vs 1
11 runs  'zeta' … 'alpha' … tls=1 vs 0
主要语言
Rust
星标
21.5k
派生
2.1k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。