-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cloud storage backup cronjob (#350)
- Loading branch information
Showing
27 changed files
with
451 additions
and
81 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
operator/src/main/kotlin/eu/glasskube/operator/apps/common/cloudstorage/CloudStorageSpec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package eu.glasskube.operator.apps.common.cloudstorage | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore | ||
import io.fabric8.kubernetes.api.model.SecretKeySelector | ||
|
||
interface CloudStorageSpec { | ||
val bucket: String | ||
val accessKeySecret: SecretKeySelector | ||
val secretKeySecret: SecretKeySelector | ||
val region: String? | ||
val hostname: String? | ||
val port: Int? | ||
val useSsl: Boolean | ||
val usePathStyle: Boolean? | ||
|
||
@get:JsonIgnore | ||
val endpoint | ||
get() = hostname?.let { | ||
buildString { | ||
append(if (useSsl) "https" else "http", "://", it) | ||
if (port != null) { | ||
append(":", port) | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...tor/src/main/kotlin/eu/glasskube/operator/apps/common/cloudstorage/HasCloudStorageSpec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package eu.glasskube.operator.apps.common.cloudstorage | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore | ||
|
||
interface HasCloudStorageSpec { | ||
@get:JsonIgnore | ||
val cloudStorage: CloudStorageSpec? | ||
} |
13 changes: 13 additions & 0 deletions
13
...rc/main/kotlin/eu/glasskube/operator/apps/common/cloudstorage/ResourceWithCloudStorage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package eu.glasskube.operator.apps.common.cloudstorage | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore | ||
|
||
interface ResourceWithCloudStorage { | ||
@get:JsonIgnore | ||
val backupResourceName: String | ||
|
||
@get:JsonIgnore | ||
val backupResourceLabels: Map<String, String> | ||
|
||
fun getSpec(): HasCloudStorageSpec | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ain/kotlin/eu/glasskube/operator/apps/gitlab/dependent/GitlabCloudStorageBackupCronJob.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package eu.glasskube.operator.apps.gitlab.dependent | ||
|
||
import eu.glasskube.operator.apps.gitlab.Gitlab | ||
import eu.glasskube.operator.apps.gitlab.GitlabReconciler | ||
import eu.glasskube.operator.generic.dependent.backups.DependentCloudStorageBackupCronJob | ||
import io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependent | ||
|
||
@KubernetesDependent(labelSelector = GitlabReconciler.SELECTOR) | ||
class GitlabCloudStorageBackupCronJob : DependentCloudStorageBackupCronJob<Gitlab>() { | ||
internal class ReconcilePrecondition : DependentCloudStorageBackupCronJob.ReconcilePrecondition<Gitlab>() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.