Skip to content

Commit

Permalink
get namespace of pods
Browse files Browse the repository at this point in the history
Signed-off-by: pjuarezd <[email protected]>
  • Loading branch information
pjuarezd committed May 22, 2024
1 parent d6f2663 commit bfe591f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/controller/main-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ func NewController(
},
}

ns := miniov2.GetNSFromFile()

// Initialize operator HTTP upgrade server handlers
controller.us = configureHTTPUpgradeServer()

Expand Down Expand Up @@ -370,16 +372,18 @@ func NewController(
}
},
UpdateFunc: func(old, new interface{}) {
newDepl := new.(*corev1.Secret)
oldDepl := old.(*corev1.Secret)
if newDepl.ResourceVersion == oldDepl.ResourceVersion {
newSecret := new.(*corev1.Secret)
oldSecret := old.(*corev1.Secret)
if newSecret.ResourceVersion == oldSecret.ResourceVersion {
// Periodic resync will send update events for all known Deployments.
// Two different versions of the same secret will always have different RVs.
return
}
// When a secret with operator-ca-tls- prefix is modified, we look if this is an observed secret containing a CA TLS
// certificate referenced in a Tenant, when true we add the CA to the trusted certificates in the transport
if strings.HasPrefix(newDepl.Name, OperatorCATLSSecretPrefix) {
if newSecret.Namespace == ns {
if strings.HasPrefix(newSecret.Name, OperatorCATLSSecretPrefix) {
}
}
},
DeleteFunc: func(obj interface{}) {
Expand Down

0 comments on commit bfe591f

Please sign in to comment.