layer1: add namespace event bridge step 18
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package utils
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
NamespacePartStateRegistering string = "registering"
|
||||
@@ -77,6 +81,13 @@ func ManagedNamespaceEvent(eventType NamespaceEventType, name string, source Nam
|
||||
}, source, observedAt)
|
||||
}
|
||||
|
||||
func NamespaceEventFromNamespace(eventType NamespaceEventType, namespace *corev1.Namespace, source NamespaceSource, observedAt time.Time) NamespaceEvent {
|
||||
if namespace == nil {
|
||||
return NewNamespaceEvent(eventType, "", nil, source, observedAt)
|
||||
}
|
||||
return NewNamespaceEvent(eventType, namespace.Name, namespace.Labels, source, observedAt)
|
||||
}
|
||||
|
||||
func (nr NamespaceRecord) Clone() NamespaceRecord {
|
||||
clone := nr
|
||||
clone.Labels = cloneStringMap(nr.Labels)
|
||||
|
||||
Reference in New Issue
Block a user