Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit fd7c580

Browse files
selzocSannidhi Jalukar
andcommitted
Return stack id in /v3/buildpacks call for CNBs
Previously, this returned the name of the stack custom resource. The more consistent identifier is the id of the stack itself. [#169924422] Co-authored-by: Chris Selzo <cselzo@pivotal.io> Co-authored-by: Sannidhi Jalukar <sjalukar@pivotal.io>
1 parent c250b3c commit fd7c580

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

app/fetchers/kpack_buildpack_list_fetcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def fetch_all(message)
1111
version_map = default_builder.status.builderMetadata.each.with_object({}) do |metadata, h|
1212
h[metadata.id] = metadata.version
1313
end
14-
stack = default_builder.spec.stack
14+
stack = default_builder.status.stack.id
1515
created_at = Time.parse(default_builder.metadata.creationTimestamp)
1616

1717
latest_condition = default_builder.status.conditions[0]

spec/unit/fetchers/kpack_buildpack_list_fetcher_spec.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ module VCAP::CloudController
4242
status: 'True',
4343
type: 'Ready',
4444
}
45-
]
45+
],
46+
stack: {
47+
id: 'org.cloudfoundry.stacks.cflinuxfs3'
48+
}
4649
}
4750
)
4851
}
@@ -69,7 +72,7 @@ module VCAP::CloudController
6972
expect(buildpack1.name).to(eq('paketo-community/ruby'))
7073
expect(buildpack1.id).to(eq('paketo-community/ruby@0.0.11'))
7174
expect(buildpack1.filename).to(eq('paketo-community/ruby@0.0.11'))
72-
expect(buildpack1.stack).to(eq(cflinuxfs3_stackname))
75+
expect(buildpack1.stack).to(eq('org.cloudfoundry.stacks.cflinuxfs3'))
7376
expect(buildpack1.guid).to(be_blank)
7477
expect(buildpack1.state).to(eq('READY'))
7578
expect(buildpack1.position).to(eq(0))
@@ -83,7 +86,7 @@ module VCAP::CloudController
8386
expect(buildpack2.name).to(eq('paketo-buildpacks/java'))
8487
expect(buildpack2.id).to(eq('paketo-buildpacks/java@1.14.0'))
8588
expect(buildpack2.filename).to(eq('paketo-buildpacks/java@1.14.0'))
86-
expect(buildpack2.stack).to(eq(cflinuxfs3_stackname))
89+
expect(buildpack2.stack).to(eq('org.cloudfoundry.stacks.cflinuxfs3'))
8790
expect(buildpack2.guid).to(be_blank)
8891
expect(buildpack2.state).to(eq('READY'))
8992
expect(buildpack2.position).to(eq(0))

0 commit comments

Comments
 (0)