Debian Codegraph @

buildkit/frontend/gateway/pb/caps.go

raw
1 package moby_buildkit_v1_frontend //nolint:revive,staticcheck
2
3 import "github.com/moby/buildkit/util/apicaps"
4
5 var Caps apicaps.CapList
6
7 // Every backwards or forwards non-compatible change needs to add a new capability row.
8 // By default new capabilities should be experimental. After merge a capability is
9 // considered immutable. After a capability is marked stable it should not be disabled.
10
11 const (
12 CapSolveBase apicaps.CapID = "solve.base"
13 CapSolveInlineReturn apicaps.CapID = "solve.inlinereturn"
14 CapResolveImage apicaps.CapID = "resolveimage"
15 CapResolveImageResolveMode apicaps.CapID = "resolveimage.resolvemode"
16 CapReadFile apicaps.CapID = "readfile"
17 CapReturnResult apicaps.CapID = "return"
18 CapReturnMap apicaps.CapID = "returnmap"
19 CapReadDir apicaps.CapID = "readdir"
20 CapStatFile apicaps.CapID = "statfile"
21 CapImportCaches apicaps.CapID = "importcaches"
22
23 // CapProtoRefArray is a capability to return arrays of refs instead of single
24 // refs. This capability is only for the wire format change and shouldn't be
25 // used in frontends for feature detection.
26 CapProtoRefArray apicaps.CapID = "proto.refarray"
27
28 // CapReferenceOutput is a capability to use a reference of a solved result as
29 // an llb.Output.
30 CapReferenceOutput apicaps.CapID = "reference.output"
31
32 // CapFrontendInputs is a capability to request frontend inputs from the
33 // LLBBridge GRPC server.
34 CapFrontendInputs apicaps.CapID = "frontend.inputs"
35
36 // CapGatewaySolveMetadata can be used to check if solve calls from gateway reliably return metadata
37 CapGatewaySolveMetadata apicaps.CapID = "gateway.solve.metadata"
38
39 // CapGatewayExec is the capability to create and interact with new
40 // containers directly through the gateway
41 CapGatewayExec apicaps.CapID = "gateway.exec"
42
43 // CapGatewayExecExtraHosts is the capability to add additional hosts to
44 // /etc/hosts for containers created via gateway exec.
45 CapGatewayExecExtraHosts apicaps.CapID = "gateway.exec.extrahosts"
46
47 // CapGatewayExecExtraHosts is the capability to set secrets as env vars for
48 // containers created via gateway exec.
49 CapGatewayExecSecretEnv apicaps.CapID = "gateway.exec.secretenv"
50
51 // CapGatewayExecExtraHosts is the capability to send signals to a process
52 // created via gateway exec.
53 CapGatewayExecSignals apicaps.CapID = "gateway.exec.signals"
54
55 // CapFrontendCaps can be used to check that frontends define support for certain capabilities
56 CapFrontendCaps apicaps.CapID = "frontend.caps"
57
58 // CapGatewayEvaluateSolve is a capability to immediately unlazy solve
59 // results. This is generally used by the client to return and handle solve
60 // errors.
61 CapGatewayEvaluateSolve apicaps.CapID = "gateway.solve.evaluate"
62
63 CapGatewayEvaluate apicaps.CapID = "gateway.evaluate"
64
65 // CapGatewayWarnings is the capability to log warnings from frontend
66 CapGatewayWarnings apicaps.CapID = "gateway.warnings"
67
68 // CapAttestations is the capability to indicate that attestation
69 // references will be attached to results
70 CapAttestations apicaps.CapID = "reference.attestations"
71
72 // CapSourceMetaResolver is the capability to indicates support for ResolveSourceMetadata
73 // function in gateway API
74 CapSourceMetaResolver apicaps.CapID = "source.metaresolver"
75 )
76
77 func init() {
78 Caps.Init(apicaps.Cap{
79 ID: CapSolveBase,
80 Enabled: true,
81 Status: apicaps.CapStatusExperimental,
82 })
83
84 Caps.Init(apicaps.Cap{
85 ID: CapSolveInlineReturn,
86 Name: "inline return from solve",
87 Enabled: true,
88 Deprecated: true,
89 Status: apicaps.CapStatusExperimental,
90 })
91
92 Caps.Init(apicaps.Cap{
93 ID: CapResolveImage,
94 Name: "resolve remote image config",
95 Enabled: true,
96 Status: apicaps.CapStatusExperimental,
97 })
98
99 Caps.Init(apicaps.Cap{
100 ID: CapResolveImageResolveMode,
101 Name: "resolve remote image config with custom resolvemode",
102 Enabled: true,
103 Status: apicaps.CapStatusExperimental,
104 })
105
106 Caps.Init(apicaps.Cap{
107 ID: CapReadFile,
108 Name: "read static file",
109 Enabled: true,
110 Status: apicaps.CapStatusExperimental,
111 })
112
113 Caps.Init(apicaps.Cap{
114 ID: CapReturnResult,
115 Name: "return solve result",
116 Enabled: true,
117 Status: apicaps.CapStatusExperimental,
118 })
119
120 Caps.Init(apicaps.Cap{
121 ID: CapReturnMap,
122 Name: "return reference map",
123 Enabled: true,
124 Status: apicaps.CapStatusExperimental,
125 })
126
127 Caps.Init(apicaps.Cap{
128 ID: CapReadDir,
129 Name: "read static directory",
130 Enabled: true,
131 Status: apicaps.CapStatusExperimental,
132 })
133
134 Caps.Init(apicaps.Cap{
135 ID: CapStatFile,
136 Name: "stat a file",
137 Enabled: true,
138 Status: apicaps.CapStatusExperimental,
139 })
140
141 Caps.Init(apicaps.Cap{
142 ID: CapImportCaches,
143 Name: "import caches",
144 Enabled: true,
145 Status: apicaps.CapStatusExperimental,
146 })
147
148 Caps.Init(apicaps.Cap{
149 ID: CapProtoRefArray,
150 Name: "wire format ref arrays",
151 Enabled: true,
152 Status: apicaps.CapStatusExperimental,
153 })
154
155 Caps.Init(apicaps.Cap{
156 ID: CapReferenceOutput,
157 Name: "reference output",
158 Enabled: true,
159 Status: apicaps.CapStatusExperimental,
160 })
161
162 Caps.Init(apicaps.Cap{
163 ID: CapFrontendInputs,
164 Name: "frontend inputs",
165 Enabled: true,
166 Status: apicaps.CapStatusExperimental,
167 })
168
169 Caps.Init(apicaps.Cap{
170 ID: CapGatewaySolveMetadata,
171 Name: "gateway metadata",
172 Enabled: true,
173 Status: apicaps.CapStatusExperimental,
174 })
175
176 Caps.Init(apicaps.Cap{
177 ID: CapGatewayExec,
178 Name: "gateway exec",
179 Enabled: true,
180 Status: apicaps.CapStatusExperimental,
181 })
182
183 Caps.Init(apicaps.Cap{
184 ID: CapGatewayExecExtraHosts,
185 Name: "gateway exec extra-hosts",
186 Enabled: true,
187 Status: apicaps.CapStatusExperimental,
188 })
189
190 Caps.Init(apicaps.Cap{
191 ID: CapGatewayExecSecretEnv,
192 Name: "gateway exec secret env",
193 Enabled: true,
194 Status: apicaps.CapStatusExperimental,
195 })
196
197 Caps.Init(apicaps.Cap{
198 ID: CapGatewayExecSignals,
199 Name: "gateway exec signals",
200 Enabled: true,
201 Status: apicaps.CapStatusExperimental,
202 })
203
204 Caps.Init(apicaps.Cap{
205 ID: CapFrontendCaps,
206 Name: "frontend capabilities",
207 Enabled: true,
208 Status: apicaps.CapStatusExperimental,
209 })
210
211 Caps.Init(apicaps.Cap{
212 ID: CapGatewayEvaluateSolve,
213 Name: "gateway evaluate solve",
214 Enabled: true,
215 Status: apicaps.CapStatusExperimental,
216 })
217
218 Caps.Init(apicaps.Cap{
219 ID: CapGatewayEvaluate,
220 Name: "gateway evaluate",
221 Enabled: true,
222 Status: apicaps.CapStatusExperimental,
223 })
224
225 Caps.Init(apicaps.Cap{
226 ID: CapGatewayWarnings,
227 Name: "logging warnings",
228 Enabled: true,
229 Status: apicaps.CapStatusExperimental,
230 })
231
232 Caps.Init(apicaps.Cap{
233 ID: CapAttestations,
234 Name: "reference attestations",
235 Enabled: true,
236 Status: apicaps.CapStatusExperimental,
237 })
238
239 Caps.Init(apicaps.Cap{
240 ID: CapSourceMetaResolver,
241 Name: "source meta resolver",
242 Enabled: true,
243 Status: apicaps.CapStatusExperimental,
244 })
245 }