-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #287 from artemlive/feature/pingdom-api-migrate
IMC pingdom api v3.1 support with small improvements and documentation fixes
- Loading branch information
Showing
13 changed files
with
236 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 144 additions & 0 deletions
144
...IngressMonitorController/2.0.5/ingressmonitorcontroller.v2.0.5.clusterserviceversion.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: ClusterServiceVersion | ||
metadata: | ||
annotations: | ||
alm-examples: '[]' | ||
capabilities: Basic Install | ||
name: ingressmonitorcontroller.v2.0.5 | ||
namespace: placeholder | ||
spec: | ||
apiservicedefinitions: {} | ||
customresourcedefinitions: | ||
owned: | ||
- description: EndpointMonitor is the Schema for the endpointmonitors API | ||
kind: EndpointMonitor | ||
name: endpointmonitors.endpointmonitor.stakater.com | ||
version: v1alpha1 | ||
description: Placeholder description | ||
displayName: Ingress Monitor Controller | ||
install: | ||
spec: | ||
clusterPermissions: | ||
- rules: | ||
- apiGroups: | ||
- "" | ||
- extensions | ||
- route.openshift.io | ||
resources: | ||
- ingresses | ||
- routes | ||
- secrets | ||
verbs: | ||
- list | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
- services | ||
- configmaps | ||
- services/finalizers | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
- daemonsets | ||
- replicasets | ||
- statefulsets | ||
verbs: | ||
- '*' | ||
- apiGroups: | ||
- monitoring.coreos.com | ||
resources: | ||
- servicemonitors | ||
verbs: | ||
- get | ||
- create | ||
- list | ||
- apiGroups: | ||
- apps | ||
resourceNames: | ||
- ingressmonitorcontroller | ||
resources: | ||
- deployments/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- endpointmonitor.stakater.com | ||
resources: | ||
- '*' | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
serviceAccountName: ingressmonitorcontroller | ||
deployments: | ||
- name: ingressmonitorcontroller | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: ingressmonitorcontroller | ||
strategy: {} | ||
template: | ||
metadata: | ||
labels: | ||
name: ingressmonitorcontroller | ||
spec: | ||
containers: | ||
- command: | ||
- IngressMonitorController | ||
env: | ||
- name: WATCH_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.annotations['olm.targetNamespaces'] | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: OPERATOR_NAME | ||
value: ingressmonitorcontroller | ||
- name: CONFIG_SECRET_NAME | ||
value: imc-config | ||
- name: LOG_LEVEL | ||
value: info | ||
- name: LOG_FORMAT | ||
value: text | ||
image: stakater/ingressmonitorcontroller:v2.0.5 | ||
imagePullPolicy: Always | ||
name: ingressmonitorcontroller | ||
resources: {} | ||
serviceAccountName: ingressmonitorcontroller | ||
strategy: deployment | ||
installModes: | ||
- supported: true | ||
type: OwnNamespace | ||
- supported: true | ||
type: SingleNamespace | ||
- supported: false | ||
type: MultiNamespace | ||
- supported: true | ||
type: AllNamespaces | ||
maturity: alpha | ||
provider: {} | ||
replaces: ingressmonitorcontroller.v0.0.0 | ||
version: 2.0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
providers: | ||
- name: PingdomMulti | ||
apiURL: "https://api.pingdom.com/v2/" | ||
apiKey: "657a68d9ashdyasjdklkskuasd" | ||
username: "[email protected]" | ||
password: "SuperSecret" | ||
accountEmail: "[email protected]" | ||
- name: Pingdom | ||
apiURL: "https://api.pingdom.com/api/3.1" | ||
apiToken: "657a68d9ashdyasjdklkskuasd" | ||
alertContacts: "0544483_0_0-2628365_0_0-2633263_0_0" | ||
alertIntegrations: "91166,10924" | ||
teamAlertContacts: "1234567_0_0-2628365_0_0-2633263_0_0" | ||
alertIntegrations: "91166-10924" | ||
enableMonitorDeletion: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,12 @@ const ( | |
correctTestEnableMonitorDeletion = true | ||
|
||
configFilePathPingdom = "../../examples/configs/test-config-pingdom.yaml" | ||
correctTestPingdomConfigMulti = "PingdomMulti" | ||
correctTestPingdomUsername = "[email protected]" | ||
correctTestPingdomAPIURL = "https://api.pingdom.com/v2/" | ||
correctTestPingdomPassword = "SuperSecret" | ||
correctTestPingdomAccountEmail = "[email protected]" | ||
correctTestPingdomConfigMulti = "Pingdom" | ||
correctTestPingdomAPIURL = "https://api.pingdom.com/api/3.1" | ||
correctTestPingdomAlertContacts = "0544483_0_0-2628365_0_0-2633263_0_0" | ||
correctTestPingdomAlertIntegrations = "91166,10924" | ||
correctTestPingdomAPIKey = "657a68d9ashdyasjdklkskuasd" | ||
correctTestPingdomAlertIntegrations = "91166-10924" | ||
correctTestPingdomAPIToken = "657a68d9ashdyasjdklkskuasd" | ||
correctTestPingdomTeamAlertContacts = "1234567_0_0-2628365_0_0-2633263_0_0" | ||
|
||
configFilePathUptime = "../../examples/configs/test-config-uptime.yaml" | ||
correctTestUptimeConfigName = "Uptime" | ||
|
@@ -34,9 +32,8 @@ const ( | |
) | ||
|
||
func TestConfigWithCorrectValues(t *testing.T) { | ||
correctConfig := Config{Providers: []Provider{{Name: correctTestPingdomConfigMulti, ApiKey: correctTestPingdomAPIKey, ApiURL: correctTestPingdomAPIURL, | ||
AlertContacts: correctTestPingdomAlertContacts, AlertIntegrations: correctTestPingdomAlertIntegrations, | ||
Username: correctTestPingdomUsername, Password: correctTestPingdomPassword, AccountEmail: correctTestPingdomAccountEmail}}, | ||
correctConfig := Config{Providers: []Provider{{Name: correctTestPingdomConfigMulti, ApiToken: correctTestPingdomAPIToken, ApiURL: correctTestPingdomAPIURL, | ||
AlertContacts: correctTestPingdomAlertContacts, AlertIntegrations: correctTestPingdomAlertIntegrations, TeamAlertContacts: correctTestPingdomTeamAlertContacts}}, | ||
EnableMonitorDeletion: correctTestEnableMonitorDeletion, ResyncPeriod: 0} | ||
|
||
config := ReadConfig(configFilePathPingdom) | ||
|
@@ -73,18 +70,17 @@ func TestConfigWithoutProvider(t *testing.T) { | |
} | ||
|
||
func TestConfigWithoutEnabledFlag(t *testing.T) { | ||
incorrectConfig := Config{Providers: []Provider{{Name: correctTestConfigName, ApiKey: correctTestAPIKey, ApiURL: correctTestAPIURL, AlertContacts: correctTestAlertContacts}}} | ||
incorrectConfig := Config{Providers: []Provider{{Name: correctTestConfigName, ApiKey: correctTestAPIKey, ApiURL: correctTestAPIURL, TeamAlertContacts: correctTestPingdomTeamAlertContacts, AlertContacts: correctTestAlertContacts}}} | ||
config := ReadConfig(configFilePath) | ||
|
||
if reflect.DeepEqual(config, incorrectConfig) { | ||
t.Error("Marshalled config and incorrect config match, should not match") | ||
} | ||
} | ||
|
||
func TestConfigWithPingdomMultiAuthEnabledFlag(t *testing.T) { | ||
correctConfig := Config{Providers: []Provider{{Name: correctTestPingdomConfigMulti, ApiKey: correctTestPingdomAPIKey, ApiURL: correctTestPingdomAPIURL, | ||
AlertContacts: correctTestPingdomAlertContacts, AlertIntegrations: correctTestPingdomAlertIntegrations, | ||
Username: correctTestPingdomUsername, Password: correctTestPingdomPassword, AccountEmail: correctTestPingdomAccountEmail}}, | ||
func TestConfigWithPingdom(t *testing.T) { | ||
correctConfig := Config{Providers: []Provider{{Name: correctTestPingdomConfigMulti, ApiToken: correctTestPingdomAPIToken, ApiURL: correctTestPingdomAPIURL, | ||
AlertContacts: correctTestPingdomAlertContacts, AlertIntegrations: correctTestPingdomAlertIntegrations, TeamAlertContacts: correctTestPingdomTeamAlertContacts}}, | ||
EnableMonitorDeletion: correctTestEnableMonitorDeletion} | ||
config := ReadConfig(configFilePathPingdom) | ||
if !reflect.DeepEqual(config, correctConfig) { | ||
|
Oops, something went wrong.