|
|
@ -19,7 +19,6 @@ package main
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"github.com/fluxcd/pkg/apis/meta"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
corev1 "k8s.io/api/core/v1"
|
|
|
|
corev1 "k8s.io/api/core/v1"
|
|
|
@ -30,6 +29,7 @@ import (
|
|
|
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
|
|
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
|
|
|
|
|
|
|
|
|
|
|
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1"
|
|
|
|
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1"
|
|
|
|
|
|
|
|
"github.com/fluxcd/pkg/apis/meta"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var createAlertProviderCmd = &cobra.Command{
|
|
|
|
var createAlertProviderCmd = &cobra.Command{
|
|
|
@ -99,12 +99,15 @@ func createAlertProviderCmdRun(cmd *cobra.Command, args []string) error {
|
|
|
|
Channel: apChannel,
|
|
|
|
Channel: apChannel,
|
|
|
|
Username: apUsername,
|
|
|
|
Username: apUsername,
|
|
|
|
Address: apAddress,
|
|
|
|
Address: apAddress,
|
|
|
|
SecretRef: &corev1.LocalObjectReference{
|
|
|
|
|
|
|
|
Name: apSecretRef,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if apSecretRef != "" {
|
|
|
|
|
|
|
|
alertProvider.Spec.SecretRef = &corev1.LocalObjectReference{
|
|
|
|
|
|
|
|
Name: apSecretRef,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if export {
|
|
|
|
if export {
|
|
|
|
return exportAlertProvider(alertProvider)
|
|
|
|
return exportAlertProvider(alertProvider)
|
|
|
|
}
|
|
|
|
}
|
|
|
|