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

[cherry-pick]Improve SubnetDHCPConfig validation rule (#976) #978

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.

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]>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.03%. Comparing base (53f0db8) to head (854fb68).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           v4.2.0     #978   +/-   ##
=======================================
  Coverage   74.03%   74.03%           
=======================================
  Files         118      118           
  Lines       16397    16397           
=======================================
  Hits        12139    12139           
  Misses       3477     3477           
  Partials      781      781           
Flag Coverage Δ
unit-tests 74.03% <ø> (ø)
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

@timdengyun timdengyun 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 5a693bc into vmware-tanzu:v4.2.0 Dec 26, 2024
3 checks passed
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.

6 participants