diff --git a/Gopkg.lock b/Gopkg.lock index cacdd1a..a70478a 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,11 +3,12 @@ [[projects]] branch = "master" - digest = "1:f4d469a10c1710cc1bf2e6c46756f77117413ec7c7509b54a8606824b4dceddc" + digest = "1:bd2bac2300ffac00beb0627d28caf68134ba6a025e696377dcc201539bc57288" name = "github.com/DreamItGetIT/statuscake" packages = ["."] pruneopts = "" - revision = "85edefcbdaa39278c9db647d135d1dc8bccdad96" + revision = "24cd3ff224174c5f7a90d076f0dbc1ce88ff86aa" + source = "github.com/manifoldco/statuscake" [[projects]] branch = "master" @@ -215,7 +216,10 @@ [[projects]] digest = "1:4142d94383572e74b42352273652c62afec5b23f325222ed09198f46009022d1" name = "github.com/prometheus/client_golang" - packages = ["prometheus"] + packages = [ + "prometheus", + "prometheus/promhttp", + ] pruneopts = "" revision = "c5b7fccd204277076155f10851dad72b76a49317" version = "v0.8.0" @@ -706,6 +710,8 @@ "github.com/dchest/blake2b", "github.com/golang/glog", "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..022804d 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -33,10 +33,12 @@ required = [ name = "github.com/dchest/blake2b" version = "1.0.0" +[[constraint]] + name = "github.com/prometheus/client_golang" + version = "0.8.0" + [[constraint]] branch = "master" name = "github.com/DreamItGetIT/statuscake" + source = "github.com/manifoldco/statuscake" -[[constraint]] - name = "github.com/prometheus/client_golang" - version = "0.8.0" diff --git a/internal/provider/statuscake/statuscake.go b/internal/provider/statuscake/statuscake.go index c40a7bf..078dba4 100644 --- a/internal/provider/statuscake/statuscake.go +++ b/internal/provider/statuscake/statuscake.go @@ -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..2a5fa6b 100644 --- a/internal/provider/statuscake/statuscake_test.go +++ b/internal/provider/statuscake/statuscake_test.go @@ -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, }, }