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

Improve SubnetDHCPConfig validation rule #976

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

yanjunz97
Copy link
Contributor

Subnet controller will update the SubnetSpec as the following when
either accessMode or ipv4SubnetSize is not provided.

spec:
  accessMode: Public
  ipv4SubnetSize: 64
  subnetDHCPConfig:{}

Thus we need another validation rule on subnetDHCPConfig to prevent
subnetDHCPConfig being updated from no mode specified to
DHCPServer/DHCPRelay mode.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.37%. Comparing base (86c0d65) to head (82d0f44).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #976   +/-   ##
=======================================
  Coverage   73.37%   73.37%           
=======================================
  Files         118      118           
  Lines       16394    16394           
=======================================
  Hits        12029    12029           
  Misses       3581     3581           
  Partials      784      784           
Flag Coverage Δ
unit-tests 73.37% <ø> (ø)
Files with missing lines Coverage Δ
pkg/apis/vpc/v1alpha1/subnet_types.go 100.00% <ø> (ø)
pkg/apis/vpc/v1alpha1/subnetset_types.go 100.00% <ø> (ø)

Copy link
Contributor

@lxiaopei lxiaopei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yanjunz97 yanjunz97 merged commit 76ad53d into vmware-tanzu:main Dec 26, 2024
3 checks passed
yanjunz97 added a commit to yanjunz97/nsx-operator that referenced this pull request Dec 26, 2024
Subnet controller will update the SubnetSpec as the following when
either accessMode or ipv4SubnetSize is not provided.
```
spec:
  accessMode: Public
  ipv4SubnetSize: 64
  subnetDHCPConfig:{}
```
Thus we need another validation rule on subnetDHCPConfig to prevent
subnetDHCPConfig being updated from no mode specified to
DHCPServer/DHCPRelay mode.

Signed-off-by: Yanjun Zhou <[email protected]>
yanjunz97 added a commit that referenced this pull request Dec 26, 2024
Subnet controller will update the SubnetSpec as the following when
either accessMode or ipv4SubnetSize is not provided.
```
spec:
  accessMode: Public
  ipv4SubnetSize: 64
  subnetDHCPConfig:{}
```
Thus we need another validation rule on subnetDHCPConfig to prevent
subnetDHCPConfig being updated from no mode specified to
DHCPServer/DHCPRelay mode.

Signed-off-by: Yanjun Zhou <[email protected]>
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.

5 participants