Cleanup control script fix (#148)

* remove certificates deletion

* rewrite check_value function

* bump up chart+control scripts version

Co-authored-by: Aleksei Sizov <a.sizov@typeable.io>
This commit is contained in:
Aleksei SIzov 2022-02-11 11:13:39 +03:00 committed by GitHub
parent b8d490a2c4
commit 5c7956ccae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 20 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: octopod
description: An opensource self-hosted solution for managing multiple deployments in a Kubernetes cluster.
type: application
version: 0.6.5
version: 0.6.6
appVersion: 1.4.2
keywords:
- kubernetes

View File

@ -99,7 +99,7 @@ controlScripts:
image:
repository: typeable/octopod-helm-control-scripts
pullPolicy: IfNotPresent
tag: 0.2.2
tag: 0.2.3
sqitch:
image:
repository: typeable/sqitch

View File

@ -525,7 +525,7 @@ dependencies = [
[[package]]
name = "helm-control-scripts"
version = "0.2.2"
version = "0.2.3"
dependencies = [
"dkregistry",
"env_logger",

View File

@ -1,6 +1,6 @@
[package]
name = "helm-control-scripts"
version = "0.2.2"
version = "0.2.3"
authors = ["Aleksei Sizov <a.sizov@typeable.io>"]
edition = "2018"

View File

@ -55,17 +55,6 @@ fn main() {
panic!("{:?}", err);
}
}
match ingresses_to_secrets(ingresses, old_ingresses) {
Some(secrets) => {
for secret in secrets {
match delete_secret(&namespace, &secret) {
Ok(_status) => info!("Successfully deleted secret {}", &secret),
Err(error) => error!("Can't delete secret {}\n {}", &secret, error)
}
}
},
None => info!("No secrets to delete")
}
info!("Success!");
},
Err(status) => {

View File

@ -30,6 +30,7 @@ fn main() {
deployment_parameters: deployment_parameters,
overrides: overrides,
};
info!("Generated Helm args: {:?}", &helm_template.args());
match helm_template.run_stdout() {
Ok(status) => {
let (deployments, statefulsets, _ingresses, _old_ingresses, _postgresqls, _kafkas) = match parse_to_k8s(status) {

View File

@ -297,11 +297,10 @@ pub mod lib {
replicas: i32
}
fn check_value(value: String) -> Result<String, String> {
let split_value = value.split('=').collect::<Vec<_>>();
if split_value.len() == 2 {
Ok(value)
} else {
Err(format!("Override value {} is malformed", value))
let re = Regex::new(r"^([^=]*)=(.*)$").unwrap();
match re.captures(&value) {
Some(_) => return Ok(value),
None => return Err(format!("Override value {} is malformed", value)),
}
}
pub fn overrides(cli_opts: &CliOpts, envs: &EnvVars) -> Option<Vec<String>> {