From 3dcc83bfa345f294040dfb71407676c99b75fb00 Mon Sep 17 00:00:00 2001 From: "Harter, Nicholas (Contractor)" Date: Thu, 15 Jun 2017 12:44:02 -0700 Subject: [PATCH 1/4] adding in webhook startup functionality. --- src/caduceus/caduceus.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/caduceus/caduceus.go b/src/caduceus/caduceus.go index 5923148e..ffbfab38 100644 --- a/src/caduceus/caduceus.go +++ b/src/caduceus/caduceus.go @@ -142,8 +142,6 @@ func caduceus(arguments []string) int { webhookFactory.Initialize(mux, selfURL, webhookHandler, logger) webhookFactory.PrepareAndStart() - - caduceusHealth := &CaduceusHealth{} var runnable concurrent.Runnable @@ -158,6 +156,16 @@ func caduceus(arguments []string) int { logger.Info("Caduceus is up and running!") + // Attempt to obtain the current listener list from current system without having to wait for listener reregistration. + startChan := make(chan webhook.Result, 1) + webhookFactory.Start(startChan) + webhookStartResults := <- startChan + if webhookStartResults.err != nil { + logger.Error(webhookStartResults.err) + } else { + webhookRegistry.Update(webhookStartResults.hooks) + } + var ( signals = make(chan os.Signal, 1) ) From b4d1df1915c4a6dc5b4bdfbce73a89af274f5788 Mon Sep 17 00:00:00 2001 From: "Harter, Nicholas (Contractor)" Date: Thu, 15 Jun 2017 12:55:33 -0700 Subject: [PATCH 2/4] build failure fix. --- src/caduceus/caduceus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/caduceus/caduceus.go b/src/caduceus/caduceus.go index ffbfab38..dbed1cf7 100644 --- a/src/caduceus/caduceus.go +++ b/src/caduceus/caduceus.go @@ -158,7 +158,7 @@ func caduceus(arguments []string) int { // Attempt to obtain the current listener list from current system without having to wait for listener reregistration. startChan := make(chan webhook.Result, 1) - webhookFactory.Start(startChan) + webhookFactory.Start.GetCurrentSystemsHooks(startChan) webhookStartResults := <- startChan if webhookStartResults.err != nil { logger.Error(webhookStartResults.err) From ddd5a4c04e5bedad16321e7d750150f80229fcb7 Mon Sep 17 00:00:00 2001 From: "Harter, Nicholas (Contractor)" Date: Thu, 15 Jun 2017 13:47:03 -0700 Subject: [PATCH 3/4] updated webhook.Results methods to exported types --- src/caduceus/caduceus.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/caduceus/caduceus.go b/src/caduceus/caduceus.go index dbed1cf7..fdb3c47c 100644 --- a/src/caduceus/caduceus.go +++ b/src/caduceus/caduceus.go @@ -159,11 +159,11 @@ func caduceus(arguments []string) int { // Attempt to obtain the current listener list from current system without having to wait for listener reregistration. startChan := make(chan webhook.Result, 1) webhookFactory.Start.GetCurrentSystemsHooks(startChan) - webhookStartResults := <- startChan - if webhookStartResults.err != nil { - logger.Error(webhookStartResults.err) + var webhookStartResults webhook.Result = <- startChan + if webhookStartResults.Error != nil { + logger.Error(webhookStartResults.Error) } else { - webhookRegistry.Update(webhookStartResults.hooks) + webhookRegistry.Update(webhookStartResults.Hooks) } var ( From 87cf2aabd02de91ab52f1a6e7b497ebee526478b Mon Sep 17 00:00:00 2001 From: "Harter, Nicholas (Contractor)" Date: Thu, 15 Jun 2017 13:58:14 -0700 Subject: [PATCH 4/4] bumped webpa-common version --- src/glide.lock | 10 +++++----- src/glide.yaml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/glide.lock b/src/glide.lock index 8952aec6..5e6b23ca 100644 --- a/src/glide.lock +++ b/src/glide.lock @@ -1,5 +1,5 @@ -hash: 7c84fda85fd0f2d1335f40f346b65391fe63e4e70d752d137bcf377220479aef -updated: 2017-06-12T16:14:22.811127772-07:00 +hash: ec85e02ca503fa7baa7d9a6c12b4120d40580091b6277210b7a73412828af461 +updated: 2017-06-15T13:55:38.935600921-07:00 imports: - name: github.com/aws/aws-sdk-go version: 7be45195c3af1b54a609812f90c05a7e492e2491 @@ -34,7 +34,7 @@ imports: subpackages: - linux - name: github.com/Comcast/webpa-common - version: 9dfc3db86d11729a233b1b788f00b501c59c1fff + version: b6156ba40c5a41f41efeb331ef90d43e699076c1 subpackages: - concurrent - handler @@ -140,11 +140,11 @@ imports: subpackages: - codec - name: golang.org/x/sys - version: 0b25a408a50076fbbcae6b7ac0ea5fbb0b085e79 + version: fb4cac33e3196ff7f507ab9b2d2a44b0142f5b5a subpackages: - unix - name: golang.org/x/text - version: 210eee5cf7323015d097341bcf7166130d001cd8 + version: 9e2f80a6ba7ed4ba13e0cd4b1f094bf916875735 subpackages: - transform - unicode/norm diff --git a/src/glide.yaml b/src/glide.yaml index c3f84a8f..a5cff77c 100644 --- a/src/glide.yaml +++ b/src/glide.yaml @@ -1,7 +1,7 @@ package: . import: - package: github.com/Comcast/webpa-common - version: 9dfc3db86d11729a233b1b788f00b501c59c1fff + version: b6156ba40c5a41f41efeb331ef90d43e699076c1 subpackages: - concurrent - handler