diff --git a/staging/kos/pkg/apis/network/types.go b/staging/kos/pkg/apis/network/types.go index 8422b8375..28ddb836c 100644 --- a/staging/kos/pkg/apis/network/types.go +++ b/staging/kos/pkg/apis/network/types.go @@ -19,9 +19,207 @@ package network import ( "time" + fuzz "github.com/google/gofuzz" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// ExtendedObjectMeta has extra metadata for an API object. +// This is maintained by the server, clients can not modify it. +type ExtendedObjectMeta struct { + // Writes identifies the latest write to each part of the object. + // +listType=map + // +listMapKey=section + // +optional + Writes WriteSet +} + +// WriteSet represents a map from section to time +type WriteSet []ObjectWrite + +// ObjectWrite describes a write to part of an object +type ObjectWrite struct { + // Section identifies the part of the object that was written. + // Each type of object is broken down into a type-specific set of + // sections. + Section string + + // ServerTime is the time when the write was recorded at the apiserver + ServerTime Timestamp +} + +// GetServerWriteTime returns the server time of the write to the +// given section, or zero if there was none. +func (writes WriteSet) GetServerWriteTime(section string) Timestamp { + return writes.GetWrite(section).ServerTime +} + +// GetWrite returns the write to the given section, or zero if there +// was none. +func (writes WriteSet) GetWrite(section string) ObjectWrite { + for _, wr := range writes { + if wr.Section == section { + return wr + } + } + return ObjectWrite{} +} + +// SetWrite produces a revised slice that includes the given write. +// The input is not side-effected. +func (writes WriteSet) SetWrite(section string, serverTime Timestamp) WriteSet { + n := len(writes) + var i int + for i = 0; i < n && writes[i].Section != section; i++ { + } + if i == n { + return append(WriteSet{{Section: section, ServerTime: serverTime}}, writes...) + } + return append(append(WriteSet{{Section: section, ServerTime: serverTime}}, writes[:i]...), writes[i+1:]...) +} + +// Diff produces the subset of the given writes that do not overlap +// with the other writes +func (writes WriteSet) Diff(others WriteSet) WriteSet { + ans := make(WriteSet, 0, len(writes)) + for _, wr := range writes { + owr := others.GetWrite(wr.Section) + if owr == (ObjectWrite{}) { + ans = append(ans, wr) + } + } + return ans +} + +// UnionLeft produces the union of the receiver and the other writes +// that do not overlap with the receiver +func (writes WriteSet) UnionLeft(others WriteSet) WriteSet { + ans := append(WriteSet{}, writes...) + for _, owr := range others { + wr := ans.GetWrite(owr.Section) + if wr == (ObjectWrite{}) { + ans = append(ans, owr) + } + } + return ans +} + +// UnionMin produces the union of the two write sets, keeping the +// earlier time for sections written in both sets +func (writes WriteSet) UnionMin(others WriteSet) WriteSet { + ans := others.Diff(writes) + for _, wr := range writes { + owr := others.GetWrite(wr.Section) + owr.ServerTime = owr.ServerTime.Min(wr.ServerTime) + ans = append(ans, owr) + } + return ans +} + +// UnionMax produces the union of the two write sets, keeping the +// later time for sections written in both sets +func (writes WriteSet) UnionMax(others WriteSet) WriteSet { + ans := others.Diff(writes) + for _, wr := range writes { + owr := others.GetWrite(wr.Section) + owr.ServerTime = owr.ServerTime.Max(wr.ServerTime) + ans = append(ans, owr) + } + return ans +} + +// Timestamp records a time and is not truncated when marshalled. A +// Timestamp does not record a location but is unambiguous; it is the +// number of nanoseconds since Jan 1, 1970 began in Greenwich, UK. +type Timestamp struct { + // Nano is that number. + Nano int64 +} + +// NewTime returns a wrapped instance of the provided time +func NewTimestamp(time time.Time) Timestamp { + // Time::UnixNano() is unambiguous + return Timestamp{time.UnixNano()} +} + +// Date returns the Timestamp corresponding to the supplied parameters +// by wrapping time.Date. +func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Timestamp { + return Timestamp{time.Date(year, month, day, hour, min, sec, nsec, loc).UnixNano()} +} + +// Now returns the current local time. +func Now() Timestamp { + return Timestamp{time.Now().UnixNano()} +} + +// IsZero returns true if the value is zero. +func (ts Timestamp) IsZero() bool { + return ts.Nano == 0 +} + +// Sub returns the difference between the two timestamps +func (ts Timestamp) Sub(us Timestamp) time.Duration { + return time.Duration(ts.Nano - us.Nano) +} + +// Before reports whether the time instant t is before u. +func (ts Timestamp) Before(us Timestamp) bool { + return ts.Nano < us.Nano +} + +// Equal reports whether the time instant t is equal to u. +func (ts Timestamp) Equal(us Timestamp) bool { + return ts.Nano == us.Nano +} + +// Min returns the earlier of the two, receiver if tie +func (ts Timestamp) Min(us Timestamp) Timestamp { + if us.Before(ts) { + return us + } + return ts +} + +// Max returns the later of the two, receiver if tie +func (ts Timestamp) Max(us Timestamp) Timestamp { + if ts.Before(us) { + return us + } + return ts +} + +// Unix returns the local time corresponding to the given Unix time +// by wrapping time.Unix. +func Unix(sec int64, nsec int64) Timestamp { + return Timestamp{time.Unix(sec, nsec).UnixNano()} +} + +// Fuzz satisfies fuzz.Interface. +func (ts *Timestamp) Fuzz(c fuzz.Continue) { + if ts == nil { + return + } + // Allow for about 1000 years of randomness. + ts.Nano = time.Unix(c.Rand.Int63n(1000*365*24*60*60), c.Rand.Int63n(1000000000)).UnixNano() +} + +var _ fuzz.Interface = &Timestamp{} + +// String formats the timestamp after shifting into UTC +func (ts Timestamp) String() string { + utc := ts.Time().In(time.UTC) + return utc.Format(MetaTimestampFormat) +} + +// MetaTimestampFormat is the format used by Timestamp::String() +const MetaTimestampFormat = time.RFC3339Nano + +// Time converts to a time.Time +func (ts Timestamp) Time() time.Time { + return time.Unix(0, ts.Nano) +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // NetworkAttachmentList is a list of NetworkAttachment objects. @@ -60,6 +258,7 @@ type NetworkAttachmentSpec struct { // and `mac`. // PostCreateExec is immutable: attempts to update it will fail. // +optional + // +patchStrategy=replace PostCreateExec []string // PostDeleteExec is a command to exec inside the attachment @@ -73,6 +272,7 @@ type NetworkAttachmentSpec struct { // deleted by then). The same restrictions and variable // expansions as for PostCreateExec are applied. // +optional + // +patchStrategy=replace PostDeleteExec []string } @@ -126,16 +326,19 @@ type NetworkAttachmentStatus struct { type NetworkAttachmentErrors struct { // IPAM holds errors about the IP Address Management for this attachment. // +optional + // +patchStrategy=replace IPAM []string // Host holds errors from the node where this attachment is placed. // +optional + // +patchStrategy=replace Host []string } // ExecReport reports on what happened when a command was execd. type ExecReport struct { // Command is the command whose execution is summarized by this ExecReport. + // +patchStrategy=replace Command []string // ExitStatus is the Linux exit status from the command, or a @@ -150,7 +353,9 @@ type ExecReport struct { StdErr string } -// Equal tests whether the two referenced ExecReports say the same thing +// Equiv tests whether the two referenced ExecReports say the same +// thing within the available time precision. The apiservers only +// store time values with seconds precision. func (x *ExecReport) Equiv(y *ExecReport) bool { if x == y { return true @@ -165,15 +370,30 @@ func (x *ExecReport) Equiv(y *ExecReport) bool { x.StopTime.Time.Truncate(time.Second).Equal(y.StopTime.Time.Truncate(time.Second)) } +// The ExtendedObjectMeta sections for a NetworkAttachment +const ( + NASectionSpec = "spec" + NASectionAddr = "status.address" + NASectionImpl = "status.impl" + NASectionExecReport = "status.execReport" +) + // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// NetworkAttachment is about a Linux network interface connected to a +// Subnet. The sections recorded in ExtendedObjectMeta are: spec, +// status.address, status.impl, status.execReport. type NetworkAttachment struct { metav1.TypeMeta // +optional metav1.ObjectMeta + // `extendedMetadata` adds non-standard object metadata + // +optional + ExtendedObjectMeta + Spec NetworkAttachmentSpec // +optional @@ -219,15 +439,27 @@ type SubnetStatus struct { Errors []string } +// The ExtendedObjectMeta sections for a Subnet +const ( + SubnetSectionSpec = "spec" + SubnetSectionStatus = "status" +) + // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Subnet is about an IP subnet on a virtual network. For +// ExtendedObjectMeta the sections are: spec, status. type Subnet struct { metav1.TypeMeta // +optional metav1.ObjectMeta + // `extendedMetadata` adds non-standard object metadata + // +optional + ExtendedObjectMeta + Spec SubnetSpec // +optional diff --git a/staging/kos/pkg/apis/network/v1alpha1/types.go b/staging/kos/pkg/apis/network/v1alpha1/types.go index 0f7b6365d..63dceee4b 100644 --- a/staging/kos/pkg/apis/network/v1alpha1/types.go +++ b/staging/kos/pkg/apis/network/v1alpha1/types.go @@ -19,9 +19,207 @@ package v1alpha1 import ( "time" + fuzz "github.com/google/gofuzz" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// ExtendedObjectMeta has extra metadata for an API object. +// This is maintained by the server, clients can not modify it. +type ExtendedObjectMeta struct { + // Writes identifies the latest write to each part of the object. + // +listType=map + // +listMapKey=section + // +optional + Writes WriteSet `json:"writes" protobuf:"bytes,1,name=writes"` +} + +// WriteSet represents a map from section to time +type WriteSet []ObjectWrite + +// ObjectWrite describes a write to part of an object +type ObjectWrite struct { + // Section identifies the part of the object that was written. + // Each type of object is broken down into a type-specific set of + // sections. + Section string `json:"section" protobuf:"bytes,1,name=section"` + + // ServerTime is the time when the write was recorded at the apiserver + ServerTime Timestamp `json:"serverTime" protobuf:"bytes,2,name=serverTime"` +} + +// GetServerWriteTime returns the server time of the write to the +// given section, or zero if there was none. +func (writes WriteSet) GetServerWriteTime(section string) Timestamp { + return writes.GetWrite(section).ServerTime +} + +// GetWrite returns the write to the given section, or zero if there +// was none. +func (writes WriteSet) GetWrite(section string) ObjectWrite { + for _, wr := range writes { + if wr.Section == section { + return wr + } + } + return ObjectWrite{} +} + +// SetWrite produces a revised slice that includes the given write. +// The input is not side-effected. +func (writes WriteSet) SetWrite(section string, serverTime Timestamp) WriteSet { + n := len(writes) + var i int + for i = 0; i < n && writes[i].Section != section; i++ { + } + if i == n { + return append(WriteSet{{Section: section, ServerTime: serverTime}}, writes...) + } + return append(append(WriteSet{{Section: section, ServerTime: serverTime}}, writes[:i]...), writes[i+1:]...) +} + +// Diff produces the subset of the given writes that do not overlap +// with the other writes +func (writes WriteSet) Diff(others WriteSet) WriteSet { + ans := make(WriteSet, 0, len(writes)) + for _, wr := range writes { + owr := others.GetWrite(wr.Section) + if owr == (ObjectWrite{}) { + ans = append(ans, wr) + } + } + return ans +} + +// UnionLeft produces the union of the receiver and the other writes +// that do not overlap with the receiver +func (writes WriteSet) UnionLeft(others WriteSet) WriteSet { + ans := append(WriteSet{}, writes...) + for _, owr := range others { + wr := ans.GetWrite(owr.Section) + if wr == (ObjectWrite{}) { + ans = append(ans, owr) + } + } + return ans +} + +// UnionMin produces the union of the two write sets, keeping the +// earlier time for sections written in both sets +func (writes WriteSet) UnionMin(others WriteSet) WriteSet { + ans := others.Diff(writes) + for _, wr := range writes { + owr := others.GetWrite(wr.Section) + owr.ServerTime = owr.ServerTime.Min(wr.ServerTime) + ans = append(ans, owr) + } + return ans +} + +// UnionMax produces the union of the two write sets, keeping the +// later time for sections written in both sets +func (writes WriteSet) UnionMax(others WriteSet) WriteSet { + ans := others.Diff(writes) + for _, wr := range writes { + owr := others.GetWrite(wr.Section) + owr.ServerTime = owr.ServerTime.Max(wr.ServerTime) + ans = append(ans, owr) + } + return ans +} + +// Timestamp records a time and is not truncated when marshalled. A +// Timestamp does not record a location but is unambiguous; it is the +// number of nanoseconds since Jan 1, 1970 began in Greenwich, UK. +type Timestamp struct { + // Nano is that number. + Nano int64 `json:"nano" protobuf:"varint,1,name=nano"` +} + +// NewTime returns a wrapped instance of the provided time +func NewTimestamp(time time.Time) Timestamp { + // Time::UnixNano() is unambiguous + return Timestamp{time.UnixNano()} +} + +// Date returns the Timestamp corresponding to the supplied parameters +// by wrapping time.Date. +func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Timestamp { + return Timestamp{time.Date(year, month, day, hour, min, sec, nsec, loc).UnixNano()} +} + +// Now returns the current local time. +func Now() Timestamp { + return Timestamp{time.Now().UnixNano()} +} + +// IsZero returns true if the value is zero. +func (ts Timestamp) IsZero() bool { + return ts.Nano == 0 +} + +// Sub returns the difference between the two timestamps +func (ts Timestamp) Sub(us Timestamp) time.Duration { + return time.Duration(ts.Nano - us.Nano) +} + +// Before reports whether the time instant t is before u. +func (ts Timestamp) Before(us Timestamp) bool { + return ts.Nano < us.Nano +} + +// Equal reports whether the time instant t is equal to u. +func (ts Timestamp) Equal(us Timestamp) bool { + return ts.Nano == us.Nano +} + +// Min returns the earlier of the two, receiver if tie +func (ts Timestamp) Min(us Timestamp) Timestamp { + if us.Before(ts) { + return us + } + return ts +} + +// Max returns the later of the two, receiver if tie +func (ts Timestamp) Max(us Timestamp) Timestamp { + if ts.Before(us) { + return us + } + return ts +} + +// Unix returns the local time corresponding to the given Unix time +// by wrapping time.Unix. +func Unix(sec int64, nsec int64) Timestamp { + return Timestamp{time.Unix(sec, nsec).UnixNano()} +} + +// Fuzz satisfies fuzz.Interface. +func (ts *Timestamp) Fuzz(c fuzz.Continue) { + if ts == nil { + return + } + // Allow for about 1000 years of randomness. + ts.Nano = time.Unix(c.Rand.Int63n(1000*365*24*60*60), c.Rand.Int63n(1000000000)).UnixNano() +} + +var _ fuzz.Interface = &Timestamp{} + +// String formats the timestamp after shifting into UTC +func (ts Timestamp) String() string { + utc := ts.Time().In(time.UTC) + return utc.Format(MetaTimestampFormat) +} + +// MetaTimestampFormat is the format used by Timestamp::String() +const MetaTimestampFormat = time.RFC3339Nano + +// Time converts to a time.Time +func (ts Timestamp) Time() time.Time { + return time.Unix(0, ts.Nano) +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // NetworkAttachmentList is a list of NetworkAttachment objects. @@ -172,15 +370,30 @@ func (x *ExecReport) Equiv(y *ExecReport) bool { x.StopTime.Time.Truncate(time.Second).Equal(y.StopTime.Time.Truncate(time.Second)) } +// The ExtendedObjectMeta sections for a NetworkAttachment +const ( + NASectionSpec = "spec" + NASectionAddr = "status.address" + NASectionImpl = "status.impl" + NASectionExecReport = "status.execReport" +) + // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// NetworkAttachment is about a Linux network interface connected to a +// Subnet. The sections recorded in ExtendedObjectMeta are: spec, +// status.address, status.impl, status.execReport. type NetworkAttachment struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // `extendedMetadata` adds non-standard object metadata + // +optional + ExtendedObjectMeta `json:"extendedMetadata,omitempty" protobuf:"bytes,4,opt,name=extendedMetadata"` + Spec NetworkAttachmentSpec `json:"spec" protobuf:"bytes,2,name=spec"` // +optional @@ -226,15 +439,27 @@ type SubnetStatus struct { Errors []string `json:"errors,omitempty" protobuf:"bytes,2,opt,name=errors" patchStrategy:"replace"` } +// The ExtendedObjectMeta sections for a Subnet +const ( + SubnetSectionSpec = "spec" + SubnetSectionStatus = "status" +) + // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Subnet is about an IP subnet on a virtual network. For +// ExtendedObjectMeta the sections are: spec, status. type Subnet struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // `extendedMetadata` adds non-standard object metadata + // +optional + ExtendedObjectMeta `json:"extendedMetadata,omitempty" protobuf:"bytes,4,opt,name=extendedMetadata"` + Spec SubnetSpec `json:"spec" protobuf:"bytes,2,name=spec"` // +optional diff --git a/staging/kos/pkg/apis/network/v1alpha1/zz_generated.conversion.go b/staging/kos/pkg/apis/network/v1alpha1/zz_generated.conversion.go index 09c41994f..c5b1cfa4f 100644 --- a/staging/kos/pkg/apis/network/v1alpha1/zz_generated.conversion.go +++ b/staging/kos/pkg/apis/network/v1alpha1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,6 +45,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*ExtendedObjectMeta)(nil), (*network.ExtendedObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ExtendedObjectMeta_To_network_ExtendedObjectMeta(a.(*ExtendedObjectMeta), b.(*network.ExtendedObjectMeta), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*network.ExtendedObjectMeta)(nil), (*ExtendedObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_network_ExtendedObjectMeta_To_v1alpha1_ExtendedObjectMeta(a.(*network.ExtendedObjectMeta), b.(*ExtendedObjectMeta), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*IPLock)(nil), (*network.IPLock)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_IPLock_To_network_IPLock(a.(*IPLock), b.(*network.IPLock), scope) }); err != nil { @@ -125,6 +135,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*ObjectWrite)(nil), (*network.ObjectWrite)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ObjectWrite_To_network_ObjectWrite(a.(*ObjectWrite), b.(*network.ObjectWrite), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*network.ObjectWrite)(nil), (*ObjectWrite)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_network_ObjectWrite_To_v1alpha1_ObjectWrite(a.(*network.ObjectWrite), b.(*ObjectWrite), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*Subnet)(nil), (*network.Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_Subnet_To_network_Subnet(a.(*Subnet), b.(*network.Subnet), scope) }); err != nil { @@ -165,6 +185,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*Timestamp)(nil), (*network.Timestamp)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Timestamp_To_network_Timestamp(a.(*Timestamp), b.(*network.Timestamp), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*network.Timestamp)(nil), (*Timestamp)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_network_Timestamp_To_v1alpha1_Timestamp(a.(*network.Timestamp), b.(*Timestamp), scope) + }); err != nil { + return err + } return nil } @@ -198,6 +228,26 @@ func Convert_network_ExecReport_To_v1alpha1_ExecReport(in *network.ExecReport, o return autoConvert_network_ExecReport_To_v1alpha1_ExecReport(in, out, s) } +func autoConvert_v1alpha1_ExtendedObjectMeta_To_network_ExtendedObjectMeta(in *ExtendedObjectMeta, out *network.ExtendedObjectMeta, s conversion.Scope) error { + out.Writes = *(*network.WriteSet)(unsafe.Pointer(&in.Writes)) + return nil +} + +// Convert_v1alpha1_ExtendedObjectMeta_To_network_ExtendedObjectMeta is an autogenerated conversion function. +func Convert_v1alpha1_ExtendedObjectMeta_To_network_ExtendedObjectMeta(in *ExtendedObjectMeta, out *network.ExtendedObjectMeta, s conversion.Scope) error { + return autoConvert_v1alpha1_ExtendedObjectMeta_To_network_ExtendedObjectMeta(in, out, s) +} + +func autoConvert_network_ExtendedObjectMeta_To_v1alpha1_ExtendedObjectMeta(in *network.ExtendedObjectMeta, out *ExtendedObjectMeta, s conversion.Scope) error { + out.Writes = *(*WriteSet)(unsafe.Pointer(&in.Writes)) + return nil +} + +// Convert_network_ExtendedObjectMeta_To_v1alpha1_ExtendedObjectMeta is an autogenerated conversion function. +func Convert_network_ExtendedObjectMeta_To_v1alpha1_ExtendedObjectMeta(in *network.ExtendedObjectMeta, out *ExtendedObjectMeta, s conversion.Scope) error { + return autoConvert_network_ExtendedObjectMeta_To_v1alpha1_ExtendedObjectMeta(in, out, s) +} + func autoConvert_v1alpha1_IPLock_To_network_IPLock(in *IPLock, out *network.IPLock, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1alpha1_IPLockSpec_To_network_IPLockSpec(&in.Spec, &out.Spec, s); err != nil { @@ -268,6 +318,9 @@ func Convert_network_IPLockSpec_To_v1alpha1_IPLockSpec(in *network.IPLockSpec, o func autoConvert_v1alpha1_NetworkAttachment_To_network_NetworkAttachment(in *NetworkAttachment, out *network.NetworkAttachment, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha1_ExtendedObjectMeta_To_network_ExtendedObjectMeta(&in.ExtendedObjectMeta, &out.ExtendedObjectMeta, s); err != nil { + return err + } if err := Convert_v1alpha1_NetworkAttachmentSpec_To_network_NetworkAttachmentSpec(&in.Spec, &out.Spec, s); err != nil { return err } @@ -284,6 +337,9 @@ func Convert_v1alpha1_NetworkAttachment_To_network_NetworkAttachment(in *Network func autoConvert_network_NetworkAttachment_To_v1alpha1_NetworkAttachment(in *network.NetworkAttachment, out *NetworkAttachment, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta + if err := Convert_network_ExtendedObjectMeta_To_v1alpha1_ExtendedObjectMeta(&in.ExtendedObjectMeta, &out.ExtendedObjectMeta, s); err != nil { + return err + } if err := Convert_network_NetworkAttachmentSpec_To_v1alpha1_NetworkAttachmentSpec(&in.Spec, &out.Spec, s); err != nil { return err } @@ -406,8 +462,37 @@ func Convert_network_NetworkAttachmentStatus_To_v1alpha1_NetworkAttachmentStatus return autoConvert_network_NetworkAttachmentStatus_To_v1alpha1_NetworkAttachmentStatus(in, out, s) } +func autoConvert_v1alpha1_ObjectWrite_To_network_ObjectWrite(in *ObjectWrite, out *network.ObjectWrite, s conversion.Scope) error { + out.Section = in.Section + if err := Convert_v1alpha1_Timestamp_To_network_Timestamp(&in.ServerTime, &out.ServerTime, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha1_ObjectWrite_To_network_ObjectWrite is an autogenerated conversion function. +func Convert_v1alpha1_ObjectWrite_To_network_ObjectWrite(in *ObjectWrite, out *network.ObjectWrite, s conversion.Scope) error { + return autoConvert_v1alpha1_ObjectWrite_To_network_ObjectWrite(in, out, s) +} + +func autoConvert_network_ObjectWrite_To_v1alpha1_ObjectWrite(in *network.ObjectWrite, out *ObjectWrite, s conversion.Scope) error { + out.Section = in.Section + if err := Convert_network_Timestamp_To_v1alpha1_Timestamp(&in.ServerTime, &out.ServerTime, s); err != nil { + return err + } + return nil +} + +// Convert_network_ObjectWrite_To_v1alpha1_ObjectWrite is an autogenerated conversion function. +func Convert_network_ObjectWrite_To_v1alpha1_ObjectWrite(in *network.ObjectWrite, out *ObjectWrite, s conversion.Scope) error { + return autoConvert_network_ObjectWrite_To_v1alpha1_ObjectWrite(in, out, s) +} + func autoConvert_v1alpha1_Subnet_To_network_Subnet(in *Subnet, out *network.Subnet, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha1_ExtendedObjectMeta_To_network_ExtendedObjectMeta(&in.ExtendedObjectMeta, &out.ExtendedObjectMeta, s); err != nil { + return err + } if err := Convert_v1alpha1_SubnetSpec_To_network_SubnetSpec(&in.Spec, &out.Spec, s); err != nil { return err } @@ -424,6 +509,9 @@ func Convert_v1alpha1_Subnet_To_network_Subnet(in *Subnet, out *network.Subnet, func autoConvert_network_Subnet_To_v1alpha1_Subnet(in *network.Subnet, out *Subnet, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta + if err := Convert_network_ExtendedObjectMeta_To_v1alpha1_ExtendedObjectMeta(&in.ExtendedObjectMeta, &out.ExtendedObjectMeta, s); err != nil { + return err + } if err := Convert_network_SubnetSpec_To_v1alpha1_SubnetSpec(&in.Spec, &out.Spec, s); err != nil { return err } @@ -503,3 +591,23 @@ func autoConvert_network_SubnetStatus_To_v1alpha1_SubnetStatus(in *network.Subne func Convert_network_SubnetStatus_To_v1alpha1_SubnetStatus(in *network.SubnetStatus, out *SubnetStatus, s conversion.Scope) error { return autoConvert_network_SubnetStatus_To_v1alpha1_SubnetStatus(in, out, s) } + +func autoConvert_v1alpha1_Timestamp_To_network_Timestamp(in *Timestamp, out *network.Timestamp, s conversion.Scope) error { + out.Nano = in.Nano + return nil +} + +// Convert_v1alpha1_Timestamp_To_network_Timestamp is an autogenerated conversion function. +func Convert_v1alpha1_Timestamp_To_network_Timestamp(in *Timestamp, out *network.Timestamp, s conversion.Scope) error { + return autoConvert_v1alpha1_Timestamp_To_network_Timestamp(in, out, s) +} + +func autoConvert_network_Timestamp_To_v1alpha1_Timestamp(in *network.Timestamp, out *Timestamp, s conversion.Scope) error { + out.Nano = in.Nano + return nil +} + +// Convert_network_Timestamp_To_v1alpha1_Timestamp is an autogenerated conversion function. +func Convert_network_Timestamp_To_v1alpha1_Timestamp(in *network.Timestamp, out *Timestamp, s conversion.Scope) error { + return autoConvert_network_Timestamp_To_v1alpha1_Timestamp(in, out, s) +} diff --git a/staging/kos/pkg/apis/network/v1alpha1/zz_generated.deepcopy.go b/staging/kos/pkg/apis/network/v1alpha1/zz_generated.deepcopy.go index 312532c8a..f042465fd 100644 --- a/staging/kos/pkg/apis/network/v1alpha1/zz_generated.deepcopy.go +++ b/staging/kos/pkg/apis/network/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -47,6 +47,27 @@ func (in *ExecReport) DeepCopy() *ExecReport { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtendedObjectMeta) DeepCopyInto(out *ExtendedObjectMeta) { + *out = *in + if in.Writes != nil { + in, out := &in.Writes, &out.Writes + *out = make(WriteSet, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtendedObjectMeta. +func (in *ExtendedObjectMeta) DeepCopy() *ExtendedObjectMeta { + if in == nil { + return nil + } + out := new(ExtendedObjectMeta) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IPLock) DeepCopyInto(out *IPLock) { *out = *in @@ -128,6 +149,7 @@ func (in *NetworkAttachment) DeepCopyInto(out *NetworkAttachment) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.ExtendedObjectMeta.DeepCopyInto(&out.ExtendedObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return @@ -258,11 +280,29 @@ func (in *NetworkAttachmentStatus) DeepCopy() *NetworkAttachmentStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectWrite) DeepCopyInto(out *ObjectWrite) { + *out = *in + out.ServerTime = in.ServerTime + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectWrite. +func (in *ObjectWrite) DeepCopy() *ObjectWrite { + if in == nil { + return nil + } + out := new(ObjectWrite) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Subnet) DeepCopyInto(out *Subnet) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.ExtendedObjectMeta.DeepCopyInto(&out.ExtendedObjectMeta) out.Spec = in.Spec in.Status.DeepCopyInto(&out.Status) return @@ -355,3 +395,39 @@ func (in *SubnetStatus) DeepCopy() *SubnetStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Timestamp) DeepCopyInto(out *Timestamp) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Timestamp. +func (in *Timestamp) DeepCopy() *Timestamp { + if in == nil { + return nil + } + out := new(Timestamp) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in WriteSet) DeepCopyInto(out *WriteSet) { + { + in := &in + *out = make(WriteSet, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WriteSet. +func (in WriteSet) DeepCopy() WriteSet { + if in == nil { + return nil + } + out := new(WriteSet) + in.DeepCopyInto(out) + return *out +} diff --git a/staging/kos/pkg/apis/network/v1alpha1/zz_generated.defaults.go b/staging/kos/pkg/apis/network/v1alpha1/zz_generated.defaults.go index 19cace50a..843ec79ac 100644 --- a/staging/kos/pkg/apis/network/v1alpha1/zz_generated.defaults.go +++ b/staging/kos/pkg/apis/network/v1alpha1/zz_generated.defaults.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/apis/network/zz_generated.deepcopy.go b/staging/kos/pkg/apis/network/zz_generated.deepcopy.go index a4a7f4c84..beb6f5c9c 100644 --- a/staging/kos/pkg/apis/network/zz_generated.deepcopy.go +++ b/staging/kos/pkg/apis/network/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -47,6 +47,27 @@ func (in *ExecReport) DeepCopy() *ExecReport { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtendedObjectMeta) DeepCopyInto(out *ExtendedObjectMeta) { + *out = *in + if in.Writes != nil { + in, out := &in.Writes, &out.Writes + *out = make(WriteSet, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtendedObjectMeta. +func (in *ExtendedObjectMeta) DeepCopy() *ExtendedObjectMeta { + if in == nil { + return nil + } + out := new(ExtendedObjectMeta) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IPLock) DeepCopyInto(out *IPLock) { *out = *in @@ -128,6 +149,7 @@ func (in *NetworkAttachment) DeepCopyInto(out *NetworkAttachment) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.ExtendedObjectMeta.DeepCopyInto(&out.ExtendedObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return @@ -258,11 +280,29 @@ func (in *NetworkAttachmentStatus) DeepCopy() *NetworkAttachmentStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectWrite) DeepCopyInto(out *ObjectWrite) { + *out = *in + out.ServerTime = in.ServerTime + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectWrite. +func (in *ObjectWrite) DeepCopy() *ObjectWrite { + if in == nil { + return nil + } + out := new(ObjectWrite) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Subnet) DeepCopyInto(out *Subnet) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.ExtendedObjectMeta.DeepCopyInto(&out.ExtendedObjectMeta) out.Spec = in.Spec in.Status.DeepCopyInto(&out.Status) return @@ -355,3 +395,39 @@ func (in *SubnetStatus) DeepCopy() *SubnetStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Timestamp) DeepCopyInto(out *Timestamp) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Timestamp. +func (in *Timestamp) DeepCopy() *Timestamp { + if in == nil { + return nil + } + out := new(Timestamp) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in WriteSet) DeepCopyInto(out *WriteSet) { + { + in := &in + *out = make(WriteSet, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WriteSet. +func (in WriteSet) DeepCopy() WriteSet { + if in == nil { + return nil + } + out := new(WriteSet) + in.DeepCopyInto(out) + return *out +} diff --git a/staging/kos/pkg/client/clientset/internalversion/clientset.go b/staging/kos/pkg/client/clientset/internalversion/clientset.go index f2ad07ada..7868c614a 100644 --- a/staging/kos/pkg/client/clientset/internalversion/clientset.go +++ b/staging/kos/pkg/client/clientset/internalversion/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/doc.go b/staging/kos/pkg/client/clientset/internalversion/doc.go index c08746a77..e96cc3301 100644 --- a/staging/kos/pkg/client/clientset/internalversion/doc.go +++ b/staging/kos/pkg/client/clientset/internalversion/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/fake/clientset_generated.go b/staging/kos/pkg/client/clientset/internalversion/fake/clientset_generated.go index 110a6966e..827fdadf8 100644 --- a/staging/kos/pkg/client/clientset/internalversion/fake/clientset_generated.go +++ b/staging/kos/pkg/client/clientset/internalversion/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/fake/doc.go b/staging/kos/pkg/client/clientset/internalversion/fake/doc.go index acfa6173b..d6baf01ac 100644 --- a/staging/kos/pkg/client/clientset/internalversion/fake/doc.go +++ b/staging/kos/pkg/client/clientset/internalversion/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/fake/register.go b/staging/kos/pkg/client/clientset/internalversion/fake/register.go index f7eadb11d..9d19577cd 100644 --- a/staging/kos/pkg/client/clientset/internalversion/fake/register.go +++ b/staging/kos/pkg/client/clientset/internalversion/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/scheme/doc.go b/staging/kos/pkg/client/clientset/internalversion/scheme/doc.go index 7f61dc1f9..7d06c9402 100644 --- a/staging/kos/pkg/client/clientset/internalversion/scheme/doc.go +++ b/staging/kos/pkg/client/clientset/internalversion/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/scheme/register.go b/staging/kos/pkg/client/clientset/internalversion/scheme/register.go index f1c265724..34a9e1890 100644 --- a/staging/kos/pkg/client/clientset/internalversion/scheme/register.go +++ b/staging/kos/pkg/client/clientset/internalversion/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/doc.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/doc.go index e16889135..c6f18dc80 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/doc.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/doc.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/doc.go index ab4fd43ad..0243e68ff 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/doc.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_iplock.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_iplock.go index 07c3b3ee1..174eee596 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_iplock.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_iplock.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_network_client.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_network_client.go index 5df88d222..88f1eb02f 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_network_client.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_network_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_networkattachment.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_networkattachment.go index 405246c5c..5522c2b9e 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_networkattachment.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_networkattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_subnet.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_subnet.go index 9d0cdd16e..01a8dca4d 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_subnet.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/fake/fake_subnet.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/generated_expansion.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/generated_expansion.go index ea582f00d..b12672964 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/generated_expansion.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/iplock.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/iplock.go index a1ba5b10b..9cf77e674 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/iplock.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/iplock.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/network_client.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/network_client.go index df51648c5..0ae2225c7 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/network_client.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/network_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/networkattachment.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/networkattachment.go index 57407f808..8e314a427 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/networkattachment.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/networkattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/subnet.go b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/subnet.go index cd7917599..be0de2102 100644 --- a/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/subnet.go +++ b/staging/kos/pkg/client/clientset/internalversion/typed/network/internalversion/subnet.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/clientset.go b/staging/kos/pkg/client/clientset/versioned/clientset.go index 21b73e9de..12563b2fc 100644 --- a/staging/kos/pkg/client/clientset/versioned/clientset.go +++ b/staging/kos/pkg/client/clientset/versioned/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/doc.go b/staging/kos/pkg/client/clientset/versioned/doc.go index dc992b90b..6ee812fc5 100644 --- a/staging/kos/pkg/client/clientset/versioned/doc.go +++ b/staging/kos/pkg/client/clientset/versioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/fake/clientset_generated.go b/staging/kos/pkg/client/clientset/versioned/fake/clientset_generated.go index d5071921a..e930c5223 100644 --- a/staging/kos/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/staging/kos/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/fake/doc.go b/staging/kos/pkg/client/clientset/versioned/fake/doc.go index acfa6173b..d6baf01ac 100644 --- a/staging/kos/pkg/client/clientset/versioned/fake/doc.go +++ b/staging/kos/pkg/client/clientset/versioned/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/fake/register.go b/staging/kos/pkg/client/clientset/versioned/fake/register.go index 8904a7094..92a3f5c75 100644 --- a/staging/kos/pkg/client/clientset/versioned/fake/register.go +++ b/staging/kos/pkg/client/clientset/versioned/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/scheme/doc.go b/staging/kos/pkg/client/clientset/versioned/scheme/doc.go index 7f61dc1f9..7d06c9402 100644 --- a/staging/kos/pkg/client/clientset/versioned/scheme/doc.go +++ b/staging/kos/pkg/client/clientset/versioned/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/scheme/register.go b/staging/kos/pkg/client/clientset/versioned/scheme/register.go index 4e872a508..53f68209a 100644 --- a/staging/kos/pkg/client/clientset/versioned/scheme/register.go +++ b/staging/kos/pkg/client/clientset/versioned/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/doc.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/doc.go index 9752e759c..54eabf945 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/doc.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/doc.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/doc.go index ab4fd43ad..0243e68ff 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/doc.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_iplock.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_iplock.go index 0a48493d5..2501881cb 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_iplock.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_iplock.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go index d10654c81..c05064c9b 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_networkattachment.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_networkattachment.go index df674f406..86df8ac18 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_networkattachment.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_networkattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_subnet.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_subnet.go index 8846d3fdc..6d7265edc 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_subnet.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_subnet.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/generated_expansion.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/generated_expansion.go index b9f303664..3b54466c0 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/generated_expansion.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/iplock.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/iplock.go index 13881dacc..d6693178e 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/iplock.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/iplock.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/network_client.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/network_client.go index 00bcd6bfa..eec83e012 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/network_client.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/network_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/networkattachment.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/networkattachment.go index 844ba939a..74fc1d3be 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/networkattachment.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/networkattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/subnet.go b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/subnet.go index e1c79d21c..c613f7be3 100644 --- a/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/subnet.go +++ b/staging/kos/pkg/client/clientset/versioned/typed/network/v1alpha1/subnet.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/externalversions/factory.go b/staging/kos/pkg/client/informers/externalversions/factory.go index b6c87b770..87db4e8ae 100644 --- a/staging/kos/pkg/client/informers/externalversions/factory.go +++ b/staging/kos/pkg/client/informers/externalversions/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/externalversions/generic.go b/staging/kos/pkg/client/informers/externalversions/generic.go index 60d470711..0ceeda6ad 100644 --- a/staging/kos/pkg/client/informers/externalversions/generic.go +++ b/staging/kos/pkg/client/informers/externalversions/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/staging/kos/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index c99664550..f2dbbc8f2 100644 --- a/staging/kos/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/staging/kos/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/externalversions/network/interface.go b/staging/kos/pkg/client/informers/externalversions/network/interface.go index 77d07cf69..ad1ad94e4 100644 --- a/staging/kos/pkg/client/informers/externalversions/network/interface.go +++ b/staging/kos/pkg/client/informers/externalversions/network/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/interface.go b/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/interface.go index e2bc99046..3d72d7a66 100644 --- a/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/interface.go +++ b/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/iplock.go b/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/iplock.go index 501bcb967..3be0d590c 100644 --- a/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/iplock.go +++ b/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/iplock.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/networkattachment.go b/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/networkattachment.go index 6ca67457b..fd7628251 100644 --- a/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/networkattachment.go +++ b/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/networkattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/subnet.go b/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/subnet.go index bf026c67a..013247530 100644 --- a/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/subnet.go +++ b/staging/kos/pkg/client/informers/externalversions/network/v1alpha1/subnet.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/internalversion/factory.go b/staging/kos/pkg/client/informers/internalversion/factory.go index 3ccabed12..83ef95df6 100644 --- a/staging/kos/pkg/client/informers/internalversion/factory.go +++ b/staging/kos/pkg/client/informers/internalversion/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/internalversion/generic.go b/staging/kos/pkg/client/informers/internalversion/generic.go index be7821f78..872f48abd 100644 --- a/staging/kos/pkg/client/informers/internalversion/generic.go +++ b/staging/kos/pkg/client/informers/internalversion/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/internalversion/internalinterfaces/factory_interfaces.go b/staging/kos/pkg/client/informers/internalversion/internalinterfaces/factory_interfaces.go index 4bfe39dfd..9a43d2c69 100644 --- a/staging/kos/pkg/client/informers/internalversion/internalinterfaces/factory_interfaces.go +++ b/staging/kos/pkg/client/informers/internalversion/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/internalversion/network/interface.go b/staging/kos/pkg/client/informers/internalversion/network/interface.go index 268646971..68dc946f9 100644 --- a/staging/kos/pkg/client/informers/internalversion/network/interface.go +++ b/staging/kos/pkg/client/informers/internalversion/network/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/internalversion/network/internalversion/interface.go b/staging/kos/pkg/client/informers/internalversion/network/internalversion/interface.go index 43373d5f9..49b1b0d4e 100644 --- a/staging/kos/pkg/client/informers/internalversion/network/internalversion/interface.go +++ b/staging/kos/pkg/client/informers/internalversion/network/internalversion/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/internalversion/network/internalversion/iplock.go b/staging/kos/pkg/client/informers/internalversion/network/internalversion/iplock.go index a5c7b9286..e37a189f6 100644 --- a/staging/kos/pkg/client/informers/internalversion/network/internalversion/iplock.go +++ b/staging/kos/pkg/client/informers/internalversion/network/internalversion/iplock.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/internalversion/network/internalversion/networkattachment.go b/staging/kos/pkg/client/informers/internalversion/network/internalversion/networkattachment.go index 9ba8912fb..d761e6d26 100644 --- a/staging/kos/pkg/client/informers/internalversion/network/internalversion/networkattachment.go +++ b/staging/kos/pkg/client/informers/internalversion/network/internalversion/networkattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/informers/internalversion/network/internalversion/subnet.go b/staging/kos/pkg/client/informers/internalversion/network/internalversion/subnet.go index fa8f29b65..00d8709bc 100644 --- a/staging/kos/pkg/client/informers/internalversion/network/internalversion/subnet.go +++ b/staging/kos/pkg/client/informers/internalversion/network/internalversion/subnet.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/listers/network/internalversion/expansion_generated.go b/staging/kos/pkg/client/listers/network/internalversion/expansion_generated.go index 354dc428f..7c962aedd 100644 --- a/staging/kos/pkg/client/listers/network/internalversion/expansion_generated.go +++ b/staging/kos/pkg/client/listers/network/internalversion/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/listers/network/internalversion/iplock.go b/staging/kos/pkg/client/listers/network/internalversion/iplock.go index 0caadf056..f2379ac93 100644 --- a/staging/kos/pkg/client/listers/network/internalversion/iplock.go +++ b/staging/kos/pkg/client/listers/network/internalversion/iplock.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/listers/network/internalversion/networkattachment.go b/staging/kos/pkg/client/listers/network/internalversion/networkattachment.go index 0ac24d4dc..29424d244 100644 --- a/staging/kos/pkg/client/listers/network/internalversion/networkattachment.go +++ b/staging/kos/pkg/client/listers/network/internalversion/networkattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/listers/network/internalversion/subnet.go b/staging/kos/pkg/client/listers/network/internalversion/subnet.go index f8b9eff35..69d982e2f 100644 --- a/staging/kos/pkg/client/listers/network/internalversion/subnet.go +++ b/staging/kos/pkg/client/listers/network/internalversion/subnet.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/listers/network/v1alpha1/expansion_generated.go b/staging/kos/pkg/client/listers/network/v1alpha1/expansion_generated.go index 31936a016..d84984324 100644 --- a/staging/kos/pkg/client/listers/network/v1alpha1/expansion_generated.go +++ b/staging/kos/pkg/client/listers/network/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/listers/network/v1alpha1/iplock.go b/staging/kos/pkg/client/listers/network/v1alpha1/iplock.go index 1582e124f..7cc537700 100644 --- a/staging/kos/pkg/client/listers/network/v1alpha1/iplock.go +++ b/staging/kos/pkg/client/listers/network/v1alpha1/iplock.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/listers/network/v1alpha1/networkattachment.go b/staging/kos/pkg/client/listers/network/v1alpha1/networkattachment.go index fc60f6454..78b2c7d21 100644 --- a/staging/kos/pkg/client/listers/network/v1alpha1/networkattachment.go +++ b/staging/kos/pkg/client/listers/network/v1alpha1/networkattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/client/listers/network/v1alpha1/subnet.go b/staging/kos/pkg/client/listers/network/v1alpha1/subnet.go index f3a64e0a3..d72c1efe9 100644 --- a/staging/kos/pkg/client/listers/network/v1alpha1/subnet.go +++ b/staging/kos/pkg/client/listers/network/v1alpha1/subnet.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/staging/kos/pkg/controllers/connectionagent/connection_agent.go b/staging/kos/pkg/controllers/connectionagent/connection_agent.go index b82e25799..5a9ffb02b 100644 --- a/staging/kos/pkg/controllers/connectionagent/connection_agent.go +++ b/staging/kos/pkg/controllers/connectionagent/connection_agent.go @@ -252,6 +252,9 @@ type ConnectionAgent struct { // NetworkAttachment.CreationTimestamp to remote network interface creation latency attachmentCreateToRemoteIfcHistogram prometheus.Histogram + // NASectionImpl to remote network interface creation latency + localImplToRemoteIfcHistogram prometheus.Histogram + // Durations of calls on network fabric fabricLatencyHistograms *prometheus.HistogramVec @@ -297,6 +300,15 @@ func New(node string, Buckets: []float64{-0.125, 0, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 64, 128, 256}, ConstLabels: map[string]string{"node": node}, }) + localImplToRemoteIfcHistogram := prometheus.NewHistogram( + prometheus.HistogramOpts{ + Namespace: metricsNamespace, + Subsystem: metricsSubsystem, + Name: "attachment_impl_to_remote_ifc_latency_seconds", + Help: "Seconds from attachment NASectionImpl Timestamp to finished creating remote interface", + Buckets: []float64{-0.125, 0, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 64, 128, 256}, + ConstLabels: map[string]string{"node": node}, + }) fabricLatencyHistograms := prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: metricsNamespace, @@ -378,7 +390,7 @@ func New(node string, Help: "Number of queue worker threads", ConstLabels: map[string]string{"node": node}, }) - prometheus.MustRegister(attachmentCreateToLocalIfcHistogram, attachmentCreateToRemoteIfcHistogram, fabricLatencyHistograms, attachmentCreateToStatusHistogram, attachmentStatusHistograms, localAttachmentsGauge, remoteAttachmentsGauge, attachmentExecDurationHistograms, attachmentExecStatusCounts, fabricNameCounts, workerCount) + prometheus.MustRegister(attachmentCreateToLocalIfcHistogram, attachmentCreateToRemoteIfcHistogram, localImplToRemoteIfcHistogram, fabricLatencyHistograms, attachmentCreateToStatusHistogram, attachmentStatusHistograms, localAttachmentsGauge, remoteAttachmentsGauge, attachmentExecDurationHistograms, attachmentExecStatusCounts, fabricNameCounts, workerCount) fabricNameCounts.With(prometheus.Labels{"fabric": netFabric.Name()}).Inc() workerCount.Add(float64(workers)) @@ -409,6 +421,7 @@ func New(node string, allowedPrograms: allowedPrograms, attachmentCreateToLocalIfcHistogram: attachmentCreateToLocalIfcHistogram, attachmentCreateToRemoteIfcHistogram: attachmentCreateToRemoteIfcHistogram, + localImplToRemoteIfcHistogram: localImplToRemoteIfcHistogram, fabricLatencyHistograms: fabricLatencyHistograms, attachmentCreateToStatusHistogram: attachmentCreateToStatusHistogram, attachmentStatusHistograms: attachmentStatusHistograms, @@ -1057,7 +1070,7 @@ func (ca *ConnectionAgent) updateLocalAttachmentStatus(att *netv1a1.NetworkAttac updatedAtt.Status.PostCreateExecReport) if att.Status.HostIP == "" { - ca.attachmentCreateToStatusHistogram.Observe(tAfterUpdate.Truncate(time.Second).Sub(att.CreationTimestamp.Time).Seconds()) + ca.attachmentCreateToStatusHistogram.Observe(updatedAtt.Writes.GetServerWriteTime(netv1a1.NASectionAddr).Sub(att.Writes.GetServerWriteTime(netv1a1.NASectionSpec)).Seconds()) } return nil diff --git a/staging/kos/pkg/controllers/connectionagent/network_interface.go b/staging/kos/pkg/controllers/connectionagent/network_interface.go index 72aa3f3bc..bcb964aff 100644 --- a/staging/kos/pkg/controllers/connectionagent/network_interface.go +++ b/staging/kos/pkg/controllers/connectionagent/network_interface.go @@ -188,7 +188,7 @@ func (ca *ConnectionAgent) createLocalNetworkInterface(att *netv1a1.NetworkAttac if err == nil { statusErrs = ca.launchCommand(parse.AttNSN(att), ifc.LocalNetIfc, att.Spec.PostCreateExec, ifc.postCreateExecReport.Store, "postCreate", true) if att.Status.IfcName == "" { - ca.attachmentCreateToLocalIfcHistogram.Observe(tAfter.Truncate(time.Second).Sub(att.CreationTimestamp.Time).Seconds()) + ca.attachmentCreateToLocalIfcHistogram.Observe(tAfter.Sub(att.Writes.GetServerWriteTime(netv1a1.NASectionSpec).Time()).Seconds()) } ca.localAttachmentsGauge.Inc() ca.eventRecorder.Eventf(att, k8scorev1api.EventTypeNormal, "Implemented", "Created Linux network interface named %s with MAC address %s and IPv4 address %s", ifc.Name, ifc.GuestMAC, ifc.GuestIP) @@ -210,7 +210,8 @@ func (ca *ConnectionAgent) createRemoteNetworkInterface(att *netv1a1.NetworkAtta ca.fabricLatencyHistograms.With(prometheus.Labels{"op": "CreateRemoteIfc", "err": formatErrVal(err != nil)}).Observe(tAfter.Sub(tBefore).Seconds()) if err == nil { - ca.attachmentCreateToRemoteIfcHistogram.Observe(tAfter.Truncate(time.Second).Sub(att.CreationTimestamp.Time).Seconds()) + ca.attachmentCreateToRemoteIfcHistogram.Observe(tAfter.Sub(att.Writes.GetServerWriteTime(netv1a1.NASectionSpec).Time()).Seconds()) + ca.localImplToRemoteIfcHistogram.Observe(tAfter.Sub(att.Writes.GetServerWriteTime(netv1a1.NASectionImpl).Time()).Seconds()) ca.remoteAttachmentsGauge.Inc() } diff --git a/staging/kos/pkg/controllers/ipam/ipam.go b/staging/kos/pkg/controllers/ipam/ipam.go index 17fc7ee4c..45674ab8a 100644 --- a/staging/kos/pkg/controllers/ipam/ipam.go +++ b/staging/kos/pkg/controllers/ipam/ipam.go @@ -159,7 +159,7 @@ func NewController(netIfc kosclientv1a1.NetworkV1alpha1Interface, Subsystem: metricsSubsystem, Name: "attachment_create_to_address_latency_seconds", Help: "Latency from attachment CreationTimestamp to return from status update, in seconds", - Buckets: []float64{-1, 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 64}, + Buckets: []float64{-1, 0, 0.125, 0.25, 0.5, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 64}, }) attachmentUpdateHistograms := prometheus.NewHistogramVec( @@ -781,9 +781,7 @@ func (ctlr *IPAMController) updateNAStatus(ns, name string, att *netv1a1.Network tAfter := time.Now() ctlr.attachmentUpdateHistograms.With(prometheus.Labels{"statusErr": FormatErrVal(len(statusErrs) > 0), "err": FormatErrVal(err != nil)}).Observe(tAfter.Sub(tBefore).Seconds()) if err == nil { - t1 := att.CreationTimestamp.Time - t2 := tAfter.Truncate(time.Second) - deltaS := t2.Sub(t1).Seconds() + deltaS := att3.Writes.GetServerWriteTime(netv1a1.NASectionAddr).Sub(att.Writes.GetServerWriteTime(netv1a1.NASectionSpec)).Seconds() ctlr.attachmentCreateToAddressHistogram.Observe(deltaS) if len(statusErrs) > 0 { klog.V(4).Infof("Recorded errors %v in status of %s/%s, old ResourceVersion=%s, new ResourceVersion=%s", statusErrs, ns, name, att.ResourceVersion, att3.ResourceVersion) diff --git a/staging/kos/pkg/generated/openapi/zz_generated.openapi.go b/staging/kos/pkg/generated/openapi/zz_generated.openapi.go index b302f5984..1e1f3e60b 100644 --- a/staging/kos/pkg/generated/openapi/zz_generated.openapi.go +++ b/staging/kos/pkg/generated/openapi/zz_generated.openapi.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The Kubernetes Authors. +Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -84,6 +84,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.ExecReport": schema_pkg_apis_network_v1alpha1_ExecReport(ref), + "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.ExtendedObjectMeta": schema_pkg_apis_network_v1alpha1_ExtendedObjectMeta(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.IPLock": schema_pkg_apis_network_v1alpha1_IPLock(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.IPLockList": schema_pkg_apis_network_v1alpha1_IPLockList(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.IPLockSpec": schema_pkg_apis_network_v1alpha1_IPLockSpec(ref), @@ -92,10 +93,12 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.NetworkAttachmentList": schema_pkg_apis_network_v1alpha1_NetworkAttachmentList(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.NetworkAttachmentSpec": schema_pkg_apis_network_v1alpha1_NetworkAttachmentSpec(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.NetworkAttachmentStatus": schema_pkg_apis_network_v1alpha1_NetworkAttachmentStatus(ref), + "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.ObjectWrite": schema_pkg_apis_network_v1alpha1_ObjectWrite(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.Subnet": schema_pkg_apis_network_v1alpha1_Subnet(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.SubnetList": schema_pkg_apis_network_v1alpha1_SubnetList(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.SubnetSpec": schema_pkg_apis_network_v1alpha1_SubnetSpec(ref), "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.SubnetStatus": schema_pkg_apis_network_v1alpha1_SubnetStatus(ref), + "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.Timestamp": schema_pkg_apis_network_v1alpha1_Timestamp(ref), } } @@ -2460,6 +2463,40 @@ func schema_pkg_apis_network_v1alpha1_ExecReport(ref common.ReferenceCallback) c } } +func schema_pkg_apis_network_v1alpha1_ExtendedObjectMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ExtendedObjectMeta has extra metadata for an API object. This is maintained by the server, clients can not modify it.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "writes": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": "section", + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Writes identifies the latest write to each part of the object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.ObjectWrite"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.ObjectWrite"}, + } +} + func schema_pkg_apis_network_v1alpha1_IPLock(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -2569,7 +2606,8 @@ func schema_pkg_apis_network_v1alpha1_NetworkAttachment(ref common.ReferenceCall return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "NetworkAttachment is about a Linux network interface connected to a Subnet. The sections recorded in ExtendedObjectMeta are: spec, status.address, status.impl, status.execReport.", + Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { SchemaProps: spec.SchemaProps{ @@ -2590,6 +2628,12 @@ func schema_pkg_apis_network_v1alpha1_NetworkAttachment(ref common.ReferenceCall Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, + "extendedMetadata": { + SchemaProps: spec.SchemaProps{ + Description: "`extendedMetadata` adds non-standard object metadata", + Ref: ref("k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.ExtendedObjectMeta"), + }, + }, "spec": { SchemaProps: spec.SchemaProps{ Ref: ref("k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.NetworkAttachmentSpec"), @@ -2605,7 +2649,7 @@ func schema_pkg_apis_network_v1alpha1_NetworkAttachment(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.NetworkAttachmentSpec", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.NetworkAttachmentStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.ExtendedObjectMeta", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.NetworkAttachmentSpec", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.NetworkAttachmentStatus"}, } } @@ -2838,11 +2882,41 @@ func schema_pkg_apis_network_v1alpha1_NetworkAttachmentStatus(ref common.Referen } } +func schema_pkg_apis_network_v1alpha1_ObjectWrite(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ObjectWrite describes a write to part of an object", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "section": { + SchemaProps: spec.SchemaProps{ + Description: "Section identifies the part of the object that was written. Each type of object is broken down into a type-specific set of sections.", + Type: []string{"string"}, + Format: "", + }, + }, + "serverTime": { + SchemaProps: spec.SchemaProps{ + Description: "ServerTime is the time when the write was recorded at the apiserver", + Ref: ref("k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.Timestamp"), + }, + }, + }, + Required: []string{"section", "serverTime"}, + }, + }, + Dependencies: []string{ + "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.Timestamp"}, + } +} + func schema_pkg_apis_network_v1alpha1_Subnet(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "Subnet is about an IP subnet on a virtual network. For ExtendedObjectMeta the sections are: spec, status.", + Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { SchemaProps: spec.SchemaProps{ @@ -2863,6 +2937,12 @@ func schema_pkg_apis_network_v1alpha1_Subnet(ref common.ReferenceCallback) commo Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, + "extendedMetadata": { + SchemaProps: spec.SchemaProps{ + Description: "`extendedMetadata` adds non-standard object metadata", + Ref: ref("k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.ExtendedObjectMeta"), + }, + }, "spec": { SchemaProps: spec.SchemaProps{ Ref: ref("k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.SubnetSpec"), @@ -2878,7 +2958,7 @@ func schema_pkg_apis_network_v1alpha1_Subnet(ref common.ReferenceCallback) commo }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.SubnetSpec", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.SubnetStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.ExtendedObjectMeta", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.SubnetSpec", "k8s.io/examples/staging/kos/pkg/apis/network/v1alpha1.SubnetStatus"}, } } @@ -2994,3 +3074,24 @@ func schema_pkg_apis_network_v1alpha1_SubnetStatus(ref common.ReferenceCallback) }, } } + +func schema_pkg_apis_network_v1alpha1_Timestamp(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Timestamp records a time and is not truncated when marshalled. A Timestamp does not record a location but is unambiguous; it is the number of nanoseconds since Jan 1, 1970 began in Greenwich, UK.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nano": { + SchemaProps: spec.SchemaProps{ + Description: "Nano is that number.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"nano"}, + }, + }, + } +} diff --git a/staging/kos/pkg/registry/network/networkattachment/strategy.go b/staging/kos/pkg/registry/network/networkattachment/strategy.go index 1c58d9eb6..3fe3b651c 100644 --- a/staging/kos/pkg/registry/network/networkattachment/strategy.go +++ b/staging/kos/pkg/registry/network/networkattachment/strategy.go @@ -87,10 +87,40 @@ func (networkattachmentStrategy) NamespaceScoped() bool { func (networkattachmentStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { na := obj.(*network.NetworkAttachment) + na.ExtendedObjectMeta = network.ExtendedObjectMeta{} + na.Writes = na.Writes.SetWrite(network.NASectionSpec, network.Now()) na.Status = network.NetworkAttachmentStatus{} } func (networkattachmentStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { + oldNA := old.(*network.NetworkAttachment) + newNA := obj.(*network.NetworkAttachment) + newNA.ExtendedObjectMeta = oldNA.ExtendedObjectMeta + now := network.Now() + if oldNA.Spec.Node != newNA.Spec.Node || oldNA.Spec.Subnet != newNA.Spec.Subnet || !SliceOfStringEqual(oldNA.Spec.PostCreateExec, newNA.Spec.PostCreateExec) || !SliceOfStringEqual(oldNA.Spec.PostDeleteExec, newNA.Spec.PostDeleteExec) { + newNA.Writes = newNA.Writes.SetWrite(network.NASectionSpec, now) + } + if oldNA.Status.LockUID != newNA.Status.LockUID || oldNA.Status.AddressVNI != newNA.Status.AddressVNI || oldNA.Status.IPv4 != newNA.Status.IPv4 || !SliceOfStringEqual(oldNA.Status.Errors.IPAM, newNA.Status.Errors.IPAM) { + newNA.Writes = newNA.Writes.SetWrite(network.NASectionAddr, now) + } + if oldNA.Status.MACAddress != newNA.Status.MACAddress || oldNA.Status.IfcName != newNA.Status.IfcName || oldNA.Status.HostIP != newNA.Status.HostIP || !SliceOfStringEqual(oldNA.Status.Errors.Host, newNA.Status.Errors.Host) { + newNA.Writes = newNA.Writes.SetWrite(network.NASectionImpl, now) + } + if !oldNA.Status.PostCreateExecReport.Equiv(newNA.Status.PostCreateExecReport) { + newNA.Writes = newNA.Writes.SetWrite(network.NASectionExecReport, now) + } +} + +func SliceOfStringEqual(x, y []string) bool { + if len(x) != len(y) { + return false + } + for i, xi := range x { + if xi != y[i] { + return false + } + } + return true } func (networkattachmentStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { diff --git a/staging/kos/pkg/registry/network/subnet/strategy.go b/staging/kos/pkg/registry/network/subnet/strategy.go index 5dddff39f..6374624c1 100644 --- a/staging/kos/pkg/registry/network/subnet/strategy.go +++ b/staging/kos/pkg/registry/network/subnet/strategy.go @@ -97,10 +97,34 @@ func (*subnetStrategy) NamespaceScoped() bool { func (*subnetStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { subnet := obj.(*network.Subnet) + subnet.ExtendedObjectMeta = network.ExtendedObjectMeta{} + subnet.Writes = subnet.Writes.SetWrite(network.SubnetSectionSpec, network.Now()) subnet.Status = network.SubnetStatus{} } func (*subnetStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { + oldSubnet := old.(*network.Subnet) + newSubnet := obj.(*network.Subnet) + newSubnet.ExtendedObjectMeta = oldSubnet.ExtendedObjectMeta + now := network.Now() + if newSubnet.Spec != oldSubnet.Spec { + newSubnet.Writes = newSubnet.Writes.SetWrite(network.SubnetSectionSpec, now) + } + if newSubnet.Status.Validated != oldSubnet.Status.Validated || !SliceOfStringEqual(newSubnet.Status.Errors, oldSubnet.Status.Errors) { + newSubnet.Writes = newSubnet.Writes.SetWrite(network.SubnetSectionStatus, now) + } +} + +func SliceOfStringEqual(x, y []string) bool { + if len(x) != len(y) { + return false + } + for i, xi := range x { + if xi != y[i] { + return false + } + } + return true } func (ss *subnetStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {