Skip to content

Commit

Permalink
Add client
Browse files Browse the repository at this point in the history
  • Loading branch information
nikoshet committed Oct 17, 2024
1 parent ea09c72 commit 3ee1a25
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 16 deletions.
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ name = "pvc-snapshotter"
version = "0.1.0"
edition = "2021"
license = "MIT"
description = "A Rust tool that can backup and restore k8s PVCs using EBS snapshots"
description = "The pvc-snapshotter is a Rust tool that can backup and restore k8s PVCs using EBS snapshots"
readme = "README.md"
homepage = "https://github.com/nikoshet/pvc-snapshotter"
repository = "https://github.com/nikoshet/pvc-snapshotter"
keywords = ["k8s", "pvc", "snapshot", "ebs", "backup", "restore", "aws"]
documentation = "https://docs.rs/pvc-snapshotter"
exclude = ["script.sh"]

# [workspace]
# members = ["pvc-snapshotter-cli"]
[workspace]
members = ["pvc-snapshotter-client"]

[workspace.dependencies]
anyhow = "1.0.89"
Expand All @@ -30,6 +31,7 @@ serde_json = "1.0.128"
tokio = { version = "1", features = ["full"] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
pvc-snapshotter = { path = ".", version = "0.1" }

[dependencies]
anyhow.workspace = true
Expand All @@ -49,11 +51,11 @@ tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true

# [lib]
# test = true
# edition = "2021"
# crate-type = ["lib"]
# name = "pvc_snapshotter"
[lib]
test = true
edition = "2021"
crate-type = ["lib"]
name = "pvc_snapshotter"

[features]
default = ["full"]
Expand Down
36 changes: 36 additions & 0 deletions pvc-snapshotter-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[package]
name = "pvc-snapshotter-client"
version = "0.1.0"
edition = "2021"
license = "MIT"
description = "The pvc-snapshotter-client is a Rust tool that can backup and restore k8s PVCs using EBS snapshots"
readme = "../README.md"
homepage = "https://github.com/nikoshet/pvc-snapshotter"
repository = "https://github.com/nikoshet/pvc-snapshotter"
keywords = ["k8s", "pvc", "snapshot", "ebs", "backup", "restore", "aws"]
documentation = "https://docs.rs/pvc-snapshotter-client"

[dependencies]
anyhow.workspace = true
async-trait.workspace = true
aws-config.workspace = true
aws-sdk-ec2.workspace = true
clap.workspace = true
colored.workspace = true
k8s-openapi.workspace = true
kube.workspace = true
kube-custom-resources-rs.workspace = true
pretty_assertions.workspace = true
schemars.workspace = true
serde.workspace = true
serde_json.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
pvc-snapshotter.workspace = true

[features]
default = ["full"]
full = ["backup", "restore"]
backup = []
restore = []
14 changes: 6 additions & 8 deletions src/main.rs → pvc-snapshotter-client/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
mod aws_ops;
mod backup;
mod k8s_ops;
mod restore;
use anyhow::Result;
#[cfg(feature = "backup")]
use backup::{backup_operator::BackupOperator, backup_payload::BackupPayload};
use clap::{Parser, Subcommand};
use colored::Colorize;
#[cfg(feature = "backup")]
use pvc_snapshotter::backup::{backup_operator::BackupOperator, backup_payload::BackupPayload};
#[cfg(feature = "restore")]
use k8s_ops::vsc::retain_policy::VSCRetainPolicy;
use pvc_snapshotter::k8s_ops::vsc::retain_policy::VSCRetainPolicy;
#[cfg(feature = "restore")]
use restore::{restore_operator::RestoreOperator, restore_payload::RestorePayload};
use pvc_snapshotter::restore::{
restore_operator::RestoreOperator, restore_payload::RestorePayload,
};
use tracing::info;

#[derive(Parser)]
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub mod aws_ops;
pub mod backup;
pub mod k8s_ops;
pub mod restore;

0 comments on commit 3ee1a25

Please sign in to comment.