Skip to content

Commit

Permalink
Merge pull request #129 from omertuc/storageproxy
Browse files Browse the repository at this point in the history
Support proxy change in clusters without storage
  • Loading branch information
openshift-merge-bot[bot] authored Apr 18, 2024
2 parents beea34a + bb71672 commit 7f42f40
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ocp_postprocess/proxy_rename/etcd_rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,14 @@ pub(crate) async fn fix_containers(etcd_client: &InMemoryK8sEtcd, proxy: &Proxy)
pub(crate) async fn fix_storages(etcd_client: &InMemoryK8sEtcd, proxy: &Proxy) -> Result<()> {
let k8s_resource_location = K8sResourceLocation::new(None, "Storage", "cluster", "operator.openshift.io/v1");

let mut storage = get_etcd_json(etcd_client, &k8s_resource_location)
.await?
.context(format!("no {:?}", k8s_resource_location.as_etcd_key()))?;
let mut storage = match get_etcd_json(etcd_client, &k8s_resource_location).await? {
Some(value) => value,
None => {
// Some clusters don't have a storage resource because they disabled the storage
// capability, that's OK
return Ok(());
}
};

let spec = storage
.pointer_mut("/spec/observedConfig/targetconfig/proxy")
Expand Down

0 comments on commit 7f42f40

Please sign in to comment.