Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue-698, Save default user ref for cassandra #720

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

OleksiienkoMykyta
Copy link
Collaborator

No description provided.

@OleksiienkoMykyta OleksiienkoMykyta force-pushed the issue-698-Save-default-user-ref-for-cassandra branch 3 times, most recently from c64ae6c to e758e98 Compare February 21, 2024 11:19
Comment on lines 618 to 637
func (c *Cassandra) NewDefaultUserSecret(username, password string) *k8scorev1.Secret {
return &k8scorev1.Secret{
TypeMeta: metav1.TypeMeta{
Kind: models.SecretKind,
APIVersion: models.K8sAPIVersionV1,
},
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf(models.DefaultUserSecretNameTemplate, models.DefaultUserSecretPrefix, c.Name),
Namespace: c.Namespace,
Labels: map[string]string{
models.ControlledByLabel: c.Name,
models.DefaultSecretLabel: "true",
},
},
StringData: map[string]string{
models.Username: username,
models.Password: password,
},
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

please make this func generic

Comment on lines 334 to 336
l.Info("Cassandra cluster has been created",
"cluster ID", c.Status.ID,
)
Copy link
Contributor

@ribaraka ribaraka Feb 21, 2024

Choose a reason for hiding this comment

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

no need for this log. it's already been logged

@@ -895,6 +914,59 @@ func (r *CassandraReconciler) newWatchBackupsJob(c *v1beta1.Cassandra) scheduler
}
}

func (r *CassandraReconciler) createDefaultSecret(ctx context.Context, c *v1beta1.Cassandra, l logr.Logger) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

please try to make it generic as well

@OleksiienkoMykyta OleksiienkoMykyta force-pushed the issue-698-Save-default-user-ref-for-cassandra branch 2 times, most recently from ddc79cc to 0785828 Compare February 27, 2024 11:09
@OleksiienkoMykyta OleksiienkoMykyta force-pushed the issue-698-Save-default-user-ref-for-cassandra branch from 0785828 to 39c70f8 Compare February 27, 2024 13:54
@ribaraka ribaraka merged commit 2154d1a into main Feb 27, 2024
1 check passed
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