git.iko.soy/typeable/octopod
on master help sign in
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>

commit5c7956ccae2d039aef0c9e155e4e420b94156b04 authorAleksei SIzov <45825279+Alex-Sizov@users.noreply.github.com> dateFri 11 Feb 2022, 11:13 (5 years ago) parentb8d490a
7 files changed+9−20
charts/octopod/Chart.yaml+1−1 charts/octopod/values.yaml+1−1 helm-control-scripts/Cargo.lock+1−1 helm-control-scripts/Cargo.toml+1−1 helm-control-scripts/src/cleanup.rs−11 helm-control-scripts/src/config_check.rs+1 helm-control-scripts/src/lib.rs+4−5
charts/octopod/Chart.yaml+1−1
@@ -2,7 +2,7 @@ apiVersion: v2
22name: octopod
33description: An opensource self-hosted solution for managing multiple deployments in a Kubernetes cluster.
44type: application
5−version: 0.6.5
5+version: 0.6.6
66appVersion: 1.4.2
77keywords:
88 - kubernetes
charts/octopod/values.yaml+1−1
@@ -99,7 +99,7 @@ controlScripts:
9999 image:
100100 repository: typeable/octopod-helm-control-scripts
101101 pullPolicy: IfNotPresent
102− tag: 0.2.2
102+ tag: 0.2.3
103103sqitch:
104104 image:
105105 repository: typeable/sqitch
helm-control-scripts/Cargo.lock+1−1
@@ -525,7 +525,7 @@ dependencies = [
525525
526526[[package]]
527527name = "helm-control-scripts"
528−version = "0.2.2"
528+version = "0.2.3"
529529dependencies = [
530530 "dkregistry",
531531 "env_logger",
helm-control-scripts/Cargo.toml+1−1
@@ -1,6 +1,6 @@
11[package]
22name = "helm-control-scripts"
3−version = "0.2.2"
3+version = "0.2.3"
44authors = ["Aleksei Sizov <a.sizov@typeable.io>"]
55edition = "2018"
66
helm-control-scripts/src/cleanup.rs−11
@@ -55,17 +55,6 @@ fn main() {
5555 panic!("{:?}", err);
5656 }
5757 }
58− match ingresses_to_secrets(ingresses, old_ingresses) {
59− Some(secrets) => {
60− for secret in secrets {
61− match delete_secret(&namespace, &secret) {
62− Ok(_status) => info!("Successfully deleted secret {}", &secret),
63− Err(error) => error!("Can't delete secret {}\n {}", &secret, error)
64− }
65− }
66− },
67− None => info!("No secrets to delete")
68− }
6958 info!("Success!");
7059 },
7160 Err(status) => {
helm-control-scripts/src/config_check.rs+1
@@ -30,6 +30,7 @@ fn main() {
3030 deployment_parameters: deployment_parameters,
3131 overrides: overrides,
3232 };
33+ info!("Generated Helm args: {:?}", &helm_template.args());
3334 match helm_template.run_stdout() {
3435 Ok(status) => {
3536 let (deployments, statefulsets, _ingresses, _old_ingresses, _postgresqls, _kafkas) = match parse_to_k8s(status) {
helm-control-scripts/src/lib.rs+4−5
@@ -297,11 +297,10 @@ pub mod lib {
297297 replicas: i32
298298 }
299299 fn check_value(value: String) -> Result<String, String> {
300− let split_value = value.split('=').collect::<Vec<_>>();
301− if split_value.len() == 2 {
302− Ok(value)
303− } else {
304− Err(format!("Override value {} is malformed", value))
300+ let re = Regex::new(r"^([^=]*)=(.*)$").unwrap();
301+ match re.captures(&value) {
302+ Some(_) => return Ok(value),
303+ None => return Err(format!("Override value {} is malformed", value)),
305304 }
306305 }
307306 pub fn overrides(cli_opts: &CliOpts, envs: &EnvVars) -> Option<Vec<String>> {