INNER CODE UNIT · Go

func

jtblin/kube2iam · namespace.go:16

func (h *NamespaceHandler) namespaceFields(ns *v1.Namespace) log.Fields {
	return log.Fields{
		"ns.name": ns.GetName(),
	}
}

// OnAdd called with a namespace is added to k8s.
func (h *NamespaceHandler) OnAdd(obj interface{}, isInInitialList bool) {
	ns, ok := obj.(*v1.Namespace)
	if !ok {
		log.Errorf("Expected Namespace but OnAdd handler received %+v", obj)
		return
	}

	logger := log.WithFields(h.namespaceFields(ns))
	logger.Debug("Namespace OnAdd")

	roles := GetNamespaceRoleAnnotation(ns, h.namespaceKey)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…