Skip to content

Commit

Permalink
Merge pull request #27 from cloudfoundry/no-blobstore
Browse files Browse the repository at this point in the history
Remove blobstore info from IaaS metadata endpoints
  • Loading branch information
rkoster authored May 25, 2023
2 parents ed9d4eb + 031384e commit bff95ae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 117 deletions.
69 changes: 0 additions & 69 deletions jobs/virtualbox_cpi/spec
Original file line number Diff line number Diff line change
Expand Up @@ -40,75 +40,6 @@ properties:
- 0.pool.ntp.org
- 1.pool.ntp.org

agent.blobstore.credentials_source:
description: Where to get AWS credentials for the virtualbox cpi. This can be set to `static` for to use an `access_key_id` and `secret_access_key` or `env_or_profile` to get the credentials from environment variables or an EC2 instance profile.
agent.blobstore.access_key_id:
description: AWS access_key_id for agent used by s3 blobstore plugin (Required when blobstore.credentials_source is set to `static`)
agent.blobstore.secret_access_key:
description: AWS secret_access_key for agent used by s3 blobstore plugin (Required when blobstore.credentials_source is set to `static`)
agent.blobstore.s3_region:
description: AWS region for agent used by s3 blobstore plugin (Required when blobstore.credentials_source is set to `static`)
agent.blobstore.address:
description: Address for agent to connect to blobstore server used by dav blobstore plugin
agent.blobstore.use_ssl:
description: Whether the s3 blobstore plugin should use SSL to connect to the blobstore server
agent.blobstore.s3_port:
description: Port of agent blobstore server used by s3 blobstore plugin
agent.blobstore.host:
description: Host of agent blobstore server used by s3 blobstore plugin
agent.blobstore.s3_force_path_style:
description: Whether the agent blobstore plugin will always use path style for bucket access
agent.blobstore.ssl_verify_peer:
description: Whether the agent blobstore plugin should verify its peer when using SSL
agent.blobstore.s3_multipart_threshold:
description: Agent blobstore threshold for multipart uploads
agent.blobstore.s3_signature_version:
description: Signature version used to connect to an s3 blobstore
blobstore.provider:
description: Provider of the blobstore used by director and agent (dav|local|s3)
default: 'dav'
blobstore.bucket_name:
description: AWS S3 Bucket used by s3 blobstore plugin
blobstore.credentials_source:
description: Where to get AWS credentials for the virtualbox cpi. This can be set to `static` for to use an `access_key_id` and `secret_access_key` or `env_or_profile` to get the credentials from environment variables or an EC2 instance profile.
default: 'static'
blobstore.access_key_id:
description: AWS access_key_id used by s3 blobstore plugin (Required when blobstore.credentials_source is set to `static`)
default: null
blobstore.secret_access_key:
description: AWS secret_access_key used by s3 blobstore plugin (Required when blobstore.credentials_source is set to `static`)
default: null
blobstore.s3_region:
description: AWS region used by s3 blobstore plugin (Required when blobstore.credentials_source is set to `static`)
blobstore.use_ssl:
description: Whether the s3 blobstore plugin should use SSL to connect to the blobstore server
default: true
blobstore.s3_port:
description: Port of blobstore server used by s3 blobstore plugin
default: 443
blobstore.host:
description: Host of blobstore server used by s3 blobstore plugin
blobstore.s3_force_path_style:
description: Whether the blobstore plugin will always use path style for bucket access
default: false
blobstore.ssl_verify_peer:
description: Whether the s3 blobstore plugin should verify its peer when using SSL
blobstore.s3_multipart_threshold:
description: S3 blobstore threshold for multipart uploads
blobstore.s3_signature_version:
description: Signature version used to connect to an s3 blobstore
blobstore.path:
description: local blobstore path
blobstore.address:
description: Address of blobstore server used by dav blobstore plugin
blobstore.port:
description: Port of blobstore server used by dav blobstore plugin
default: 25250
blobstore.agent.user:
description: Username agent uses to connect to blobstore used by dav blobstore plugin (Optional)
blobstore.agent.password:
description: Password agent uses to connect to blobstore used by dav blobstore plugin (Required only when user is provided

agent.mbus:
description: Agent mbus
nats.user:
Expand Down
48 changes: 0 additions & 48 deletions jobs/virtualbox_cpi/templates/cpi.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,54 +18,6 @@ params = {

agent_params = params["Agent"]

blobstore_defined = p('blobstore.provider') != 'dav' || !p(['blobstore.agent.user', 'agent.blobstore.address', 'blobstore.address'], nil).nil?

if blobstore_defined
agent_params["blobstore"] = {
"provider" => p("blobstore.provider"),
"options" => {}
}

blobstore = agent_params["blobstore"]

if p("blobstore.provider") == "s3"
blobstore["options"] = {
"bucket_name" => p("blobstore.bucket_name"),
"credentials_source" => p(["agent.blobstore.credentials_source", "blobstore.credentials_source"]),
"access_key_id" => p(["agent.blobstore.access_key_id", "blobstore.access_key_id"], nil),
"secret_access_key" => p(["agent.blobstore.secret_access_key", "blobstore.secret_access_key"], nil),
}

def update_blobstore_options(blobstore, manifest_key, rendered_key=manifest_key)
value = p(["agent.blobstore.#{manifest_key}", "blobstore.#{manifest_key}"], nil)
blobstore["options"][rendered_key] = value unless value.nil?
end

update_blobstore_options(blobstore, "use_ssl")
update_blobstore_options(blobstore, "s3_port", "port")
update_blobstore_options(blobstore, "host")
update_blobstore_options(blobstore, "s3_force_path_style")
update_blobstore_options(blobstore, "ssl_verify_peer")
update_blobstore_options(blobstore, "s3_multipart_threshold")
update_blobstore_options(blobstore, "s3_signature_version", "signature_version")
update_blobstore_options(blobstore, "s3_region", "region")

elsif p("blobstore.provider") == "local"
blobstore["options"] = {
"blobstore_path" => p("blobstore.path")
}
else
blobstore["options"] = {
"endpoint" => "http://#{p(['agent.blobstore.address', 'blobstore.address'])}:#{p('blobstore.port')}"
}

if_p('blobstore.agent.user') do
blobstore["options"]["user"] = p('blobstore.agent.user')
blobstore["options"]["password"] = p('blobstore.agent.password')
end
end
end

if_p("agent.mbus") do |mbus|
agent_params["mbus"] = mbus
end.else_if_p("nats") do
Expand Down

0 comments on commit bff95ae

Please sign in to comment.