Skip to content

Commit 7f485b6

Browse files
authored
Remove RegistryBitsPacker (#3990)
Config options 'packages.image_registry' and 'registry_buddy' are not set in capi-release, thus all related artifacts can be removed from Cloud Controller.
1 parent c2a9156 commit 7f485b6

File tree

20 files changed

+24
-728
lines changed

20 files changed

+24
-728
lines changed

app/actions/package_delete.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@ def delete(packages)
2424
private
2525

2626
def create_package_source_deletion_job(package)
27-
return Jobs::Runtime::BlobstoreDelete.new(package.guid, :package_blobstore) unless package_registry_configured?
28-
29-
nil
30-
end
31-
32-
def package_registry_configured?
33-
VCAP::CloudController::Config.config.package_image_registry_configured?
27+
Jobs::Runtime::BlobstoreDelete.new(package.guid, :package_blobstore)
3428
end
3529
end
3630
end

app/controllers/v3/packages_controller.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def download
9393

9494
unprocessable!('Package type must be bits.') unless package.type == 'bits'
9595
unprocessable!('Package has no bits to download.') unless package.state == 'READY'
96-
unprocessable!('Unable to download packages when an image registry is used to store packages') if VCAP::CloudController::Config.config.package_image_registry_configured?
9796

9897
VCAP::CloudController::Repositories::PackageEventRepository.record_app_package_download(
9998
package,
@@ -170,8 +169,6 @@ def create_fresh
170169
end
171170

172171
def create_copy
173-
unprocessable!('Unable to copy package when an image registry is used to store packages') if VCAP::CloudController::Config.config.package_image_registry_configured?
174-
175172
app_guid = Oj.load(request.body).deep_symbolize_keys.dig(:relationships, :app, :data, :guid)
176173
destination_app = AppModel.where(guid: app_guid).first
177174

app/jobs/runtime/delete_expired_package_blob.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,8 @@ def logger
3434

3535
private
3636

37-
def package_registry_configured?
38-
VCAP::CloudController::Config.config.package_image_registry_configured?
39-
end
40-
4137
def create_package_source_deletion_job(package)
42-
return Jobs::Runtime::BlobstoreDelete.new(package.guid, :package_blobstore) unless package_registry_configured?
43-
44-
nil
38+
Jobs::Runtime::BlobstoreDelete.new(package.guid, :package_blobstore)
4539
end
4640
end
4741
end

app/models/runtime/package_model.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,6 @@ def image
4040
docker_image
4141
end
4242

43-
def bits_image_reference(digest: false)
44-
config = VCAP::CloudController::Config.config
45-
raise 'Package Registry is not configured' unless config.package_image_registry_configured?
46-
raise 'Package type must be bits' unless bits?
47-
48-
package_registry_base_path = config.get(:packages, :image_registry, :base_path)
49-
50-
reference = "#{package_registry_base_path}/#{guid}"
51-
reference += "@sha256:#{sha256_checksum}" if digest
52-
53-
reference
54-
end
55-
5643
def bits?
5744
type == BITS_TYPE
5845
end

config/cloud_controller.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,6 @@ buildpacks:
204204
fog_aws_storage_options: {}
205205
fog_gcp_storage_options: {}
206206

207-
registry_buddy:
208-
host: "127.0.0.1"
209-
port: 8080
210-
211207
db_encryption_key: "asdfasdfasdf"
212208
database_encryption:
213209
keys: {"encryption_key_0":"asdfasdfasdf"}

lib/cloud_controller/config.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@ def valid_config_path?(keys, some_schema)
147147
end
148148
end
149149

150-
def package_image_registry_configured?
151-
!get(:packages, :image_registry).nil?
152-
end
153-
154150
private
155151

156152
def invalid_config_path!(keys)

lib/cloud_controller/config_schemas/base/api_schema.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,7 @@ class ApiSchema < VCAP::Config
174174
app_package_directory_key: String,
175175
fog_connection: Hash,
176176
fog_aws_storage_options: Hash,
177-
fog_gcp_storage_options: Hash,
178-
optional(:image_registry) => {
179-
base_path: String
180-
}
177+
fog_gcp_storage_options: Hash
181178
},
182179

183180
droplets: {
@@ -188,11 +185,6 @@ class ApiSchema < VCAP::Config
188185
fog_gcp_storage_options: Hash
189186
},
190187

191-
optional(:registry_buddy) => {
192-
host: String,
193-
port: Integer
194-
},
195-
196188
db_encryption_key: enum(String, NilClass),
197189

198190
optional(:database_encryption) => {

lib/cloud_controller/config_schemas/base/clock_schema.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ class ClockSchema < VCAP::Config
9999
app_package_directory_key: String,
100100
fog_connection: Hash,
101101
fog_aws_storage_options: Hash,
102-
fog_gcp_storage_options: Hash,
103-
optional(:image_registry) => {
104-
base_path: String
105-
}
102+
fog_gcp_storage_options: Hash
106103
},
107104

108105
droplets: {

lib/cloud_controller/config_schemas/base/deployment_updater_schema.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,7 @@ class DeploymentUpdaterSchema < VCAP::Config
9898
app_package_directory_key: String,
9999
fog_connection: Hash,
100100
fog_aws_storage_options: Hash,
101-
fog_gcp_storage_options: Hash,
102-
optional(:image_registry) => {
103-
base_path: String
104-
}
101+
fog_gcp_storage_options: Hash
105102
},
106103

107104
droplets: {

lib/cloud_controller/config_schemas/base/worker_schema.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ class WorkerSchema < VCAP::Config
8484
app_package_directory_key: String,
8585
fog_connection: Hash,
8686
fog_aws_storage_options: Hash,
87-
fog_gcp_storage_options: Hash,
88-
optional(:image_registry) => {
89-
base_path: String
90-
}
87+
fog_gcp_storage_options: Hash
9188
},
9289

9390
droplets: {
@@ -97,11 +94,6 @@ class WorkerSchema < VCAP::Config
9794
fog_gcp_storage_options: Hash
9895
},
9996

100-
optional(:registry_buddy) => {
101-
host: String,
102-
port: Integer
103-
},
104-
10597
db_encryption_key: enum(String, NilClass),
10698

10799
optional(:database_encryption) => {

0 commit comments

Comments
 (0)