Skip to content
Snippets Groups Projects
Commit c5b98228 authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Fix Canary Ingress weight is not reflected on UI immediately

This commit fixes the caching issue that the cached rollout status
is being used even after the entity is updated.
parent e049419a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -405,6 +405,11 @@ def patch_ingress(ingress, data)
deployment_platform.patch_ingress(deployment_namespace, ingress, data)
end
 
def clear_all_caches
expire_etag_cache
clear_reactive_cache!
end
private
 
def rollout_status_available?
Loading
Loading
Loading
Loading
@@ -24,6 +24,7 @@ def execute(environment)
end
 
if environment.patch_ingress(canary_ingress, patch_data)
environment.clear_all_caches
success
else
error(_('Failed to update the Canary Ingress.'), :bad_request)
Loading
Loading
---
title: Fix Canary Ingress weight is not reflected on UI immediately
merge_request: 50246
author:
type: fixed
Loading
Loading
@@ -1547,4 +1547,18 @@
end
end
end
describe '#clear_all_caches' do
subject { environment.clear_all_caches }
it 'clears all caches on the environment' do
expect_next_instance_of(Gitlab::EtagCaching::Store) do |store|
expect(store).to receive(:touch).with(environment.etag_cache_key)
end
expect(environment).to receive(:clear_reactive_cache!)
subject
end
end
end
Loading
Loading
@@ -117,6 +117,12 @@
expect(subject[:status]).to eq(:success)
expect(subject[:message]).to be_nil
end
it 'clears all caches' do
expect(environment).to receive(:clear_all_caches)
subject
end
end
 
context 'when patch request does not succeed' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment