Documentation ¶
Index ¶
- Constants
- func AddCredentialsToConnectionURL(connURL, userName, password string) (string, error)
- func CreateOrUpdateConnectionSecrets(ctx *workflow.Context, k8sClient client.Client, recorder record.EventRecorder, ...) workflow.Result
- func Ensure(client client.Client, namespace, projectName, projectID, clusterName string, ...) (string, error)
- func FillPrivateConnStrings(connStrings *mongodbatlas.ConnectionStrings, data *ConnectionData)
- func ListByDeploymentName(k8sClient client.Client, namespace, projectID, clusterName string) ([]corev1.Secret, error)
- func ListByUserName(k8sClient client.Client, namespace, projectID, userName string) ([]corev1.Secret, error)
- func RemoveStaleSecretsByUserName(k8sClient client.Client, projectID, userName string, ...) error
- type ConnectionData
Constants ¶
View Source
const ( ProjectLabelKey string = "atlas.mongodb.com/project-id" ClusterLabelKey string = "atlas.mongodb.com/cluster-name" TypeLabelKey = "atlas.mongodb.com/type" CredLabelVal = "credentials" )
View Source
const ConnectionSecretsEnsuredEvent = "ConnectionSecretsEnsured"
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateConnectionSecrets ¶ added in v1.5.0
func CreateOrUpdateConnectionSecrets(ctx *workflow.Context, k8sClient client.Client, recorder record.EventRecorder, project mdbv1.AtlasProject, dbUser mdbv1.AtlasDatabaseUser) workflow.Result
func Ensure ¶
func Ensure(client client.Client, namespace, projectName, projectID, clusterName string, data ConnectionData) (string, error)
Ensure creates or updates the connection Secret for the specific cluster and db user. Returns the name of the Secret created.
func FillPrivateConnStrings ¶ added in v1.5.0
func FillPrivateConnStrings(connStrings *mongodbatlas.ConnectionStrings, data *ConnectionData)
func ListByDeploymentName ¶ added in v1.1.0
func ListByDeploymentName(k8sClient client.Client, namespace, projectID, clusterName string) ([]corev1.Secret, error)
ListByDeploymentName returns all secrets in the specified namespace that have labels for 'projectID' and 'clusterName'
func ListByUserName ¶
func ListByUserName(k8sClient client.Client, namespace, projectID, userName string) ([]corev1.Secret, error)
ListByUserName returns all secrets in the specified namespace that have label for 'projectID' and data for 'userName'
func RemoveStaleSecretsByUserName ¶ added in v1.5.0
func RemoveStaleSecretsByUserName(k8sClient client.Client, projectID, userName string, user mdbv1.AtlasDatabaseUser, log *zap.SugaredLogger) error
RemoveStaleSecretsByUserName removes the stale secrets when the database user name changes (as it's used as a part of Secret name)
Types ¶
type ConnectionData ¶
type ConnectionData struct {
DBUserName, ConnURL, SrvConnURL, PvtConnURL, PvtSrvConnURL, Password string
}
Click to show internal directories.
Click to hide internal directories.