Skip to content

Commit

Permalink
Merge pull request #2160 from Icarus9913/fix/wk/endpoint-crd
Browse files Browse the repository at this point in the history
fix wrong SpiderEndpoint vlan ID number
  • Loading branch information
weizhoublue authored Aug 8, 2023
2 parents 71c15e0 + 57b780e commit 6c2581a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
vlan:
default: 0
format: int64
maximum: 4095
maximum: 4094
minimum: 0
type: integer
required:
Expand Down
36 changes: 18 additions & 18 deletions docs/reference/crd-spidermultusconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,40 @@ spec:
This is the SpiderReservedIP spec for users to configure.
| Field | Description | Schema | Validation | Values | Default |
|-------------------|---------------------------------------------------|--------------------------------------------------------------------------|------------|-----------------------------|---------|
| cniType | expected main CNI type | string | require | macvlan,ipvlan,sriov,custom | |
| Field | Description | Schema | Validation | Values | Default |
|-------------------|---------------------------------------------------|------------------------------------------------------------------------------|------------|-----------------------------|---------|
| cniType | expected main CNI type | string | require | macvlan,ipvlan,sriov,custom | |
| macvlan | macvlan CNI configuration | [SpiderMacvlanCniConfig](./crd-spidermultusconfig.md#SpiderMacvlanCniConfig) | optional | | |
| ipvlan | ipvlan CNI configuration | [SpiderIPvlanCniConfig](./crd-spidermultusconfig.md#SpiderIPvlanCniConfig) | optional | | |
| sriov | sriov CNI configuration | [SpiderSRIOVCniConfig](./crd-spidermultusconfig.md#SpiderSRIOVCniConfig) | optional | | |
| enableCoordinator | enable coordinator or not | boolean | optional | true,false | true |
| coordinator | coordinator CNI configuration | CoordinatorSpec | optional | | |
| customCNI | a string that represents custom CNI configuration | string | optional | | |
| enableCoordinator | enable coordinator or not | boolean | optional | true,false | true |
| coordinator | coordinator CNI configuration | CoordinatorSpec | optional | | |
| customCNI | a string that represents custom CNI configuration | string | optional | | |
#### SpiderMacvlanCniConfig
| Field | Description | Schema | Validation | Values |
|---------|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|------------|----------|
| master | the Interfaces on your master, you could specify a single one Interface<br/> or multiple Interfaces to generate one bond Interface | list of strings | required | |
| vlanID | vlan ID | int | optional | [0,4095] |
| Field | Description | Schema | Validation | Values |
|---------|------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|------------|----------|
| master | the Interfaces on your master, you could specify a single one Interface<br/> or multiple Interfaces to generate one bond Interface | list of strings | required | |
| vlanID | vlan ID | int | optional | [0,4094] |
| bond | expected bond Interface configurations | [BondConfig](./crd-spidermultusconfig.md#BondConfig) | optional | |
| ippools | the default IPPools in your CNI configurations | [SpiderpoolPools](./crd-spidermultusconfig.md#SpiderpoolPools) | optional | |
#### SpiderIPvlanCniConfig
| Field | Description | Schema | Validation | Values |
|---------|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|------------|----------|
| master | the Interfaces on your master, you could specify a single one Interface<br/> or multiple Interfaces to generate one bond Interface | list of strings | required | |
| vlanID | vlan ID | int | optional | [0,4095] |
| Field | Description | Schema | Validation | Values |
|---------|------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|------------|----------|
| master | the Interfaces on your master, you could specify a single one Interface<br/> or multiple Interfaces to generate one bond Interface | list of strings | required | |
| vlanID | vlan ID | int | optional | [0,4094] |
| bond | expected bond Interface configurations | [BondConfig](./crd-spidermultusconfig.md#BondConfig) | optional | |
| ippools | the default IPPools in your CNI configurations | [SpiderpoolPools](./crd-spidermultusconfig.md#SpiderpoolPools) | optional | |
#### SpiderSRIOVCniConfig
| Field | Description | Schema | Validation |
|--------------|-------------------------------------------------------------------------------------------|------------------------------------------------------------|------------|
| resourceName | this property will create an annotation for Multus net-attach-def to cooperate with SRIOV | string | required |
| vlanID | vlan ID | int | optional |
| Field | Description | Schema | Validation |
|--------------|-------------------------------------------------------------------------------------------|----------------------------------------------------------------|------------|
| resourceName | this property will create an annotation for Multus net-attach-def to cooperate with SRIOV | string | required |
| vlanID | vlan ID | int | optional |
| ippools | the default IPPools in your CNI configurations | [SpiderpoolPools](./crd-spidermultusconfig.md#SpiderpoolPools) | optional |
#### BondConfig
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/crd-spidersubnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This is the SpiderSubnet spec for users to configure.
| ips | IP ranges for this resource to use | list of strings | optional | array of IP ranges and single IP address | |
| excludeIPs | isolated IP ranges for this resource to filter | list of strings | optional | array of IP ranges and single IP address | |
| gateway | gateway for this resource | string | optional | an IP address | |
| vlan | vlan ID | int | optional | [0,4095] | 0 |
| vlan | vlan ID | int | optional | [0,4094] | 0 |
| routes | custom routes in this resource | list of [Route](./crd-spiderippool.md#Route) | optional | | |
### Status (subresource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type IPAllocationDetail struct {
IPv6Pool *string `json:"ipv6Pool,omitempty"`

// +kubebuilder:default=0
// +kubebuilder:validation:Maximum=4095
// +kubebuilder:validation:Maximum=4094
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Optional
Vlan *int64 `json:"vlan,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/subnet/subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ var _ = Describe("test subnet", Label("subnet"), func() {
subnetAnno := types.AnnoSubnetItem{}
if frame.Info.IpV4Enabled {
*v4Ipversion = int64(4)
if i, err := strconv.Atoi(common.GenerateRandomNumber(4095)); err != nil {
if i, err := strconv.Atoi(common.GenerateRandomNumber(4094)); err != nil {
*ipv4Vlan = int64(i)
}
subnetAnno.IPv4 = []string{v4SubnetName}
Expand All @@ -541,7 +541,7 @@ var _ = Describe("test subnet", Label("subnet"), func() {

if frame.Info.IpV6Enabled {
*v6Ipversion = int64(6)
if i, err := strconv.Atoi(common.GenerateRandomNumber(4095)); err != nil {
if i, err := strconv.Atoi(common.GenerateRandomNumber(4094)); err != nil {
*ipv6Vlan = int64(i)
}
subnetAnno.IPv6 = []string{v6SubnetName}
Expand Down

0 comments on commit 6c2581a

Please sign in to comment.