Skip to content

Commit

Permalink
nmstate-2.2.32
Browse files Browse the repository at this point in the history
Signed-off-by: Enrique Llorente <[email protected]>
  • Loading branch information
qinqon committed Oct 2, 2024
1 parent 8a08260 commit 7ee7769
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion test/api/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 20 additions & 1 deletion test/crd/nmstate.io_clusternetworkstate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/crd/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
11 changes: 10 additions & 1 deletion v2/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
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
Expand Up @@ -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"`
Expand Down Expand Up @@ -2054,6 +2054,7 @@ type LoopbackInterface struct {
// max-mtu: 9702
// ethernet:
// sr-iov:
// drivers-autoprobe: true
// total-vfs: 2
// vfs:
// - id: 0
Expand All @@ -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"`
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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`.
Expand Down

0 comments on commit 7ee7769

Please sign in to comment.