diff --git a/Cargo.lock b/Cargo.lock index aadde2d..3d083ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -526,7 +526,7 @@ dependencies = [ [[package]] name = "hoprd_operator" -version = "0.2.11" +version = "0.2.12" dependencies = [ "async-recursion", "base64 0.22.1", diff --git a/Cargo.toml b/Cargo.toml index fe896eb..1deb112 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hoprd_operator" -version = "0.2.11" +version = "0.2.12" authors = ["HOPR Association "] edition = "2021" diff --git a/src/identity_pool/identity_pool_resource.rs b/src/identity_pool/identity_pool_resource.rs index 10d3848..75e18f8 100644 --- a/src/identity_pool/identity_pool_resource.rs +++ b/src/identity_pool/identity_pool_resource.rs @@ -160,12 +160,12 @@ impl IdentityPool { if status.phase.eq(&IdentityPoolPhaseEnum::Ready) { if self.annotations().contains_key(constants::ANNOTATION_LAST_CONFIGURATION) { let previous_text: String = self.annotations().get_key_value(constants::ANNOTATION_LAST_CONFIGURATION).unwrap().1.parse().unwrap(); - match serde_json::from_str::(&previous_text) { + match serde_json::from_str::(&previous_text) { Ok(previous_identity_pool) => { self.apply_modification(context_data, &previous_identity_pool).await?; }, - Err(_err) => { - error!("Could not parse the last applied configuration from {identity_pool_name}."); + Err(err) => { + error!("Could not parse the last applied configuration from {identity_pool_name}: {}", err); } } } else { @@ -184,11 +184,11 @@ impl IdentityPool { Ok(Action::requeue(Duration::from_secs(constants::RECONCILE_SHORT_FREQUENCY))) } - async fn apply_modification(&mut self, context_data: Arc, previous_identity_pool: &IdentityPoolSpec) -> Result<(), Error> { + async fn apply_modification(&mut self, context_data: Arc, previous_identity_pool: &IdentityPool) -> Result<(), Error> { let client: Client = context_data.client.clone(); let identity_pool_namespace: String = self.namespace().unwrap(); let identity_pool_name: String = self.name_any(); - if self.changed_inmutable_fields(&previous_identity_pool) { + if self.changed_inmutable_fields(&previous_identity_pool.spec) { context_data.send_event(self,IdentityPoolEventEnum::Failed,None).await; self.update_status(client.clone(), IdentityPoolPhaseEnum::Failed).await?; } else { diff --git a/test-data/sample_config-staging.yaml b/test-data/sample_config-staging.yaml index acdc220..567349f 100644 --- a/test-data/sample_config-staging.yaml +++ b/test-data/sample_config-staging.yaml @@ -1,8 +1,8 @@ instance: - name: "hoprd-operator" - namespace: "hoprd-operator" + name: hoprd-operator + namespace: hoprd-operator ingress: - ingress_class_name: "nginx" + ingress_class_name: nginx dns_domain: staging.hoprnet.link loadbalancer_ip: 34.159.20.69 annotations: @@ -12,7 +12,7 @@ ingress: nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" namespace: ingress-nginx p2p_port_min: "9000" - p2p_port_max: "9001" + p2p_port_max: "9010" deployment_name: ingress-nginx-controller hopli_image: europe-west3-docker.pkg.dev/hoprassociation/docker-images/hopli:2.1.0-rc.3 persistence: