openshift_client 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/lib/openshift_client.rb +8 -2
- data/lib/openshift_client/version.rb +1 -1
- data/openshift_client.gemspec +1 -1
- data/test/json/image.json +63 -0
- data/test/json/image_stream.json +21 -0
- data/test/json/image_streams_list.json +29 -0
- data/test/json/images_list.json +71 -0
- data/test/test_build.rb +2 -6
- data/test/test_build_config.rb +2 -6
- data/test/test_cluster_role_binding.rb +2 -6
- data/test/test_helper.rb +6 -0
- data/test/test_image.rb +47 -0
- data/test/test_image_stream.rb +44 -0
- data/test/test_project.rb +2 -6
- data/test/test_route.rb +1 -5
- metadata +16 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ecd1935db85caf1bdf07140b21687832c0d2286
|
4
|
+
data.tar.gz: 0ff849a505f7cdb6571b121f4bd373598857242b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 437ffe72d0d5fca6c3096dd30d23bd9f6d7c6ac7d0b36f5d7d8dee3f8003c0f57be381fb89a2f1e776421f52555d04445a1bdc05c64ca37d6731f0a5dad5eea5
|
7
|
+
data.tar.gz: 1232ab29fa5eef4071839756d232750bf4f0ef6371dfe77e2e297b2a27c249a4c693db69e74bc6520e7607c272487ee29d6c2dad7c6f5a47d95f3cd7a6850d55
|
data/.rubocop.yml
CHANGED
data/lib/openshift_client.rb
CHANGED
@@ -16,7 +16,8 @@ module OpenshiftClient
|
|
16
16
|
# This cancels the need to define the classes
|
17
17
|
# manually on every new entity addition,
|
18
18
|
# and especially since currently the class body is empty
|
19
|
-
ENTITY_TYPES = %w(Project Route ClusterRoleBinding Build BuildConfig
|
19
|
+
ENTITY_TYPES = %w(Project Route ClusterRoleBinding Build BuildConfig Image
|
20
|
+
ImageStream).map do |et|
|
20
21
|
[OpenshiftClient.const_set(et, Class.new(RecursiveOpenStruct)), et]
|
21
22
|
end
|
22
23
|
|
@@ -36,9 +37,14 @@ module OpenshiftClient
|
|
36
37
|
password: nil,
|
37
38
|
bearer_token: nil,
|
38
39
|
bearer_token_file: nil
|
40
|
+
},
|
41
|
+
socket_options: {
|
42
|
+
socket_class: nil,
|
43
|
+
ssl_socket_class: nil
|
39
44
|
}
|
40
45
|
)
|
41
|
-
initialize_client(uri, path, version, ssl_options: ssl_options, auth_options: auth_options
|
46
|
+
initialize_client(uri, path, version, ssl_options: ssl_options, auth_options: auth_options,
|
47
|
+
socket_options: socket_options)
|
42
48
|
end
|
43
49
|
|
44
50
|
def all_entities
|
data/openshift_client.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency 'minitest'
|
25
25
|
spec.add_development_dependency 'webmock'
|
26
26
|
spec.add_development_dependency 'rubocop', '= 0.30.0'
|
27
|
-
spec.add_dependency 'kubeclient', '~> 1.
|
27
|
+
spec.add_dependency 'kubeclient', '~> 1.1.0'
|
28
28
|
spec.add_dependency 'activesupport'
|
29
29
|
spec.add_dependency 'recursive-open-struct', '= 1.0.0'
|
30
30
|
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
{
|
2
|
+
"kind": "Image",
|
3
|
+
"apiVersion": "v1",
|
4
|
+
"metadata": {
|
5
|
+
"name": "sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24",
|
6
|
+
"selfLink": "/oapi/v1/images/sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24",
|
7
|
+
"uid": "256f00dd-7b37-11e5-8942-28d2447dcefe",
|
8
|
+
"resourceVersion": "194",
|
9
|
+
"creationTimestamp": "2015-10-25T16:40:48Z"
|
10
|
+
},
|
11
|
+
"dockerImageReference": "openshift/ruby-20-centos7@sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24",
|
12
|
+
"dockerImageMetadata": {
|
13
|
+
"kind": "DockerImage",
|
14
|
+
"apiVersion": "1.0",
|
15
|
+
"Id": "sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24",
|
16
|
+
"Parent": "980c4802b0fa001cd0fec081afedfee041ec49438a1670e05350c6a25610ac03",
|
17
|
+
"Created": "2015-10-23T20:21:41Z",
|
18
|
+
"ContainerConfig": {},
|
19
|
+
"DockerVersion": "1.7.1",
|
20
|
+
"Author": "SoftwareCollections.org \u003csclorg@redhat.com\u003e",
|
21
|
+
"Config": {
|
22
|
+
"User": "1001",
|
23
|
+
"ExposedPorts": {
|
24
|
+
"8080/tcp": {}
|
25
|
+
},
|
26
|
+
"Env": [
|
27
|
+
"PATH=/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
28
|
+
"STI_SCRIPTS_URL=image:///usr/libexec/s2i",
|
29
|
+
"STI_SCRIPTS_PATH=/usr/libexec/s2i",
|
30
|
+
"HOME=/opt/app-root/src",
|
31
|
+
"BASH_ENV=/opt/app-root/etc/scl_enable",
|
32
|
+
"ENV=/opt/app-root/etc/scl_enable",
|
33
|
+
"PROMPT_COMMAND=. /opt/app-root/etc/scl_enable",
|
34
|
+
"RUBY_VERSION=2.0"
|
35
|
+
],
|
36
|
+
"Cmd": [
|
37
|
+
"/bin/sh",
|
38
|
+
"-c",
|
39
|
+
"$STI_SCRIPTS_PATH/usage"
|
40
|
+
],
|
41
|
+
"Image": "980c4802b0fa001cd0fec081afedfee041ec49438a1670e05350c6a25610ac03",
|
42
|
+
"WorkingDir": "/opt/app-root/src",
|
43
|
+
"Entrypoint": [
|
44
|
+
"container-entrypoint"
|
45
|
+
],
|
46
|
+
"Labels": {
|
47
|
+
"License": "GPLv2",
|
48
|
+
"Vendor": "CentOS",
|
49
|
+
"io.k8s.description": "Platform for building and running Ruby 2.0 applications",
|
50
|
+
"io.k8s.display-name": "Ruby 2.0",
|
51
|
+
"io.openshift.builder-base-version": "f5bfa20",
|
52
|
+
"io.openshift.builder-version": "33dadac",
|
53
|
+
"io.openshift.expose-services": "8080:http",
|
54
|
+
"io.openshift.s2i.scripts-url": "image:///usr/libexec/s2i",
|
55
|
+
"io.openshift.tags": "builder,ruby,ruby20",
|
56
|
+
"io.s2i.scripts-url": "image:///usr/libexec/s2i"
|
57
|
+
}
|
58
|
+
},
|
59
|
+
"Architecture": "amd64",
|
60
|
+
"Size": 53514887
|
61
|
+
},
|
62
|
+
"dockerImageMetadataVersion": "1.0"
|
63
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"kind": "ImageStream",
|
3
|
+
"apiVersion": "v1",
|
4
|
+
"metadata": {
|
5
|
+
"name": "eng-boss-image-inspector",
|
6
|
+
"namespace": "default",
|
7
|
+
"selfLink": "/oapi/v1/namespaces/default/imagestreams/eng-boss-image-inspector",
|
8
|
+
"uid": "f4499f16-b7bc-11e5-a0a4-001a4a231290",
|
9
|
+
"resourceVersion": "2836367",
|
10
|
+
"creationTimestamp": "2016-01-10T17:09:48Z",
|
11
|
+
"annotations": {
|
12
|
+
"openshift.io/image.dockerRepositoryCheck": "the registry \"https://rcm-img-docker01.build.eng.bos.redhat.com:5001\" could not be reached"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
"spec": {
|
16
|
+
"dockerImageRepository": "rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/image-inspector"
|
17
|
+
},
|
18
|
+
"status": {
|
19
|
+
"dockerImageRepository": "172.30.107.74:5000/default/eng-boss-image-inspector"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"kind": "ImageStreamList",
|
3
|
+
"apiVersion": "v1",
|
4
|
+
"metadata": {
|
5
|
+
"selfLink": "/oapi/v1/imagestreams",
|
6
|
+
"resourceVersion": "4544663"
|
7
|
+
},
|
8
|
+
"items": [
|
9
|
+
{
|
10
|
+
"metadata": {
|
11
|
+
"name": "eng-boss-image-inspector",
|
12
|
+
"namespace": "default",
|
13
|
+
"selfLink": "/oapi/v1/namespaces/default/imagestreams/eng-boss-image-inspector",
|
14
|
+
"uid": "f4499f16-b7bc-11e5-a0a4-001a4a231290",
|
15
|
+
"resourceVersion": "2836367",
|
16
|
+
"creationTimestamp": "2016-01-10T17:09:48Z",
|
17
|
+
"annotations": {
|
18
|
+
"openshift.io/image.dockerRepositoryCheck": "the registry \"https://rcm-img-docker01.build.eng.bos.redhat.com:5001\" could not be reached"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"spec": {
|
22
|
+
"dockerImageRepository": "rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/image-inspector"
|
23
|
+
},
|
24
|
+
"status": {
|
25
|
+
"dockerImageRepository": "172.30.107.74:5000/default/eng-boss-image-inspector"
|
26
|
+
}
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
{
|
2
|
+
"kind": "ImageList",
|
3
|
+
"apiVersion": "v1",
|
4
|
+
"metadata": {
|
5
|
+
"selfLink": "/oapi/v1/images",
|
6
|
+
"resourceVersion": "1041755"
|
7
|
+
},
|
8
|
+
"items": [
|
9
|
+
{
|
10
|
+
"metadata": {
|
11
|
+
"name": "sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24",
|
12
|
+
"selfLink": "/oapi/v1/images/sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24",
|
13
|
+
"uid": "256f00dd-7b37-11e5-8942-28d2447dcefe",
|
14
|
+
"resourceVersion": "194",
|
15
|
+
"creationTimestamp": "2015-10-25T16:40:48Z"
|
16
|
+
},
|
17
|
+
"dockerImageReference": "openshift/ruby-20-centos7@sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24",
|
18
|
+
"dockerImageMetadata": {
|
19
|
+
"kind": "DockerImage",
|
20
|
+
"apiVersion": "1.0",
|
21
|
+
"Id": "sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24",
|
22
|
+
"Parent": "980c4802b0fa001cd0fec081afedfee041ec49438a1670e05350c6a25610ac03",
|
23
|
+
"Created": "2015-10-23T20:21:41Z",
|
24
|
+
"ContainerConfig": {},
|
25
|
+
"DockerVersion": "1.7.1",
|
26
|
+
"Author": "SoftwareCollections.org \u003csclorg@redhat.com\u003e",
|
27
|
+
"Config": {
|
28
|
+
"User": "1001",
|
29
|
+
"ExposedPorts": {
|
30
|
+
"8080/tcp": {}
|
31
|
+
},
|
32
|
+
"Env": [
|
33
|
+
"PATH=/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
34
|
+
"STI_SCRIPTS_URL=image:///usr/libexec/s2i",
|
35
|
+
"STI_SCRIPTS_PATH=/usr/libexec/s2i",
|
36
|
+
"HOME=/opt/app-root/src",
|
37
|
+
"BASH_ENV=/opt/app-root/etc/scl_enable",
|
38
|
+
"ENV=/opt/app-root/etc/scl_enable",
|
39
|
+
"PROMPT_COMMAND=. /opt/app-root/etc/scl_enable",
|
40
|
+
"RUBY_VERSION=2.0"
|
41
|
+
],
|
42
|
+
"Cmd": [
|
43
|
+
"/bin/sh",
|
44
|
+
"-c",
|
45
|
+
"$STI_SCRIPTS_PATH/usage"
|
46
|
+
],
|
47
|
+
"Image": "980c4802b0fa001cd0fec081afedfee041ec49438a1670e05350c6a25610ac03",
|
48
|
+
"WorkingDir": "/opt/app-root/src",
|
49
|
+
"Entrypoint": [
|
50
|
+
"container-entrypoint"
|
51
|
+
],
|
52
|
+
"Labels": {
|
53
|
+
"License": "GPLv2",
|
54
|
+
"Vendor": "CentOS",
|
55
|
+
"io.k8s.description": "Platform for building and running Ruby 2.0 applications",
|
56
|
+
"io.k8s.display-name": "Ruby 2.0",
|
57
|
+
"io.openshift.builder-base-version": "f5bfa20",
|
58
|
+
"io.openshift.builder-version": "33dadac",
|
59
|
+
"io.openshift.expose-services": "8080:http",
|
60
|
+
"io.openshift.s2i.scripts-url": "image:///usr/libexec/s2i",
|
61
|
+
"io.openshift.tags": "builder,ruby,ruby20",
|
62
|
+
"io.s2i.scripts-url": "image:///usr/libexec/s2i"
|
63
|
+
}
|
64
|
+
},
|
65
|
+
"Architecture": "amd64",
|
66
|
+
"Size": 53514887
|
67
|
+
},
|
68
|
+
"dockerImageMetadataVersion": "1.0"
|
69
|
+
}
|
70
|
+
]
|
71
|
+
}
|
data/test/test_build.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
def open_test_json_file(name)
|
4
|
-
File.new(File.join(File.dirname(__FILE__), 'json', name))
|
5
|
-
end
|
6
|
-
|
7
3
|
# Build entity tests
|
8
4
|
class TestBuild < MiniTest::Test
|
9
5
|
def test_get_builds
|
10
6
|
stub_request(:get, %r{/builds})
|
11
|
-
.to_return(body:
|
7
|
+
.to_return(body: open_test_file('builds_list.json'),
|
12
8
|
status: 200)
|
13
9
|
|
14
10
|
client = OpenshiftClient::Client.new 'https://localhost:8080'
|
@@ -25,7 +21,7 @@ class TestBuild < MiniTest::Test
|
|
25
21
|
|
26
22
|
def test_get_build
|
27
23
|
stub_request(:get, %r{/builds})
|
28
|
-
.to_return(body:
|
24
|
+
.to_return(body: open_test_file('build.json'),
|
29
25
|
status: 200)
|
30
26
|
|
31
27
|
client = OpenshiftClient::Client.new 'https://localhost:8080'
|
data/test/test_build_config.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
def open_test_json_file(name)
|
4
|
-
File.new(File.join(File.dirname(__FILE__), 'json', name))
|
5
|
-
end
|
6
|
-
|
7
3
|
# Buildconfig entity tests
|
8
4
|
class TestBuildconfig < MiniTest::Test
|
9
5
|
def test_get_buildconfigs
|
10
6
|
stub_request(:get, %r{/buildconfigs})
|
11
|
-
.to_return(body:
|
7
|
+
.to_return(body: open_test_file('buildconfigs_list.json'),
|
12
8
|
status: 200)
|
13
9
|
|
14
10
|
client = OpenshiftClient::Client.new 'https://localhost:8080'
|
@@ -25,7 +21,7 @@ class TestBuildconfig < MiniTest::Test
|
|
25
21
|
|
26
22
|
def test_get_buildconfig
|
27
23
|
stub_request(:get, %r{/buildconfigs})
|
28
|
-
.to_return(body:
|
24
|
+
.to_return(body: open_test_file('buildconfig.json'),
|
29
25
|
status: 200)
|
30
26
|
|
31
27
|
client = OpenshiftClient::Client.new 'https://localhost:8080'
|
@@ -1,14 +1,10 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
def open_test_json_file(name)
|
4
|
-
File.new(File.join(File.dirname(__FILE__), 'json', name))
|
5
|
-
end
|
6
|
-
|
7
3
|
# ClusterRoleBinding entity tests
|
8
4
|
class TestClusterRoleBinding < MiniTest::Test
|
9
5
|
def test_get_cluster_role_binding
|
10
6
|
stub_request(:get, %r{/clusterrolebindings/cluster-admins})
|
11
|
-
.to_return(body:
|
7
|
+
.to_return(body: open_test_file('cluster_role_binding.json'),
|
12
8
|
status: 200)
|
13
9
|
|
14
10
|
client = OpenshiftClient::Client.new 'https://localhost:8080/oapi'
|
@@ -22,7 +18,7 @@ class TestClusterRoleBinding < MiniTest::Test
|
|
22
18
|
|
23
19
|
def test_get_cluster_role_bindings
|
24
20
|
stub_request(:get, %r{/clusterrolebindings})
|
25
|
-
.to_return(body:
|
21
|
+
.to_return(body: open_test_file('cluster_role_bindings_list.json'),
|
26
22
|
status: 200)
|
27
23
|
|
28
24
|
client = OpenshiftClient::Client.new 'https://localhost:8080/oapi'
|
data/test/test_helper.rb
CHANGED
@@ -2,3 +2,9 @@ require 'minitest/autorun'
|
|
2
2
|
require 'webmock/minitest'
|
3
3
|
require 'json'
|
4
4
|
require 'openshift_client'
|
5
|
+
|
6
|
+
# Assumes test files will be in a subdirectory with the same name as the
|
7
|
+
# file suffix. e.g. a file named foo.json would be a "json" subdirectory.
|
8
|
+
def open_test_file(name)
|
9
|
+
File.new(File.join(File.dirname(__FILE__), name.split('.').last, name))
|
10
|
+
end
|
data/test/test_image.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
def open_test_json_file(name)
|
4
|
+
File.new(File.join(File.dirname(__FILE__), 'json', name))
|
5
|
+
end
|
6
|
+
|
7
|
+
# Image entity tests
|
8
|
+
class TestImage < MiniTest::Test
|
9
|
+
def test_get_images
|
10
|
+
stub_request(:get, %r{/images})
|
11
|
+
.to_return(body: open_test_json_file('images_list.json'),
|
12
|
+
status: 200)
|
13
|
+
|
14
|
+
client = OpenshiftClient::Client.new 'https://localhost:8080'
|
15
|
+
images = client.get_images
|
16
|
+
|
17
|
+
assert_instance_of(Kubeclient::Common::EntityList, images)
|
18
|
+
|
19
|
+
assert_equal(1, images.size)
|
20
|
+
assert_instance_of(OpenshiftClient::Image, images[0])
|
21
|
+
assert_requested(:get,
|
22
|
+
'https://localhost:8080/oapi/v1/images',
|
23
|
+
times: 1)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_get_image
|
27
|
+
stub_request(:get, %r{/images})
|
28
|
+
.to_return(body: open_test_json_file('image.json'),
|
29
|
+
status: 200)
|
30
|
+
|
31
|
+
client = OpenshiftClient::Client.new 'https://localhost:8080'
|
32
|
+
image = client.get_image 'sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24',
|
33
|
+
'default'
|
34
|
+
|
35
|
+
assert_instance_of(OpenshiftClient::Image, image)
|
36
|
+
assert_equal(
|
37
|
+
'sha256:9b214cc086795a08f41b55553e21a311bda2408cee537a40c4d785b44bd24',
|
38
|
+
image.metadata.name)
|
39
|
+
assert_equal('v1', image.apiVersion)
|
40
|
+
assert_equal('DockerImage', image.dockerImageMetadata.kind)
|
41
|
+
|
42
|
+
assert_requested(:get,
|
43
|
+
'https://localhost:8080/oapi/v1/namespaces/default/images/sha256:9b214cc0867'\
|
44
|
+
'95a08f41b55553e21a311bda2408cee537a40c4d785b44bd24',
|
45
|
+
times: 1)
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
def open_test_json_file(name)
|
4
|
+
File.new(File.join(File.dirname(__FILE__), 'json', name))
|
5
|
+
end
|
6
|
+
|
7
|
+
# ImageStream entity tests
|
8
|
+
class TestImageStream < MiniTest::Test
|
9
|
+
def test_get_image_streams
|
10
|
+
stub_request(:get, %r{/imagestreams})
|
11
|
+
.to_return(body: open_test_json_file('image_streams_list.json'),
|
12
|
+
status: 200)
|
13
|
+
|
14
|
+
client = OpenshiftClient::Client.new 'https://localhost:8080'
|
15
|
+
image_streams = client.get_image_streams
|
16
|
+
|
17
|
+
assert_instance_of(Kubeclient::Common::EntityList, image_streams)
|
18
|
+
|
19
|
+
assert_equal(1, image_streams.size)
|
20
|
+
assert_instance_of(OpenshiftClient::ImageStream, image_streams[0])
|
21
|
+
assert_requested(:get,
|
22
|
+
'https://localhost:8080/oapi/v1/imagestreams',
|
23
|
+
times: 1)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_get_image_stream
|
27
|
+
stub_request(:get, %r{/imagestreams})
|
28
|
+
.to_return(body: open_test_json_file('image_stream.json'),
|
29
|
+
status: 200)
|
30
|
+
|
31
|
+
client = OpenshiftClient::Client.new 'https://localhost:8080'
|
32
|
+
image_stream = client.get_image_stream 'eng-boss-image-inspector', 'default'
|
33
|
+
|
34
|
+
assert_instance_of(OpenshiftClient::ImageStream, image_stream)
|
35
|
+
assert_equal('eng-boss-image-inspector', image_stream.metadata.name)
|
36
|
+
assert_equal('v1', image_stream.apiVersion)
|
37
|
+
assert_equal('172.30.107.74:5000/default/eng-boss-image-inspector',
|
38
|
+
image_stream.status.dockerImageRepository)
|
39
|
+
|
40
|
+
assert_requested(:get,
|
41
|
+
'https://localhost:8080/oapi/v1/namespaces/default/imagestreams/eng-boss-image-inspector',
|
42
|
+
times: 1)
|
43
|
+
end
|
44
|
+
end
|
data/test/test_project.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
def open_test_json_file(name)
|
4
|
-
File.new(File.join(File.dirname(__FILE__), 'json', name))
|
5
|
-
end
|
6
|
-
|
7
3
|
# Project entity tests
|
8
4
|
class TestProject < MiniTest::Test
|
9
5
|
def test_get_project
|
10
6
|
stub_request(:get, %r{/projects})
|
11
|
-
.to_return(body:
|
7
|
+
.to_return(body: open_test_file('project_b1.json'),
|
12
8
|
status: 200)
|
13
9
|
|
14
10
|
client = OpenshiftClient::Client.new 'https://localhost:8080/oapi'
|
@@ -23,7 +19,7 @@ class TestProject < MiniTest::Test
|
|
23
19
|
|
24
20
|
def test_get_projects
|
25
21
|
stub_request(:get, %r{/projects})
|
26
|
-
.to_return(body:
|
22
|
+
.to_return(body: open_test_file('project_list_b1.json'),
|
27
23
|
status: 200)
|
28
24
|
|
29
25
|
client = OpenshiftClient::Client.new 'https://localhost:8080/oapi'
|
data/test/test_route.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
def open_test_json_file(name)
|
4
|
-
File.new(File.join(File.dirname(__FILE__), 'json', name))
|
5
|
-
end
|
6
|
-
|
7
3
|
# Project entity tests
|
8
4
|
class TestRoute < MiniTest::Test
|
9
5
|
def test_get_routes
|
10
6
|
stub_request(:get, %r{/routes})
|
11
|
-
.to_return(body:
|
7
|
+
.to_return(body: open_test_file('route_b1.json'),
|
12
8
|
status: 200)
|
13
9
|
|
14
10
|
client = OpenshiftClient::Client.new 'https://localhost:8080/oapi'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openshift_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alissa Bonas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.
|
89
|
+
version: 1.1.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
96
|
+
version: 1.1.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: activesupport
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,6 +145,10 @@ files:
|
|
145
145
|
- test/json/builds_list.json
|
146
146
|
- test/json/cluster_role_binding.json
|
147
147
|
- test/json/cluster_role_bindings_list.json
|
148
|
+
- test/json/image.json
|
149
|
+
- test/json/image_stream.json
|
150
|
+
- test/json/image_streams_list.json
|
151
|
+
- test/json/images_list.json
|
148
152
|
- test/json/project_b1.json
|
149
153
|
- test/json/project_list_b1.json
|
150
154
|
- test/json/route_b1.json
|
@@ -153,6 +157,8 @@ files:
|
|
153
157
|
- test/test_client.rb
|
154
158
|
- test/test_cluster_role_binding.rb
|
155
159
|
- test/test_helper.rb
|
160
|
+
- test/test_image.rb
|
161
|
+
- test/test_image_stream.rb
|
156
162
|
- test/test_project.rb
|
157
163
|
- test/test_route.rb
|
158
164
|
homepage: https://github.com/abonas/openshift_client
|
@@ -186,6 +192,10 @@ test_files:
|
|
186
192
|
- test/json/builds_list.json
|
187
193
|
- test/json/cluster_role_binding.json
|
188
194
|
- test/json/cluster_role_bindings_list.json
|
195
|
+
- test/json/image.json
|
196
|
+
- test/json/image_stream.json
|
197
|
+
- test/json/image_streams_list.json
|
198
|
+
- test/json/images_list.json
|
189
199
|
- test/json/project_b1.json
|
190
200
|
- test/json/project_list_b1.json
|
191
201
|
- test/json/route_b1.json
|
@@ -194,5 +204,7 @@ test_files:
|
|
194
204
|
- test/test_client.rb
|
195
205
|
- test/test_cluster_role_binding.rb
|
196
206
|
- test/test_helper.rb
|
207
|
+
- test/test_image.rb
|
208
|
+
- test/test_image_stream.rb
|
197
209
|
- test/test_project.rb
|
198
210
|
- test/test_route.rb
|