Skip to content

Commit

Permalink
Merge pull request #571 from jcmoraisjr/jm-model-update
Browse files Browse the repository at this point in the history
Improve parsing time on big clusters
  • Loading branch information
jcmoraisjr authored Jul 20, 2020
2 parents 8fc9ca4 + 886bdd3 commit 8a95242
Show file tree
Hide file tree
Showing 38 changed files with 3,294 additions and 659 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/huandu/xstrings v1.2.1 // indirect
github.com/imdario/mergo v0.3.5
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a
github.com/json-iterator/go v1.1.8 // indirect
github.com/kylelemons/godebug v1.1.0
github.com/mitchellh/copystructure v1.0.0 // indirect
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ github.com/huandu/xstrings v1.2.1 h1:v6IdmkCnDhJG/S0ivr58PeIfg+tyhqQYy4YsCsQ0Pdc
github.com/huandu/xstrings v1.2.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a h1:zPPuIq2jAWWPTrGt70eK/BSch+gFAGrNzecsoENgu2o=
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a/go.mod h1:yL958EeXv8Ylng6IfnvG4oflryUi3vgA3xPs9hmII1s=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
Expand Down Expand Up @@ -198,7 +200,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
Expand Down
5 changes: 1 addition & 4 deletions pkg/common/ingress/controller/backend_ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func (ic *GenericController) SyncSecret(key string) {
cert, err := ic.getPemCertificate(secret)
if err != nil {
glog.V(3).Infof("syncing a non ca/crt secret %v", key)
ic.newctrl.Notify()
return
}

Expand All @@ -59,15 +58,13 @@ func (ic *GenericController) SyncSecret(key string) {
ic.sslCertTracker.Update(key, cert)
// this update must trigger an update
// (like an update event from a change in Ingress)
ic.newctrl.Notify()
return
}

glog.Infof("adding secret %v to the local store", key)
glog.V(3).Infof("adding secret %v to the local store", key)
ic.sslCertTracker.Add(key, cert)
// this update must trigger an update
// (like an update event from a change in Ingress)
ic.newctrl.Notify()
}

// getPemCertificate receives a secret, and creates a ingress.SSLCert as return.
Expand Down
8 changes: 7 additions & 1 deletion pkg/common/ingress/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
type NewCtrlIntf interface {
GetIngressList() ([]*networking.Ingress, error)
GetSecret(name string) (*apiv1.Secret, error)
Notify()
}

// GenericController holds the boilerplate code required to build an Ingress controlller.
Expand Down Expand Up @@ -196,6 +195,13 @@ func (ic GenericController) GetFullResourceName(name, currentNamespace string) s
return name
}

// UpdateSecret ...
func (ic GenericController) UpdateSecret(key string) {
if _, found := ic.sslCertTracker.Get(key); found {
ic.SyncSecret(key)
}
}

// DeleteSecret ...
func (ic GenericController) DeleteSecret(key string) {
ic.sslCertTracker.DeleteAll(key)
Expand Down
Loading

0 comments on commit 8a95242

Please sign in to comment.