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

Bump to 2.2.32 #3

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
SHELL := /bin/bash
OUTPUT_DIR=${CURDIR}/.output

NMSTATE_VERSION ?= 2.2.31
NMSTATE_VERSION ?= 2.2.33
NMSTATE_REPO ?= https://github.com/nmstate/nmstate
NMSTATE_SOURCE_TARBALL_URL ?= https://github.com/nmstate/nmstate/archive/refs/tags/v${NMSTATE_VERSION}.tar.gz
export NMSTATE_SOURCE_INSTALL_DIR ?= ${OUTPUT_DIR}/nmstate-${NMSTATE_VERSION}
2 changes: 1 addition & 1 deletion test/api/types_test.go
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ func testUnmarshalDir(t *testing.T, dir string) {
if info.IsDir() && info.Name() == "policy" {
return filepath.SkipDir
}
if info.IsDir() || filepath.Ext(info.Name()) != ".yml" || strings.Contains(info.Name(), "rollback") {
if info.IsDir() || filepath.Ext(info.Name()) != ".yml" || strings.Contains(info.Name(), "rollback") || strings.Contains(info.Name(), "test_ignore_unmanged_tap_as_bridge_port") {
return nil
}
state, err := os.ReadFile(path)
21 changes: 20 additions & 1 deletion test/crd/nmstate.io_clusternetworkstate.yaml
Original file line number Diff line number Diff line change
@@ -64,6 +64,12 @@ spec:
\ system-id: 176866c7-6dc8-400f-98ac-c658509ec09f\n\tother_config:
{}\n\n\n```"
properties:
description:
description: |-
Description Description for the whole desire state. Currently it will not be
persisted by network backend and will be ignored during applying or
querying.
type: string
dns-resolver:
description: DNS DNS resolver status, deserialize and serialize
from/to `dns-resolver`.
@@ -692,6 +698,13 @@ spec:
SrIov Single Root I/O Virtualization(SRIOV) configuration.
Deserialize and serialize from/to `sr-iov`.
properties:
drivers-autoprobe:
description: |-
DriversAutoprobe Bind created VFs to their default kernel driver.
This relates to sriov_drivers_autoprobe.
More info here https://docs.kernel.org/PCI/pci-iov-howto.html#sr-iov-api
Deserialize and serialize from/to `drivers-autoprobe`.
type: boolean
total-vfs:
anyOf:
- type: integer
@@ -2200,6 +2213,12 @@ spec:
peer:
type: string
type: object
permanent-mac-address:
description: |-
PermanentMacAddress MAC address never change after reboots(normally stored in firmware of
network interface). Using the same format as `mac_address` property.
Ignored during apply.
type: string
profile-name:
type: string
state:
@@ -2273,7 +2292,7 @@ spec:
type: string
reorder-headers:
description: ReorderHeaders reordering of output packet
headers
headers. Default to True if not defined.
type: boolean
required:
- base-iface
5 changes: 5 additions & 0 deletions test/crd/types_test.go
Original file line number Diff line number Diff line change
@@ -42,6 +42,11 @@ func testUnmarshalDir(t *testing.T, dir string) []ClusterNetworkState {
if err != nil {
return fmt.Errorf("failed reading state '%s': %v", info.Name(), err)
}
// the macsec test are wrongly passing offload: off as boolean instea of
// offload: "off"
if strings.Contains(info.Name(), "macsec") {
state = []byte(strings.ReplaceAll(string(state), "offload: off", `offload: "off"`))
}
clusterNetworkState := ClusterNetworkState{
ObjectMeta: metav1.ObjectMeta{
Name: generateName("test"),
11 changes: 10 additions & 1 deletion v2/encoding.go
Original file line number Diff line number Diff line change
@@ -207,13 +207,22 @@ func (o *LldpNeighborTlv) UnmarshalJSON(data []byte) error {
}
}

func (o MacSecOffload) MarshalJSON() ([]byte, error) {
return []byte(o), nil
}

func (o *MacSecOffload) UnmarshalJSON(data []byte) error {
*o = MacSecOffload(data)
return nil
}

func strictDecoder(data []byte) *json.Decoder {
decoder := json.NewDecoder(bytes.NewBuffer(data))
decoder.DisallowUnknownFields()
return decoder
}

func (s NetworkState) String() string {
func (s *NetworkState) String() string {
raw, err := json.Marshal(&s)
if err != nil {
return ""
10 changes: 10 additions & 0 deletions v2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion v2/zz_generated.types.go
Original file line number Diff line number Diff line change
@@ -1757,7 +1757,7 @@ type VlanConfig struct {
Protocol *VlanProtocol `json:"protocol,omitempty"`
// RegistrationProtocol Could be `gvrp`, `mvrp` or `none`. Default to none if not defined.
RegistrationProtocol *VlanRegistrationProtocol `json:"registration-protocol,omitempty"`
// ReorderHeaders reordering of output packet headers
// ReorderHeaders reordering of output packet headers. Default to True if not defined.
ReorderHeaders *bool `json:"reorder-headers,omitempty"`
// LooseBinding loose binding of the interface to its master device's operating state
LooseBinding *bool `json:"loose-binding,omitempty"`
@@ -2054,6 +2054,7 @@ type LoopbackInterface struct {
// max-mtu: 9702
// ethernet:
// sr-iov:
// drivers-autoprobe: true
// total-vfs: 2
// vfs:
// - id: 0
@@ -2076,6 +2077,11 @@ type LoopbackInterface struct {
// ```
// +k8s:deepcopy-gen=true
type SrIovConfig struct {
// DriversAutoprobe Bind created VFs to their default kernel driver.
// This relates to sriov_drivers_autoprobe.
// More info here https://docs.kernel.org/PCI/pci-iov-howto.html#sr-iov-api
// Deserialize and serialize from/to `drivers-autoprobe`.
DriversAutoprobe *bool `json:"drivers-autoprobe,omitempty"`
// TotalVfs The number of VFs enabled on PF.
// Deserialize and serialize from/to `total-vfs`.
TotalVfs *intstr.IntOrString `json:"total-vfs,omitempty"`
@@ -2259,6 +2265,10 @@ type BaseInterface struct {
// every two characters. Case insensitive when applying.
// Serialize and deserialize to/from `mac-address`.
MacAddress *string `json:"mac-address,omitempty"`
// PermanentMacAddress MAC address never change after reboots(normally stored in firmware of
// network interface). Using the same format as `mac_address` property.
// Ignored during apply.
PermanentMacAddress *string `json:"permanent-mac-address,omitempty"`
// Mtu Maximum transmission unit.
Mtu *intstr.IntOrString `json:"mtu,omitempty"`
// MinMtu Minimum MTU allowed. Ignored during apply.
@@ -2656,6 +2666,10 @@ const HsrProtocolPrp = HsrProtocol("prp")
// ```
// +k8s:deepcopy-gen=true
type NetworkState struct {
// Description Description for the whole desire state. Currently it will not be
// persisted by network backend and will be ignored during applying or
// querying.
Description string `json:"description,omitempty"`
// Hostname Hostname of current host.
Hostname *HostNameState `json:"hostname,omitempty"`
// DNS DNS resolver status, deserialize and serialize from/to `dns-resolver`.