/
buildpack_metadata.go
95 lines (76 loc) · 2.59 KB
/
buildpack_metadata.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package cnb
import (
corev1alpha1 "github.com/pivotal/kpack/pkg/apis/core/v1alpha1"
)
const (
buildpackOrderLabel = "io.buildpacks.buildpack.order"
buildpackLayersLabel = "io.buildpacks.buildpack.layers"
buildpackMetadataLabel = "io.buildpacks.builder.metadata"
lifecycleVersionLabel = "io.buildpacks.lifecycle.version"
lifecycleApisLabel = "io.buildpacks.lifecycle.apis"
)
type BuildpackLayerInfo struct {
API string `json:"api"`
LayerDiffID string `json:"layerDiffID"`
Order corev1alpha1.Order `json:"order,omitempty"`
Stacks []corev1alpha1.BuildpackStack `json:"stacks,omitempty"`
Homepage string `json:"homepage,omitempty"`
}
type DescriptiveBuildpackInfo struct {
corev1alpha1.BuildpackInfo
Homepage string `json:"homepage,omitempty"`
}
type Stack struct {
ID string `json:"id"`
Mixins []string `json:"mixins,omitempty"`
}
type BuilderImageMetadata struct {
Description string `json:"description"`
Stack StackMetadata `json:"stack"`
Lifecycle LifecycleMetadata `json:"lifecycle"`
CreatedBy CreatorMetadata `json:"createdBy"`
Buildpacks []DescriptiveBuildpackInfo `json:"buildpacks"`
}
type StackMetadata struct {
RunImage RunImageMetadata `json:"runImage" toml:"run-image"`
}
type RunImageMetadata struct {
Image string `json:"image" toml:"image"`
Mirrors []string `json:"mirrors" toml:"mirrors"`
}
type CreatorMetadata struct {
Name string `json:"name"`
Version string `json:"version"`
}
type LifecycleMetadata struct {
LifecycleInfo
// Deprecated: Use `LifecycleAPIs` instead
API LifecycleAPI `json:"api,omitempty"`
APIs LifecycleAPIs `json:"apis,omitempty"`
}
type LifecycleDescriptor struct {
Info LifecycleInfo `toml:"lifecycle"`
// Deprecated: Use `LifecycleAPIs` instead
API LifecycleAPI `toml:"api" json:"api,omitempty"`
APIs LifecycleAPIs `toml:"apis" json:"apis,omitempty"`
}
type LifecycleInfo struct {
Version string `toml:"version" json:"version"`
}
type LifecycleAPI struct {
BuildpackVersion string `toml:"buildpack" json:"buildpack,omitempty"`
PlatformVersion string `toml:"platform" json:"platform,omitempty"`
}
type LifecycleAPIs struct {
Buildpack APIVersions `toml:"buildpack" json:"buildpack"`
Platform APIVersions `toml:"platform" json:"platform"`
}
type APIVersions struct {
Deprecated APISet `toml:"deprecated" json:"deprecated"`
Supported APISet `toml:"supported" json:"supported"`
}
type APISet []string
type builtImageStack struct {
RunImage string
ID string
}