diff options
Diffstat (limited to 'qa/qa/runtime/namespace.rb')
-rw-r--r-- | qa/qa/runtime/namespace.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/qa/qa/runtime/namespace.rb b/qa/qa/runtime/namespace.rb index 565bfd43f12..6b4cbe6af6e 100644 --- a/qa/qa/runtime/namespace.rb +++ b/qa/qa/runtime/namespace.rb @@ -9,14 +9,19 @@ module QA @time ||= Time.now end - def name + def name(reset_cache: !Runtime::Env.cache_namespace_name?) # If any changes are made to the name tag, following script has to be considered: # https://ops.gitlab.net/gitlab-com/gl-infra/traffic-generator/blob/master/bin/janitor.bash - @name ||= Runtime::Env.namespace_name || "qa-test-#{time.strftime('%Y-%m-%d-%H-%M-%S')}-#{SecureRandom.hex(8)}" + reset_name_cache if reset_cache + @name ||= Runtime::Env.namespace_name || "qa-test-#{time.strftime('%Y-%m-%d-%H-%M-%S')}-#{SecureRandom.hex(8)}" # rubocop:disable Gitlab/ModuleWithInstanceVariables + end + + def reset_name_cache + @name = nil # rubocop:disable Gitlab/ModuleWithInstanceVariables end def path - "#{sandbox_name}/#{name}" + "#{sandbox_name}/#{name(reset_cache: false)}" end def sandbox_name |