fog-google 1.14.0 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/scripts/setup_creds.sh +10 -0
- data/.github/workflows/integration.yml +225 -0
- data/.github/workflows/stale.yml +1 -1
- data/.github/workflows/unit.yml +26 -0
- data/CHANGELOG.md +40 -0
- data/README.md +11 -10
- data/fog-google.gemspec +11 -2
- data/lib/fog/compute/google/models/address.rb +0 -0
- data/lib/fog/compute/google/models/addresses.rb +0 -0
- data/lib/fog/compute/google/models/network.rb +1 -1
- data/lib/fog/compute/google/models/region.rb +0 -0
- data/lib/fog/compute/google/models/regions.rb +0 -0
- data/lib/fog/compute/google/models/server.rb +7 -0
- data/lib/fog/compute/google/models/servers.rb +4 -1
- data/lib/fog/compute/google/models/subnetwork.rb +0 -0
- data/lib/fog/compute/google/requests/get_region.rb +0 -0
- data/lib/fog/compute/google/requests/insert_network.rb +1 -11
- data/lib/fog/compute/google/requests/insert_server.rb +4 -0
- data/lib/fog/google/version.rb +1 -1
- data/lib/fog/storage/google_json/models/file.rb +10 -1
- data/lib/fog/storage/google_json/models/files.rb +2 -2
- data/lib/fog/storage/google_json/real.rb +4 -4
- data/lib/fog/storage/google_json/requests/get_object.rb +1 -0
- data/lib/fog/storage/google_json/requests/get_object_url.rb +2 -2
- data/test/helpers/integration_test_helper.rb +2 -2
- data/test/helpers/test_helper.rb +7 -3
- data/test/integration/compute/core_compute/test_servers.rb +2 -2
- data/test/integration/compute/core_networking/test_networks.rb +0 -11
- data/test/integration/factories/networks_factory.rb +4 -6
- data/test/integration/storage/storage_shared.rb +7 -2
- data/test/integration/storage/test_objects.rb +3 -1
- metadata +97 -27
- data/.github/workflows/ruby.yml +0 -34
- data/ci/.gitignore +0 -1
- data/ci/README.md +0 -65
- data/ci/build-head-pipeline.yml +0 -173
- data/ci/credentials.yml.template +0 -28
- data/ci/docker-image/Dockerfile +0 -18
- data/ci/integration-pipeline.yml +0 -226
- data/ci/pipeline-dev.yml +0 -58
- data/ci/tasks/run-int.sh +0 -53
- data/ci/tasks/run-int.yml +0 -18
- data/ci/tasks/utils.sh +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abd0506ef51980b23273cfda4ef059113f220a1b9d2480a5433a3fbaf6d7d985
|
4
|
+
data.tar.gz: 6f8c866d492ac0292df89d9c532da795ab91d4eec7ec1caec9fe259cfabd8dc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a93c4dcb1669954f3ec1b18e04f8c96a2bcca16c1d7946691b0c1158515342ca1213628576a1486d5b45d57ba77484b12f20eb2087e50f2a0e37de083613dcf
|
7
|
+
data.tar.gz: 623b43065a6218ffb6ef2dcdcd5ef4e7f51164af507d8677f543a25c9bc40e283cf5b7815dc43f78ff9d5276ff67512e578d1c7aa0f7c86e63d86e4523f39df1
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
GOOGLE_PROJECT=$(curl "http://metadata.google.internal/computeMetadata/v1/project/project-id" -H "Metadata-Flavor: Google")
|
4
|
+
|
5
|
+
# fog needs the google project to be specified even if it uses application-default creds
|
6
|
+
cat >~/.fog <<EOL
|
7
|
+
test:
|
8
|
+
google_project: ${GOOGLE_PROJECT}
|
9
|
+
google_application_default: true
|
10
|
+
EOL
|
@@ -0,0 +1,225 @@
|
|
1
|
+
name: integration-tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
types: [ assigned, opened, synchronize, reopened, labeled ]
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
test-compute-core:
|
12
|
+
runs-on: self-hosted
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby-version: [ '2.7', '3.0' ]
|
16
|
+
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
17
|
+
max-parallel: 1
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2.4.0
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
env:
|
24
|
+
# Needs to be set up for self-hosted runners, see:
|
25
|
+
# https://github.com/ruby/setup-ruby#using-self-hosted-runners
|
26
|
+
# Image used in runners: summerwind/actions-runner
|
27
|
+
ImageOS: ubuntu20
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby-version }}
|
30
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
31
|
+
- name: Install dependencies
|
32
|
+
run: bundle install
|
33
|
+
- name: Run tests
|
34
|
+
run: >-
|
35
|
+
./.github/scripts/setup_creds.sh &&
|
36
|
+
bundle exec rake test:compute-core_compute
|
37
|
+
|
38
|
+
test-compute-networking:
|
39
|
+
runs-on: self-hosted
|
40
|
+
strategy:
|
41
|
+
matrix:
|
42
|
+
ruby-version: [ '2.7', '3.0' ]
|
43
|
+
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
44
|
+
max-parallel: 1
|
45
|
+
|
46
|
+
steps:
|
47
|
+
- uses: actions/checkout@v2.4.0
|
48
|
+
- name: Set up Ruby
|
49
|
+
uses: ruby/setup-ruby@v1
|
50
|
+
env:
|
51
|
+
# Needs to be set up for self-hosted runners, see:
|
52
|
+
# https://github.com/ruby/setup-ruby#using-self-hosted-runners
|
53
|
+
# Image used in runners: summerwind/actions-runner
|
54
|
+
ImageOS: ubuntu20
|
55
|
+
with:
|
56
|
+
ruby-version: ${{ matrix.ruby-version }}
|
57
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
58
|
+
- name: Install dependencies
|
59
|
+
run: bundle install
|
60
|
+
- name: Run tests
|
61
|
+
run: >-
|
62
|
+
./.github/scripts/setup_creds.sh &&
|
63
|
+
bundle exec rake test:compute-core_networking
|
64
|
+
|
65
|
+
test-compute-instance_groups:
|
66
|
+
runs-on: self-hosted
|
67
|
+
strategy:
|
68
|
+
matrix:
|
69
|
+
ruby-version: [ '2.7', '3.0' ]
|
70
|
+
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
71
|
+
max-parallel: 1
|
72
|
+
|
73
|
+
steps:
|
74
|
+
- uses: actions/checkout@v2.4.0
|
75
|
+
- name: Set up Ruby
|
76
|
+
uses: ruby/setup-ruby@v1
|
77
|
+
env:
|
78
|
+
# Needs to be set up for self-hosted runners, see:
|
79
|
+
# https://github.com/ruby/setup-ruby#using-self-hosted-runners
|
80
|
+
# Image used in runners: summerwind/actions-runner
|
81
|
+
ImageOS: ubuntu20
|
82
|
+
with:
|
83
|
+
ruby-version: ${{ matrix.ruby-version }}
|
84
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
85
|
+
- name: Install dependencies
|
86
|
+
run: bundle install
|
87
|
+
- name: Run tests
|
88
|
+
run: >-
|
89
|
+
./.github/scripts/setup_creds.sh &&
|
90
|
+
bundle exec rake test:compute-instance_groups
|
91
|
+
|
92
|
+
test-compute-loadbalancing:
|
93
|
+
runs-on: self-hosted
|
94
|
+
strategy:
|
95
|
+
matrix:
|
96
|
+
ruby-version: [ '2.7', '3.0' ]
|
97
|
+
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
98
|
+
max-parallel: 1
|
99
|
+
|
100
|
+
steps:
|
101
|
+
- uses: actions/checkout@v2.4.0
|
102
|
+
- name: Set up Ruby
|
103
|
+
uses: ruby/setup-ruby@v1
|
104
|
+
env:
|
105
|
+
# Needs to be set up for self-hosted runners, see:
|
106
|
+
# https://github.com/ruby/setup-ruby#using-self-hosted-runners
|
107
|
+
# Image used in runners: summerwind/actions-runner
|
108
|
+
ImageOS: ubuntu20
|
109
|
+
with:
|
110
|
+
ruby-version: ${{ matrix.ruby-version }}
|
111
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
112
|
+
- name: Install dependencies
|
113
|
+
run: bundle install
|
114
|
+
- name: Run tests
|
115
|
+
run: >-
|
116
|
+
./.github/scripts/setup_creds.sh &&
|
117
|
+
bundle exec rake test:compute-loadbalancing
|
118
|
+
|
119
|
+
test-monitoring:
|
120
|
+
runs-on: self-hosted
|
121
|
+
strategy:
|
122
|
+
matrix:
|
123
|
+
ruby-version: [ '2.7', '3.0' ]
|
124
|
+
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
125
|
+
max-parallel: 1
|
126
|
+
|
127
|
+
steps:
|
128
|
+
- uses: actions/checkout@v2.4.0
|
129
|
+
- name: Set up Ruby
|
130
|
+
uses: ruby/setup-ruby@v1
|
131
|
+
env:
|
132
|
+
# Needs to be set up for self-hosted runners, see:
|
133
|
+
# https://github.com/ruby/setup-ruby#using-self-hosted-runners
|
134
|
+
# Image used in runners: summerwind/actions-runner
|
135
|
+
ImageOS: ubuntu20
|
136
|
+
with:
|
137
|
+
ruby-version: ${{ matrix.ruby-version }}
|
138
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
139
|
+
- name: Install dependencies
|
140
|
+
run: bundle install
|
141
|
+
- name: Run tests
|
142
|
+
run: >-
|
143
|
+
./.github/scripts/setup_creds.sh &&
|
144
|
+
bundle exec rake test:monitoring
|
145
|
+
|
146
|
+
test-storage:
|
147
|
+
runs-on: self-hosted
|
148
|
+
strategy:
|
149
|
+
matrix:
|
150
|
+
ruby-version: [ '2.7', '3.0' ]
|
151
|
+
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
152
|
+
max-parallel: 1
|
153
|
+
|
154
|
+
steps:
|
155
|
+
- uses: actions/checkout@v2.4.0
|
156
|
+
- name: Set up Ruby
|
157
|
+
uses: ruby/setup-ruby@v1
|
158
|
+
env:
|
159
|
+
# Needs to be set up for self-hosted runners, see:
|
160
|
+
# https://github.com/ruby/setup-ruby#using-self-hosted-runners
|
161
|
+
# Image used in runners: summerwind/actions-runner
|
162
|
+
ImageOS: ubuntu20
|
163
|
+
with:
|
164
|
+
ruby-version: ${{ matrix.ruby-version }}
|
165
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
166
|
+
- name: Install dependencies
|
167
|
+
run: bundle install
|
168
|
+
- name: Run tests
|
169
|
+
run: >-
|
170
|
+
./.github/scripts/setup_creds.sh &&
|
171
|
+
bundle exec rake test:storage
|
172
|
+
|
173
|
+
test-pubsub:
|
174
|
+
runs-on: self-hosted
|
175
|
+
strategy:
|
176
|
+
matrix:
|
177
|
+
ruby-version: [ '2.7', '3.0' ]
|
178
|
+
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
179
|
+
max-parallel: 1
|
180
|
+
|
181
|
+
steps:
|
182
|
+
- uses: actions/checkout@v2.4.0
|
183
|
+
- name: Set up Ruby
|
184
|
+
uses: ruby/setup-ruby@v1
|
185
|
+
env:
|
186
|
+
# Needs to be set up for self-hosted runners, see:
|
187
|
+
# https://github.com/ruby/setup-ruby#using-self-hosted-runners
|
188
|
+
# Image used in runners: summerwind/actions-runner
|
189
|
+
ImageOS: ubuntu20
|
190
|
+
with:
|
191
|
+
ruby-version: ${{ matrix.ruby-version }}
|
192
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
193
|
+
- name: Install dependencies
|
194
|
+
run: bundle install
|
195
|
+
- name: Run tests
|
196
|
+
run: >-
|
197
|
+
./.github/scripts/setup_creds.sh &&
|
198
|
+
bundle exec rake test:pubsub
|
199
|
+
|
200
|
+
test-sql:
|
201
|
+
runs-on: self-hosted
|
202
|
+
strategy:
|
203
|
+
matrix:
|
204
|
+
ruby-version: [ '2.7', '3.0' ]
|
205
|
+
# Integration tests from the same task cannot run in parallel yet due to cleanup
|
206
|
+
max-parallel: 1
|
207
|
+
|
208
|
+
steps:
|
209
|
+
- uses: actions/checkout@v2.4.0
|
210
|
+
- name: Set up Ruby
|
211
|
+
uses: ruby/setup-ruby@v1
|
212
|
+
env:
|
213
|
+
# Needs to be set up for self-hosted runners, see:
|
214
|
+
# https://github.com/ruby/setup-ruby#using-self-hosted-runners
|
215
|
+
# Image used in runners: summerwind/actions-runner
|
216
|
+
ImageOS: ubuntu20
|
217
|
+
with:
|
218
|
+
ruby-version: ${{ matrix.ruby-version }}
|
219
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
220
|
+
- name: Install dependencies
|
221
|
+
run: bundle install
|
222
|
+
- name: Run tests
|
223
|
+
run: >-
|
224
|
+
./.github/scripts/setup_creds.sh &&
|
225
|
+
bundle exec rake test:sql
|
data/.github/workflows/stale.yml
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
name: unit-tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test-unit:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby-version: ['2.5', '2.6', '2.7', '3.0', 'head', 'truffleruby-head']
|
15
|
+
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v2.4.0
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby-version }}
|
22
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
23
|
+
- name: Install dependencies
|
24
|
+
run: bundle install
|
25
|
+
- name: Run tests
|
26
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,46 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
6
6
|
|
7
7
|
## Next
|
8
8
|
|
9
|
+
|
10
|
+
## 1.17.0
|
11
|
+
|
12
|
+
### User-facing
|
13
|
+
|
14
|
+
#### Added
|
15
|
+
|
16
|
+
- \#550 Add support for instance display device [dcode]
|
17
|
+
|
18
|
+
## 1.16.1
|
19
|
+
|
20
|
+
### User-facing
|
21
|
+
|
22
|
+
#### Fixed
|
23
|
+
|
24
|
+
- \#545 Avoid duplicate GET requests when retrieving body [stanhu]
|
25
|
+
- \#547 Remove exec bit from non_scripts [kbrock]
|
26
|
+
|
27
|
+
## 1.16.0
|
28
|
+
|
29
|
+
### User-facing
|
30
|
+
|
31
|
+
#### Fixed
|
32
|
+
|
33
|
+
- \#540 Bring back integration tests for Fog-Google and fix an array of small bugs/regressions [temikus]
|
34
|
+
|
35
|
+
### Development changes
|
36
|
+
|
37
|
+
#### Added
|
38
|
+
|
39
|
+
- \#532 Add Truffleruby head to CI [gogainda]
|
40
|
+
|
41
|
+
## 1.15.0
|
42
|
+
|
43
|
+
### User-facing
|
44
|
+
|
45
|
+
#### Fixed
|
46
|
+
|
47
|
+
- \#534 Fix get_object not working with binary files [stanhu]
|
48
|
+
|
9
49
|
## 1.14.0
|
10
50
|
|
11
51
|
### User-facing
|
data/README.md
CHANGED
@@ -1,12 +1,3 @@
|
|
1
|
-
# ⚠️ ATTENTION ⚠️ HELP NEEDED WITH CI
|
2
|
-
|
3
|
-
With both me and icco@ departing Google **fog-google no longer has a CI stack** as we don't have access to a sponsored GCP account anymore and I've been unsuccessful in finding someone who would volunteer to maintain this project or CI at the time of my departure.
|
4
|
-
|
5
|
-
There is no easy way to say this but we need help as costs of running a CI stack that touches almost all GCP resources is significant. We know there's a lot of companies out there that are using this lib, as well as tooling based on it so if you want to help us with running a CI stack or provide sponsorship for a GCP account - please contact me at code \<at\> temik.me
|
6
|
-
|
7
|
-
--
|
8
|
-
Artem (temikus@) - Lead maintainer
|
9
|
-
|
10
1
|
# Fog::Google
|
11
2
|
|
12
3
|
[![Gem Version](https://badge.fury.io/rb/fog-google.svg)](http://badge.fury.io/rb/fog-google) [![Build Status](https://github.com/fog/fog-google/actions/workflows/ruby.yml/badge.svg)](https://github.com/fog/fog-google/actions/workflows/ruby.yml) [![codecov](https://codecov.io/gh/fog/fog-google/branch/master/graph/badge.svg)](https://codecov.io/gh/fog/fog-google) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=fog/fog-google)](https://dependabot.com) [![Doc coverage](https://inch-ci.org/github/fog/fog-google.svg?branch=master)](https://inch-ci.org/github/fog/fog-google)
|
@@ -21,6 +12,16 @@ The main maintainers for the Google sections are @icco, @Temikus and @plribeiro3
|
|
21
12
|
|
22
13
|
See **[MIGRATING.md](MIGRATING.md)** for migration between major versions.
|
23
14
|
|
15
|
+
# Sponsors
|
16
|
+
|
17
|
+
We're proud to be sponsored by MeisterLabs who are generously funding our CI stack. A small message from them:
|
18
|
+
|
19
|
+
<img align="right" width=100 height=100 src="https://user-images.githubusercontent.com/2083229/125146917-d965a680-e16b-11eb-8ad2-611b39056ca2.png">
|
20
|
+
|
21
|
+
*"As extensive users of fog-google we are excited to help! Meister is the company behind the productivity tools [MindMeister](https://www.mindmeister.com/), [MeisterTask](https://www.meistertask.com), and [MeisterNote](https://www.meisternote.com/). We are based in Vienna, Austria and we have a very talented international team who build our products on top of Ruby on Rails, Elixir, React and Redux. We are constantly looking for great talent in Engineering, so If you feel like taking on a new Ruby or Elixir challenge. get in touch, open jobs can be found [here](https://www.meisterlabs.com/jobs/)."*
|
22
|
+
|
23
|
+
# Usage
|
24
|
+
|
24
25
|
## Storage
|
25
26
|
|
26
27
|
There are two ways to access [Google Cloud Storage](https://cloud.google.com/storage/). The old S3 API and the new JSON API. `Fog::Storage::Google` will automatically direct you to the appropriate API based on the credentials you provide it.
|
@@ -174,7 +175,7 @@ $ bundle exec pry
|
|
174
175
|
|
175
176
|
## Supported Ruby Versions
|
176
177
|
|
177
|
-
Fog-google is currently supported on Ruby 2.
|
178
|
+
Fog-google is currently supported on Ruby 2.6+.
|
178
179
|
|
179
180
|
In general we support (and run our CI) for Ruby versions that are actively supported
|
180
181
|
by Ruby Core - that is, Ruby versions that are not end of life. Older versions of
|
data/fog-google.gemspec
CHANGED
@@ -25,11 +25,20 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_dependency "fog-json", "~> 1.2"
|
26
26
|
spec.add_dependency "fog-xml", "~> 0.1.0"
|
27
27
|
|
28
|
-
spec.add_dependency "google-
|
28
|
+
spec.add_dependency "google-apis-storage_v1", "~> 0.6"
|
29
|
+
spec.add_dependency "google-apis-iamcredentials_v1", "~> 0.6"
|
30
|
+
spec.add_dependency "google-apis-compute_v1", "~> 0.14"
|
31
|
+
spec.add_dependency "google-apis-monitoring_v3", "~> 0.12"
|
32
|
+
spec.add_dependency "google-apis-dns_v1", "~> 0.12"
|
33
|
+
spec.add_dependency "google-apis-pubsub_v1", "~> 0.7"
|
34
|
+
spec.add_dependency "google-apis-sqladmin_v1beta4", "~> 0.13"
|
35
|
+
|
29
36
|
spec.add_dependency "google-cloud-env", "~> 1.2"
|
30
37
|
|
31
38
|
# Debugger
|
32
|
-
|
39
|
+
# Locked because pry-byebug is broken with 13+
|
40
|
+
# see: https://github.com/deivid-rodriguez/pry-byebug/issues/343
|
41
|
+
spec.add_development_dependency "pry", "= 0.13.0"
|
33
42
|
|
34
43
|
# Testing gems
|
35
44
|
spec.add_development_dependency "retriable"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -50,6 +50,13 @@ module Fog
|
|
50
50
|
# @return [Array<Hash>]
|
51
51
|
attribute :disks
|
52
52
|
|
53
|
+
# @example Enable the display device
|
54
|
+
# {
|
55
|
+
# :enable_display => true
|
56
|
+
# }
|
57
|
+
# @return [Hash<String,Boolean>]
|
58
|
+
attribute :display_device, :aliases => "displayDevice"
|
59
|
+
|
53
60
|
# @example Guest accelerators
|
54
61
|
# [
|
55
62
|
# {
|
@@ -84,7 +84,10 @@ module Fog
|
|
84
84
|
server.wait_for { ready? }
|
85
85
|
|
86
86
|
# Set the disk to be autodeleted
|
87
|
-
|
87
|
+
# true - autodelete setting
|
88
|
+
# nil - device name (not needed if there's only one disk)
|
89
|
+
# false - set async to false so set the property synchronously
|
90
|
+
server.set_disk_auto_delete(true, nil, false)
|
88
91
|
|
89
92
|
server
|
90
93
|
end
|
File without changes
|
File without changes
|
@@ -10,18 +10,8 @@ module Fog
|
|
10
10
|
end
|
11
11
|
|
12
12
|
class Real
|
13
|
-
INSERTABLE_NETWORK_FIELDS = %i{
|
14
|
-
auto_create_subnetworks
|
15
|
-
description
|
16
|
-
gateway_i_pv4
|
17
|
-
i_pv4_range
|
18
|
-
name
|
19
|
-
routing_config
|
20
|
-
}.freeze
|
21
|
-
|
22
13
|
def insert_network(network_name, opts = {})
|
23
|
-
opts = opts.
|
24
|
-
.merge(:name => network_name)
|
14
|
+
opts = opts.merge(:name => network_name)
|
25
15
|
|
26
16
|
@compute.insert_network(
|
27
17
|
@project,
|
@@ -104,6 +104,10 @@ module Fog
|
|
104
104
|
data[:shielded_instance_config] = ::Google::Apis::ComputeV1::ShieldedInstanceConfig.new(**options[:shielded_instance_config])
|
105
105
|
end
|
106
106
|
|
107
|
+
if data[:display_device]
|
108
|
+
data[:display_device] = ::Google::Apis::ComputeV1::DisplayDevice.new(**options[:display_device])
|
109
|
+
end
|
110
|
+
|
107
111
|
if data[:tags]
|
108
112
|
if options[:tags].is_a?(Array)
|
109
113
|
# Process classic tag notation, i.e. ["fog"]
|
data/lib/fog/google/version.rb
CHANGED
@@ -45,7 +45,16 @@ module Fog
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def body
|
48
|
-
|
48
|
+
return attributes[:body] if attributes.key?(:body)
|
49
|
+
|
50
|
+
file = collection.get(identity)
|
51
|
+
|
52
|
+
attributes[:body] =
|
53
|
+
if file
|
54
|
+
file.attributes[:body]
|
55
|
+
else
|
56
|
+
""
|
57
|
+
end
|
49
58
|
end
|
50
59
|
|
51
60
|
def body=(new_body)
|
@@ -42,12 +42,12 @@ module Fog
|
|
42
42
|
|
43
43
|
def get_https_url(key, expires, options = {})
|
44
44
|
requires :directory
|
45
|
-
service.get_object_https_url(directory.key, key, expires, options)
|
45
|
+
service.get_object_https_url(directory.key, key, expires, **options)
|
46
46
|
end
|
47
47
|
|
48
48
|
def metadata(key, options = {})
|
49
49
|
requires :directory
|
50
|
-
data = service.get_object_metadata(directory.key, key, options).to_h
|
50
|
+
data = service.get_object_metadata(directory.key, key, **options).to_h
|
51
51
|
new(data)
|
52
52
|
rescue ::Google::Apis::ClientError
|
53
53
|
nil
|
@@ -156,12 +156,12 @@ DATA
|
|
156
156
|
# See https://cloud.google.com/storage/docs/access-control/signed-urls-v2
|
157
157
|
# @return [String] Signature binary blob
|
158
158
|
def iam_signer(string_to_sign)
|
159
|
-
request =
|
160
|
-
|
161
|
-
|
159
|
+
request = ::Google::Apis::IamcredentialsV1::SignBlobRequest.new(
|
160
|
+
payload: string_to_sign
|
161
|
+
)
|
162
162
|
|
163
163
|
resource = "projects/-/serviceAccounts/#{google_access_id}"
|
164
|
-
response = @iam_service.sign_service_account_blob
|
164
|
+
response = @iam_service.sign_service_account_blob(resource, request)
|
165
165
|
|
166
166
|
return response.signed_blob
|
167
167
|
end
|
@@ -6,14 +6,14 @@ module Fog
|
|
6
6
|
# Deprecated, redirects to get_object_https_url.rb
|
7
7
|
def get_object_url(bucket_name, object_name, expires, options = {})
|
8
8
|
Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})")
|
9
|
-
get_object_https_url(bucket_name, object_name, expires, options)
|
9
|
+
get_object_https_url(bucket_name, object_name, expires, **options)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
class Mock # :nodoc:all
|
14
14
|
def get_object_url(bucket_name, object_name, expires, options = {})
|
15
15
|
Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})")
|
16
|
-
get_object_https_url(bucket_name, object_name, expires, options)
|
16
|
+
get_object_https_url(bucket_name, object_name, expires, **options)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -22,8 +22,8 @@ TEST_IMAGE_PROJECT = "debian-cloud".freeze
|
|
22
22
|
TEST_IMAGE_FAMILY = "debian-9".freeze
|
23
23
|
|
24
24
|
# XXX This depends on a public image in gs://fog-test-bucket; there may be a better way to do this
|
25
|
-
# The image was created like so: https://cloud.google.com/compute/docs/images
|
26
|
-
TEST_RAW_DISK_SOURCE = "https://storage.googleapis.com/fog-
|
25
|
+
# The image was created like so: https://cloud.google.com/compute/docs/images/export-image
|
26
|
+
TEST_RAW_DISK_SOURCE = "https://storage.googleapis.com/fog-test-assets-bucket/fog-test-raw-disk-source.image.tar.gz".freeze
|
27
27
|
|
28
28
|
TEST_SQL_TIER = "db-n1-standard-1".freeze
|
29
29
|
TEST_SQL_REGION = TEST_REGION
|
data/test/helpers/test_helper.rb
CHANGED
@@ -17,8 +17,12 @@ end
|
|
17
17
|
# See https://github.com/seattlerb/minitest/#install
|
18
18
|
gem "minitest"
|
19
19
|
require "minitest/autorun"
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
|
21
|
+
# This is a workaround for RubyMine debugger that doesn't play nice with Minitest::Reporters
|
22
|
+
unless ENV['RM_INFO']
|
23
|
+
# Custom formatters to make the tests more legible in CI
|
24
|
+
require "minitest/reporters"
|
25
|
+
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
|
26
|
+
end
|
23
27
|
|
24
28
|
require File.join(File.dirname(__FILE__), "../../lib/fog/google")
|
@@ -135,8 +135,8 @@ class TestServers < FogIntegrationTest
|
|
135
135
|
def test_reset_windows_password
|
136
136
|
win_disk = @disks.create(
|
137
137
|
:name => "fog-test-1-testservers-test-reset-windows-password-2",
|
138
|
-
:source_image => "windows-server-
|
139
|
-
:size_gb =>
|
138
|
+
:source_image => "windows-server-2019-dc-v20210713",
|
139
|
+
:size_gb => 64
|
140
140
|
)
|
141
141
|
server = @factory.create(:disks => [win_disk])
|
142
142
|
server.wait_for { ready? }
|
@@ -17,17 +17,6 @@ class TestNetworks < FogIntegrationTest
|
|
17
17
|
super
|
18
18
|
end
|
19
19
|
|
20
|
-
def test_valid_range
|
21
|
-
network = @factory.create
|
22
|
-
|
23
|
-
octet = /\d{,2}|1\d{2}|2[0-4]\d|25[0-5]/
|
24
|
-
netmask = /(\d{1}|1[0-9]|2[0-9]|3[0-2])/
|
25
|
-
re = /\A#{octet}\.#{octet}\.#{octet}\.#{octet}\/#{netmask}\z/
|
26
|
-
|
27
|
-
assert_match(re, network.ipv4_range,
|
28
|
-
"Network range should be valid")
|
29
|
-
end
|
30
|
-
|
31
20
|
def test_run_instance
|
32
21
|
network = @factory.create
|
33
22
|
server = @servers.create(:network_interfaces => [network.get_as_interface_config])
|
@@ -2,15 +2,13 @@ require "integration/factories/collection_factory"
|
|
2
2
|
|
3
3
|
class NetworksFactory < CollectionFactory
|
4
4
|
def initialize(example)
|
5
|
-
# We cannot have 2 networks with the same IP range so instantiating a
|
6
|
-
# class variable holding a generator, ensuring that the factory gives
|
7
|
-
# us a new network every time it's called
|
8
|
-
@octet_generator = (0..255).each
|
9
5
|
super(Fog::Compute[:google].networks, example)
|
10
6
|
end
|
11
7
|
|
12
8
|
def params
|
13
|
-
{
|
14
|
-
:
|
9
|
+
{
|
10
|
+
:name => resource_name,
|
11
|
+
:auto_create_subnetworks => true
|
12
|
+
}
|
15
13
|
end
|
16
14
|
end
|