Skip to content

Conversation

@antonlisovenko
Copy link
Contributor

@antonlisovenko antonlisovenko commented Mar 22, 2021

This PR adds support for database user expiration. If the spec.DeleteAfterDate is less than the current date - no API requests are sent to Atlas, the resource is marked as ready: false and DatabaseUserReadyType: false and connection secrets are removed. Note, that the retry of the reconciliation doesn't happen in this case as it's the user that needs to update the spec to fix this

@antonlisovenko antonlisovenko marked this pull request as ready for review March 22, 2021 11:52
log.Infof("Removed %d connection secrets", len(secrets))
}
// We ignore the error as it will be printed by the function
_ = removeStaleSecretsByUserName(r.Client, project.ID(), userName, *dbUser, log)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to a single function as this code is reused by different places

return false, err
}

// performing some normalization of dates
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is necessary to correctly compare strings as the date returned by Atlas may be different than the one submitted by the Atlas Operator

@antonlisovenko antonlisovenko merged commit 307fdf6 into main Mar 30, 2021
@antonlisovenko antonlisovenko deleted the CLOUDP-84905_mark-user-expired branch March 30, 2021 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants