Skip to content

feat: Variable assign supports type conversion and can be set to null#4918

Open
wangliang181230 wants to merge 9 commits into1Panel-dev:v2from
wangliang181230:variable-assign-support-type-convert
Open

feat: Variable assign supports type conversion and can be set to null#4918
wangliang181230 wants to merge 9 commits into1Panel-dev:v2from
wangliang181230:variable-assign-support-type-convert

Conversation

@wangliang181230
Copy link
Contributor

@wangliang181230 wangliang181230 commented Mar 20, 2026

What this PR does / why we need it?

Summary of your change

feat: Variable assignment supports type conversion and can be set to null
新特性:变量赋值 支持类型转换,以及添加赋值类型 null

Please indicate you've done the following:

  1. 当为 自定义string引用变量 时,允许选择转换类型,支持转换为:
    • string: 使用 str(val) 进行转换;
    • int: 使用 int(val) 进行转换
    • float: 使用 float(val) 进行转换
    • json_object: 使用 json.loads(val) 进行转换
    • json_string: 使用 json.dumps(val, ensure_ascii=False) 进行转换
    • boolean: 使用 bool(val) 进行转换
  2. 赋值类型增加 null 选项,比较直观,不再是选择 引用变量 然后不选择引用来设置为空了。
  3. 截图:
    1. 类型转换截图:
      图片
      图片
    2. 赋值为 null 截图:
      图片
      图片
  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 20, 2026

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 20, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wangliang181230 wangliang181230 changed the title feat: Variable assignment supports type conversion and can be set to null feat: Variable assign supports type conversion and can be set to null Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant