Basic functionality is there, helmule can mirror helm chart with small modifications
37 lines
1.0 KiB
Rust
37 lines
1.0 KiB
Rust
use std::error::Error;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use super::{chart::Chart, git_repository::GitRepo, helm_repository::HelmRepo};
|
|
|
|
// A struct that represents a helm repository
|
|
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
|
|
pub struct Repository {
|
|
// A name of the repo. It's going to be used by tools
|
|
// to get a URL, so it can be any string
|
|
pub name: String,
|
|
pub helm: Option<HelmRepo>,
|
|
pub git: Option<GitRepo>,
|
|
}
|
|
|
|
// Supported kinds of helm repos
|
|
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
|
|
pub(crate) enum RepositoryKind {
|
|
// Regular helm repos and OCI
|
|
Helm,
|
|
// Git, it's not supposed to use helm-git plugin
|
|
// but instead it's just using git to get a repo
|
|
// and then look for charts in the repo
|
|
Git,
|
|
}
|
|
|
|
pub trait RepositoryImpl {
|
|
fn pull_chart(&self, chart: Chart, workdir_path: String) -> Result<String, Box<dyn Error>>;
|
|
fn get_url(&self) -> String;
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
|
|
pub(crate) struct Version {
|
|
pub(crate) version: String,
|
|
}
|