From 642e53de4cf6c6c3c011f0f175930f615cb14ec6 Mon Sep 17 00:00:00 2001 From: Romain GERARD Date: Fri, 28 May 2021 13:25:01 +0200 Subject: [PATCH] Allow router to be deleted --- src/cloud_provider/aws/router.rs | 5 ++++- src/cloud_provider/digitalocean/router.rs | 5 ++++- src/models.rs | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cloud_provider/aws/router.rs b/src/cloud_provider/aws/router.rs index e7d83b7f..b54bb321 100644 --- a/src/cloud_provider/aws/router.rs +++ b/src/cloud_provider/aws/router.rs @@ -18,6 +18,7 @@ pub struct Router { context: Context, id: String, name: String, + action: Action, default_domain: String, custom_domains: Vec, routes: Vec, @@ -29,6 +30,7 @@ impl Router { context: Context, id: &str, name: &str, + action: Action, default_domain: &str, custom_domains: Vec, routes: Vec, @@ -38,6 +40,7 @@ impl Router { context, id: id.to_string(), name: name.to_string(), + action, default_domain: default_domain.to_string(), custom_domains, routes, @@ -72,7 +75,7 @@ impl Service for Router { } fn action(&self) -> &Action { - &Action::Create + &self.action } fn private_port(&self) -> Option { diff --git a/src/cloud_provider/digitalocean/router.rs b/src/cloud_provider/digitalocean/router.rs index 317d7e34..36a51df4 100644 --- a/src/cloud_provider/digitalocean/router.rs +++ b/src/cloud_provider/digitalocean/router.rs @@ -21,6 +21,7 @@ use crate::models::{Context, Listen, Listener, Listeners}; pub struct Router { context: Context, id: String, + action: Action, name: String, default_domain: String, custom_domains: Vec, @@ -33,6 +34,7 @@ impl Router { context: Context, id: &str, name: &str, + action: Action, default_domain: &str, custom_domains: Vec, routes: Vec, @@ -42,6 +44,7 @@ impl Router { context, id: id.to_string(), name: name.to_string(), + action, default_domain: default_domain.to_string(), custom_domains, routes, @@ -76,7 +79,7 @@ impl Service for Router { } fn action(&self) -> &Action { - &Action::Create + &self.action } fn private_port(&self) -> Option { diff --git a/src/models.rs b/src/models.rs index 42ebccf0..db7b7e7d 100644 --- a/src/models.rs +++ b/src/models.rs @@ -430,6 +430,7 @@ impl Router { context.clone(), self.id.as_str(), self.name.as_str(), + self.action.to_service_action(), self.default_domain.as_str(), custom_domains, routes, @@ -443,6 +444,7 @@ impl Router { context.clone(), self.id.as_str(), self.name.as_str(), + self.action.to_service_action(), self.default_domain.as_str(), custom_domains, routes,