Skip to content

Commit

Permalink
Fix modification
Browse files Browse the repository at this point in the history
  • Loading branch information
ausias-armesto committed May 8, 2024
1 parent 8632f4e commit 56bd523
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hoprd_operator"
version = "0.2.11"
version = "0.2.12"
authors = ["HOPR Association <[email protected]>"]
edition = "2021"

Expand Down
10 changes: 5 additions & 5 deletions src/identity_pool/identity_pool_resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<IdentityPoolSpec>(&previous_text) {
match serde_json::from_str::<IdentityPool>(&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 {
Expand All @@ -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<ContextData>, previous_identity_pool: &IdentityPoolSpec) -> Result<(), Error> {
async fn apply_modification(&mut self, context_data: Arc<ContextData>, 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 {
Expand Down
8 changes: 4 additions & 4 deletions test-data/sample_config-staging.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 56bd523

Please sign in to comment.