@@ -104,25 +104,26 @@ func (r *Reconciler) populateIntegration(ctx context.Context, integration *akov2
104
104
}
105
105
106
106
func fetchIntegrationSecrets (ctx context.Context , kubeClient client.Client , integration * akov2next.AtlasThirdPartyIntegration ) (map [string ][]byte , error ) {
107
+ ks := secret .NewKubernetesSecretProvider (kubeClient )
107
108
switch integration .Spec .Type {
108
109
case "DATADOG" :
109
- return secret .Fetch (ctx , kubeClient , integration .Spec .Datadog .APIKeySecret .Name )
110
+ return ks .Fetch (ctx , integration .Spec .Datadog .APIKeySecret .Name )
110
111
case "MICROSOFT_TEAMS" :
111
- return secret .Fetch (ctx , kubeClient , integration .Spec .MicrosoftTeams .URLSecret .Name )
112
+ return ks .Fetch (ctx , integration .Spec .MicrosoftTeams .URLSecret .Name )
112
113
case "NEW_RELIC" :
113
- return secret .Fetch (ctx , kubeClient , integration .Spec .NewRelic .CredentialsSecret .Name )
114
+ return ks .Fetch (ctx , integration .Spec .NewRelic .CredentialsSecret .Name )
114
115
case "OPS_GENIE" :
115
- return secret .Fetch (ctx , kubeClient , integration .Spec .OpsGenie .APIKeySecret .Name )
116
+ return ks .Fetch (ctx , integration .Spec .OpsGenie .APIKeySecret .Name )
116
117
case "PAGER_DUTY" :
117
- return secret .Fetch (ctx , kubeClient , integration .Spec .PagerDuty .ServiceKeySecret .Name )
118
+ return ks .Fetch (ctx , integration .Spec .PagerDuty .ServiceKeySecret .Name )
118
119
case "PROMETHEUS" :
119
- return secret .Fetch (ctx , kubeClient , integration .Spec .Prometheus .PrometheusCredentialsSecret .Name )
120
+ return ks .Fetch (ctx , integration .Spec .Prometheus .PrometheusCredentialsSecret .Name )
120
121
case "SLACK" :
121
- return secret .Fetch (ctx , kubeClient , integration .Spec .Slack .APITokenSecret .Name )
122
+ return ks .Fetch (ctx , integration .Spec .Slack .APITokenSecret .Name )
122
123
case "VICTOR_OPS" :
123
- return secret .Fetch (ctx , kubeClient , integration .Spec .VictorOps .APIKeySecret .Name )
124
+ return ks .Fetch (ctx , integration .Spec .VictorOps .APIKeySecret .Name )
124
125
case "WEBHOOK" :
125
- return secret .Fetch (ctx , kubeClient , integration .Spec .Webhook .URLSecret .Name )
126
+ return ks .Fetch (ctx , integration .Spec .Webhook .URLSecret .Name )
126
127
default :
127
128
return nil , fmt .Errorf ("%w %v" , thirdpartyintegration .ErrUnsupportedIntegrationType , integration .Spec .Type )
128
129
}
0 commit comments