Documentation ¶
Index ¶
- Constants
- func AddCredentialsToConnectionURL(connURL, userName, password string) (string, error)
- func CreateOrUpdateConnectionSecrets(ctx *workflow.Context, k8sClient client.Client, ...) workflow.Result
- func Ensure(ctx context.Context, client client.Client, ...) (string, error)
- func FillPrivateConnStrings(connStrings *mongodbatlas.ConnectionStrings, data *ConnectionData)
- func FillPrivateConns(conn deployment.Connection, data *ConnectionData)
- func GetAllServerless(ctx *workflow.Context, projectID string) ([]*mongodbatlas.Cluster, error)
- func IsCloudGovDomain(ctx *workflow.Context) bool
- func ListByDeploymentName(ctx context.Context, k8sClient client.Client, ...) ([]corev1.Secret, error)
- func ListByUserName(ctx context.Context, k8sClient client.Client, ...) ([]corev1.Secret, error)
- func ReapOrphanConnectionSecrets(ctx context.Context, k8sClient client.Client, projectID, namespace string, ...) ([]string, error)
- func RemoveStaleSecretsByUserName(ctx context.Context, k8sClient client.Client, projectID, userName string, ...) error
- type ConnectionData
- type PrivateLinkConnURLs
Constants ¶
const ( ProjectLabelKey string = "atlas.mongodb.com/project-id" ClusterLabelKey string = "atlas.mongodb.com/cluster-name" TypeLabelKey = "atlas.mongodb.com/type" CredLabelVal = "credentials" )
const ConnectionSecretsEnsuredEvent = "ConnectionSecretsEnsured"
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateConnectionSecrets ¶
func CreateOrUpdateConnectionSecrets(ctx *workflow.Context, k8sClient client.Client, ds deployment.AtlasDeploymentsService, recorder record.EventRecorder, project *project.Project, dbUser akov2.AtlasDatabaseUser) workflow.Result
func Ensure ¶
func Ensure(ctx context.Context, 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 ¶
func FillPrivateConnStrings(connStrings *mongodbatlas.ConnectionStrings, data *ConnectionData)
FillPrivateConnStrings fills private conn urls from connection strings TODO: (CLOUDP-253951) remove once all usages move over to FillPrivateConns instead Right now only advanced deployment is using this one
func FillPrivateConns ¶
func FillPrivateConns(conn deployment.Connection, data *ConnectionData)
func GetAllServerless ¶
func IsCloudGovDomain ¶
func ListByDeploymentName ¶
func ListByDeploymentName(ctx context.Context, 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(ctx context.Context, 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 ¶
func RemoveStaleSecretsByUserName(ctx context.Context, k8sClient client.Client, projectID, userName string, user akov2.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 string Password string ConnURL string SrvConnURL string PrivateConnURLs []PrivateLinkConnURLs }