From 9ae26c8f25a1228426235197baa6a399f6113447 Mon Sep 17 00:00:00 2001 From: David Harrigan Date: Fri, 18 Jan 2019 11:09:14 -0500 Subject: [PATCH 1/3] translate VerifyCertificate option --- Gopkg.lock | 25 ++++++---- Gopkg.toml | 8 +-- internal/provider/statuscake/statuscake.go | 3 +- .../provider/statuscake/statuscake_test.go | 49 ++++++++++++------- 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index cacdd1a..746012d 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,14 +1,6 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -[[projects]] - branch = "master" - digest = "1:f4d469a10c1710cc1bf2e6c46756f77117413ec7c7509b54a8606824b4dceddc" - name = "github.com/DreamItGetIT/statuscake" - packages = ["."] - pruneopts = "" - revision = "85edefcbdaa39278c9db647d135d1dc8bccdad96" - [[projects]] branch = "master" digest = "1:c0bec5f9b98d0bc872ff5e834fac186b807b656683bd29cb82fb207a1513fabb" @@ -172,6 +164,14 @@ revision = "c2353362d570a7bfa228149c62842019201cfb71" version = "v1.8.0" +[[projects]] + branch = "report-error-status" + digest = "1:3f62309bd34aaf76e1035048d037fd04760536b386ea7cb09cf4d9c6e7472dd0" + name = "github.com/manifoldco/statuscake" + packages = ["."] + pruneopts = "" + revision = "4a491c40dc01196e2b33b906a102db9aa3b9420c" + [[projects]] digest = "1:63722a4b1e1717be7b98fc686e0b30d5e7f734b9e93d7dee86293b6deab7ea28" name = "github.com/matttproud/golang_protobuf_extensions" @@ -215,7 +215,10 @@ [[projects]] digest = "1:4142d94383572e74b42352273652c62afec5b23f325222ed09198f46009022d1" name = "github.com/prometheus/client_golang" - packages = ["prometheus"] + packages = [ + "prometheus", + "prometheus/promhttp", + ] pruneopts = "" revision = "c5b7fccd204277076155f10851dad72b76a49317" version = "v0.8.0" @@ -702,10 +705,12 @@ analyzer-name = "dep" analyzer-version = 1 input-imports = [ - "github.com/DreamItGetIT/statuscake", "github.com/dchest/blake2b", "github.com/golang/glog", + "github.com/manifoldco/statuscake", "github.com/prometheus/client_golang/prometheus", + "github.com/prometheus/client_golang/prometheus/promhttp", + "github.com/prometheus/client_model/go", "github.com/spf13/cobra", "github.com/spf13/viper", "k8s.io/api/core/v1", diff --git a/Gopkg.toml b/Gopkg.toml index 84360a1..e4ddbe5 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -33,10 +33,10 @@ required = [ name = "github.com/dchest/blake2b" version = "1.0.0" -[[constraint]] - branch = "master" - name = "github.com/DreamItGetIT/statuscake" - [[constraint]] name = "github.com/prometheus/client_golang" version = "0.8.0" + +[[constraint]] + branch = "report-error-status" + name = "github.com/manifoldco/statuscake" diff --git a/internal/provider/statuscake/statuscake.go b/internal/provider/statuscake/statuscake.go index c40a7bf..cde6b77 100644 --- a/internal/provider/statuscake/statuscake.go +++ b/internal/provider/statuscake/statuscake.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" - "github.com/DreamItGetIT/statuscake" + "github.com/manifoldco/statuscake" ) // The StatusCake Client we're using expects us to set this. @@ -193,6 +193,7 @@ func (c *Client) translateSpec(spec v1alpha1.MonitorTemplateSpec) (*statuscake.T scTest.WebsiteURL = http.URL scTest.FollowRedirect = http.FollowRedirects scTest.FindString = spec.HTTP.ShouldContain + scTest.EnableSSLAlert = spec.HTTP.VerifyCertificate if spec.HTTP.ShouldNotContain != "" { scTest.FindString = spec.HTTP.ShouldNotContain diff --git a/internal/provider/statuscake/statuscake_test.go b/internal/provider/statuscake/statuscake_test.go index 69a6ac9..efe03ee 100644 --- a/internal/provider/statuscake/statuscake_test.go +++ b/internal/provider/statuscake/statuscake_test.go @@ -8,7 +8,7 @@ import ( "github.com/jelmersnoeck/ingress-monitor/apis/ingressmonitor/v1alpha1" - "github.com/DreamItGetIT/statuscake" + "github.com/manifoldco/statuscake" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -139,6 +139,7 @@ func TestTranslateSpec(t *testing.T) { UserAgent: "(Test User Agent)", WebsiteURL: "http://fully-qualified-url.com", FollowRedirect: true, + EnableSSLAlert: false, }, }, { @@ -146,11 +147,12 @@ func TestTranslateSpec(t *testing.T) { v1alpha1.MonitorTemplateSpec{ Type: "HTTP", HTTP: &v1alpha1.HTTPTemplate{ - CustomHeader: "Test-Header", - UserAgent: "(Test User Agent)", - URL: "http://fully-qualified-url.com", - FollowRedirects: true, - ShouldContain: "this string", + CustomHeader: "Test-Header", + UserAgent: "(Test User Agent)", + URL: "http://fully-qualified-url.com", + FollowRedirects: true, + ShouldContain: "this string", + VerifyCertificate: true, }, }, nil, @@ -162,6 +164,7 @@ func TestTranslateSpec(t *testing.T) { FollowRedirect: true, FindString: "this string", DoNotFind: false, + EnableSSLAlert: true, }, }, { @@ -169,11 +172,12 @@ func TestTranslateSpec(t *testing.T) { v1alpha1.MonitorTemplateSpec{ Type: "HTTP", HTTP: &v1alpha1.HTTPTemplate{ - CustomHeader: "Test-Header", - UserAgent: "(Test User Agent)", - URL: "http://fully-qualified-url.com", - FollowRedirects: true, - ShouldNotContain: "this string", + CustomHeader: "Test-Header", + UserAgent: "(Test User Agent)", + URL: "http://fully-qualified-url.com", + FollowRedirects: true, + ShouldNotContain: "this string", + VerifyCertificate: true, }, }, nil, @@ -185,6 +189,7 @@ func TestTranslateSpec(t *testing.T) { FollowRedirect: true, FindString: "this string", DoNotFind: true, + EnableSSLAlert: true, }, }, { @@ -192,10 +197,11 @@ func TestTranslateSpec(t *testing.T) { v1alpha1.MonitorTemplateSpec{ Type: "HTTP", HTTP: &v1alpha1.HTTPTemplate{ - CustomHeader: "Test-Header", - UserAgent: "(Test User Agent)", - URL: "http://fully-qualified-url.com", - FollowRedirects: true, + CustomHeader: "Test-Header", + UserAgent: "(Test User Agent)", + URL: "http://fully-qualified-url.com", + FollowRedirects: true, + VerifyCertificate: true, }, }, []string{"12345"}, @@ -206,6 +212,7 @@ func TestTranslateSpec(t *testing.T) { WebsiteURL: "http://fully-qualified-url.com", FollowRedirect: true, ContactGroup: []string{"12345"}, + EnableSSLAlert: true, }, }, } @@ -387,7 +394,8 @@ func TestClient_Update(t *testing.T) { HTTP: &v1alpha1.HTTPTemplate{ CustomHeader: "Test-Header", UserAgent: "(Test User Agent)", URL: "http://fully-qualified-url.com", - FollowRedirects: true, + FollowRedirects: true, + VerifyCertificate: true, }, } @@ -416,7 +424,8 @@ func TestClient_Update(t *testing.T) { HTTP: &v1alpha1.HTTPTemplate{ CustomHeader: "Test-Header", UserAgent: "(Test User Agent)", URL: "http://fully-qualified-url.com", - FollowRedirects: true, + FollowRedirects: true, + VerifyCertificate: true, }, } @@ -437,7 +446,8 @@ func TestClient_Update(t *testing.T) { HTTP: &v1alpha1.HTTPTemplate{ CustomHeader: "Test-Header", UserAgent: "(Test User Agent)", URL: "http://fully-qualified-url.com", - FollowRedirects: true, + FollowRedirects: true, + VerifyCertificate: true, }, } @@ -463,7 +473,8 @@ func TestClient_Update(t *testing.T) { HTTP: &v1alpha1.HTTPTemplate{ CustomHeader: "Test-Header", UserAgent: "(Test User Agent)", URL: "http://fully-qualified-url.com", - FollowRedirects: true, + FollowRedirects: true, + VerifyCertificate: true, }, } From de48c7170ce4557164345efc121568ca6b15d75b Mon Sep 17 00:00:00 2001 From: David Harrigan Date: Fri, 18 Jan 2019 12:45:04 -0500 Subject: [PATCH 2/3] alias statuscake package --- Gopkg.lock | 19 ++++++++++--------- Gopkg.toml | 4 +++- internal/provider/statuscake/statuscake.go | 2 +- .../provider/statuscake/statuscake_test.go | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 746012d..55292dd 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,6 +1,15 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. +[[projects]] + branch = "report-error-status" + digest = "1:bd2bac2300ffac00beb0627d28caf68134ba6a025e696377dcc201539bc57288" + name = "github.com/DreamItGetIT/statuscake" + packages = ["."] + pruneopts = "" + revision = "7787f0d178032a689483e50ea60d829d8a98b27e" + source = "github.com/manifoldco/statuscake" + [[projects]] branch = "master" digest = "1:c0bec5f9b98d0bc872ff5e834fac186b807b656683bd29cb82fb207a1513fabb" @@ -164,14 +173,6 @@ revision = "c2353362d570a7bfa228149c62842019201cfb71" version = "v1.8.0" -[[projects]] - branch = "report-error-status" - digest = "1:3f62309bd34aaf76e1035048d037fd04760536b386ea7cb09cf4d9c6e7472dd0" - name = "github.com/manifoldco/statuscake" - packages = ["."] - pruneopts = "" - revision = "4a491c40dc01196e2b33b906a102db9aa3b9420c" - [[projects]] digest = "1:63722a4b1e1717be7b98fc686e0b30d5e7f734b9e93d7dee86293b6deab7ea28" name = "github.com/matttproud/golang_protobuf_extensions" @@ -705,9 +706,9 @@ analyzer-name = "dep" analyzer-version = 1 input-imports = [ + "github.com/DreamItGetIT/statuscake", "github.com/dchest/blake2b", "github.com/golang/glog", - "github.com/manifoldco/statuscake", "github.com/prometheus/client_golang/prometheus", "github.com/prometheus/client_golang/prometheus/promhttp", "github.com/prometheus/client_model/go", diff --git a/Gopkg.toml b/Gopkg.toml index e4ddbe5..fb38f67 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -39,4 +39,6 @@ required = [ [[constraint]] branch = "report-error-status" - name = "github.com/manifoldco/statuscake" + name = "github.com/DreamItGetIT/statuscake" + source = "github.com/manifoldco/statuscake" + diff --git a/internal/provider/statuscake/statuscake.go b/internal/provider/statuscake/statuscake.go index cde6b77..078dba4 100644 --- a/internal/provider/statuscake/statuscake.go +++ b/internal/provider/statuscake/statuscake.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" - "github.com/manifoldco/statuscake" + "github.com/DreamItGetIT/statuscake" ) // The StatusCake Client we're using expects us to set this. diff --git a/internal/provider/statuscake/statuscake_test.go b/internal/provider/statuscake/statuscake_test.go index efe03ee..2a5fa6b 100644 --- a/internal/provider/statuscake/statuscake_test.go +++ b/internal/provider/statuscake/statuscake_test.go @@ -8,7 +8,7 @@ import ( "github.com/jelmersnoeck/ingress-monitor/apis/ingressmonitor/v1alpha1" - "github.com/manifoldco/statuscake" + "github.com/DreamItGetIT/statuscake" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" From af935cbcd8c3f622afa219ecd37f7318357f051b Mon Sep 17 00:00:00 2001 From: David Harrigan Date: Fri, 18 Jan 2019 14:02:00 -0500 Subject: [PATCH 3/3] update statuscake client dependency --- Gopkg.lock | 4 ++-- Gopkg.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 55292dd..a70478a 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,12 +2,12 @@ [[projects]] - branch = "report-error-status" + branch = "master" digest = "1:bd2bac2300ffac00beb0627d28caf68134ba6a025e696377dcc201539bc57288" name = "github.com/DreamItGetIT/statuscake" packages = ["."] pruneopts = "" - revision = "7787f0d178032a689483e50ea60d829d8a98b27e" + revision = "24cd3ff224174c5f7a90d076f0dbc1ce88ff86aa" source = "github.com/manifoldco/statuscake" [[projects]] diff --git a/Gopkg.toml b/Gopkg.toml index fb38f67..022804d 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -38,7 +38,7 @@ required = [ version = "0.8.0" [[constraint]] - branch = "report-error-status" + branch = "master" name = "github.com/DreamItGetIT/statuscake" source = "github.com/manifoldco/statuscake"