Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKS-1825: Set the default APIGroup and Kind for IPPool CR used in ElfMachineTemplate #172

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

haijianyang
Copy link
Contributor

Issue

简化 IPPool 的配置,默认情况下只需要配置 IPPool name 即可,可以不填写 apiGroup 和 kind。

Change

CAPE 当前使用 ipam.metal3.io IPPool 作为默认的 IP Pool,在 ElfMachineTemplate webhook 默认设置即可,这样创建出来的 ElfMachine 会自动使用默认的 IPPool 配置。

测试

1.ElfMachineTemplate 未设置 apiGroupkind 的 IPPool

  network:
    devices:
    - addressesFromPools:
      - name: ip-pool-node
  1. 观察到 addressesFromPools 被设置了 ipam.metal3.ioIPPool
  network:
    devices:
    - addressesFromPools:
      - apiGroup: ipam.metal3.io
        kind: IPPool
        name: ip-pool-node
  1. 创建出来的 ElfMachine 的 addressesFromPools 设置了ipam.metal3.ioIPPool

@haijianyang haijianyang requested a review from jessehu March 1, 2024 04:11
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 51.61290% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 60.00%. Comparing base (1ed0e13) to head (4db1469).

Files Patch % Lines
webhooks/elfmachinetemplate_webhook_mutation.go 51.61% 12 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   59.79%   60.00%   +0.20%     
==========================================
  Files          20       21       +1     
  Lines        3699     3730      +31     
==========================================
+ Hits         2212     2238      +26     
+ Misses       1339     1338       -1     
- Partials      148      154       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jessehu jessehu changed the title SKS-1825: Set the default IPPool apiGroup and kind for ElfMachineTemplate SKS-1825: Set the default APIGroup and Kind for IPPool CR used in ElfMachineTemplate Mar 1, 2024
@haijianyang haijianyang merged commit 3036c0f into smartxworks:master Mar 1, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants