Skip to content

Commit

Permalink
[fixup] set service account, fix MedusaTask building string
Browse files Browse the repository at this point in the history
  • Loading branch information
emerkle826 committed Jan 11, 2024
1 parent 64e3c4b commit 525d089
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/medusa/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ func PurgeCronJob(dcConfig *cassandra.DatacenterConfig, medusaSpec *api.MedusaCl
TerminationGracePeriodSeconds: pointer.Int64(30),
DNSPolicy: corev1.DNSClusterFirst,
SchedulerName: "default-scheduler",
ServiceAccountName: "k8ssandra-operator",
Containers: []corev1.Container{
{
Name: "k8ssandra-purge-backups",
Expand All @@ -550,7 +551,6 @@ func PurgeCronJob(dcConfig *cassandra.DatacenterConfig, medusaSpec *api.MedusaCl
Command: []string{
"/bin/bash",
"-c",
">-",
createPurgeTaskStr(dcConfig, namespace),
},
},
Expand Down Expand Up @@ -599,5 +599,5 @@ func defaultMedusaProbe() *corev1.Probe {
}

func createPurgeTaskStr(dcConfig *cassandra.DatacenterConfig, namespace string) string {
return fmt.Sprintf("printf \"apiVersion: medusa.k8ssandra.io/v1alpha1\nkind:MedusaTask\nmetadata:\n name: purge-backups-timestamp\nnamespace: %s\nspec:\n cassandraDatacenter: %s\n operation: purge\" | sed \"s/timestamp/$(date+%%Y%%m%%d%%H%%M%%S)/g\" | kubectl apply -f -", namespace, dcConfig.CassDcName())
return fmt.Sprintf("printf \"apiVersion: medusa.k8ssandra.io/v1alpha1\\nkind: MedusaTask\\nmetadata:\\n name: purge-backups-timestamp\\n namespace: %s\\nspec:\\n cassandraDatacenter: %s\\n operation: purge\" | sed \"s/timestamp/$(date +%%Y%%m%%d%%H%%M%%S)/g\" | kubectl apply -f -", namespace, dcConfig.CassDcName())

Check warning on line 602 in pkg/medusa/reconcile.go

View check run for this annotation

Codecov / codecov/patch

pkg/medusa/reconcile.go#L601-L602

Added lines #L601 - L602 were not covered by tests
}

0 comments on commit 525d089

Please sign in to comment.