Class: Gitlab::QA::Service::ClusterProvider::K3d
- Defined in:
- lib/gitlab/qa/service/cluster_provider/k3d.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Methods included from Gitlab::QA::Support::Shellout
Instance Method Details
#create_registry_mirror ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/gitlab/qa/service/cluster_provider/k3d.rb', line 8 def create_registry_mirror return if registry_mirror_exists?('registry-gitlab') Runtime::Env.require_qa_container_registry_access_token! shell <<~CMD k3d registry create registry-gitlab \ -p 5000 \ --proxy-remote-url https://#{GITLAB_REGISTRY} \ --proxy-password #{Runtime::Env.gitlab_username} \ --proxy-username #{Runtime::Env.qa_container_registry_access_token} \ -v tmp/registry-gitlab:/var/lib/registry CMD File.write('tmp/registry-mirror.yml', registry_mirror) create_args << %w[--registry-use k3d-registry-gitlab:5000 --registry-config tmp/registry-mirror.yml] end |
#setup ⇒ Object
31 32 33 34 35 |
# File 'lib/gitlab/qa/service/cluster_provider/k3d.rb', line 31 def setup shell "k3d cluster create #{cluster_name} #{create_args&.join(' ')}" install_local_storage end |
#teardown ⇒ Object
37 38 39 |
# File 'lib/gitlab/qa/service/cluster_provider/k3d.rb', line 37 def teardown shell "k3d cluster delete #{cluster_name}" end |
#validate_dependencies ⇒ Object
27 28 29 |
# File 'lib/gitlab/qa/service/cluster_provider/k3d.rb', line 27 def validate_dependencies find_executable('k3d') || raise("You must first install `k3d` executable to run these tests.") end |