diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-08 09:08:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-08 09:08:13 +0300 |
commit | f6e985dba4d0f5b1ede95e9174d30dd6a8bedf0d (patch) | |
tree | c1fed91ae38ad6150ba323a2fc9a68f50f648bb4 /spec/finders/clusters | |
parent | 30010b161d42bdac3ab5cd16e63cc61c2f4939f3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders/clusters')
-rw-r--r-- | spec/finders/clusters/knative_serving_namespace_finder_spec.rb | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/spec/finders/clusters/knative_serving_namespace_finder_spec.rb b/spec/finders/clusters/knative_serving_namespace_finder_spec.rb deleted file mode 100644 index eceae75c444..00000000000 --- a/spec/finders/clusters/knative_serving_namespace_finder_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe Clusters::KnativeServingNamespaceFinder do - include KubernetesHelpers - let(:cluster) { create(:cluster, :project, :provided_by_gcp) } - let(:service) { environment.deployment_platform } - let(:project) { cluster.cluster_project.project } - let(:environment) { create(:environment, project: project) } - - subject { Clusters::KnativeServingNamespaceFinder.new(cluster) } - - before do - stub_kubeclient_discover(service.api_url) - end - - it 'finds the namespace in a cluster where it exists' do - stub_kubeclient_get_namespace(service.api_url, namespace: Clusters::Kubernetes::KNATIVE_SERVING_NAMESPACE) - expect(subject.execute).to be_a Kubeclient::Resource - end - - it 'returns nil in a cluster where it does not' do - stub_kubeclient_get_namespace( - service.api_url, - namespace: Clusters::Kubernetes::KNATIVE_SERVING_NAMESPACE, - response: { - status: [404, "Resource Not Found"] - } - ) - expect(subject.execute).to be nil - end - - it 'returns nil in a cluster where the lookup results in a 403 as it will in some versions of kubernetes' do - stub_kubeclient_get_namespace( - service.api_url, - namespace: Clusters::Kubernetes::KNATIVE_SERVING_NAMESPACE, - response: { - status: [403, "Resource Not Found"] - } - ) - expect(subject.execute).to be nil - end - - it 'raises an error if error code is not 404 or 403' do - stub_kubeclient_get_namespace( - service.api_url, - namespace: Clusters::Kubernetes::KNATIVE_SERVING_NAMESPACE, - response: { - status: [500, "Internal Server Error"] - } - ) - expect { subject.execute }.to raise_error(Kubeclient::HttpError) - end -end |