Repository navigation
Expand file tree
/
Copy pathexecutable_types.go
More file actions
645 lines (505 loc) · 21.3 KB
/
Copy pathexecutable_types.go
File metadata and controls
645 lines (505 loc) · 21.3 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
package v1
import (
"context"
"fmt"
stdmaps "maps"
stdslices "slices"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/validation/field"
generic_registry "k8s.io/apiserver/pkg/registry/generic"
registry_rest "k8s.io/apiserver/pkg/registry/rest"
apiserver "github.com/tilt-dev/tilt-apiserver/pkg/server/apiserver"
apiserver_resource "github.com/tilt-dev/tilt-apiserver/pkg/server/builder/resource"
apiserver_resourcerest "github.com/tilt-dev/tilt-apiserver/pkg/server/builder/resource/resourcerest"
apiserver_resourcestrategy "github.com/tilt-dev/tilt-apiserver/pkg/server/builder/resource/resourcestrategy"
"github.com/microsoft/dcp/pkg/commonapi"
"github.com/microsoft/dcp/pkg/slices"
)
type ExecutableState string
const (
// Same as ExecutableStateStarting. May be encountered if the Executable status has not been initialized yet.
ExecutableStateEmpty ExecutableState = ""
// The Executable has been scheduled to launch, but we will need to re-evaluate its state in a subsequent
// reconciliation loop.
ExecutableStateStarting ExecutableState = "Starting"
// The Executable was successfully started and was running last time we checked.
ExecutableStateRunning ExecutableState = "Running"
// Executable is stopping (DCP is trying to stop the process)
ExecutableStateStopping ExecutableState = "Stopping"
// Terminated means the Executable was terminated by its owner (e.g. because ExecutableReplicaSet is scaling down).
ExecutableStateTerminated ExecutableState = "Terminated"
// Failed to start means the Executable could not be started
ExecutableStateFailedToStart ExecutableState = "FailedToStart"
// Finished means the Executable ran to completion.
ExecutableStateFinished ExecutableState = "Finished"
// Unknown means we are not tracking the actual-state counterpart of the Executable (process or IDE run session).
// As a result, we do not know whether it already finished, and what is the exit code, if any.
// This can happen if a controller launches a process and then terminates.
// When a new controller instance comes online, it may see non-zero ExecutionID Status,
// but it does not track the corresponding process or IDE session.
ExecutableStateUnknown ExecutableState = "Unknown"
)
func (es ExecutableState) CanUpdateTo(newState ExecutableState) bool {
// We live in imperfect world, and losing track of Executable state is always a possibility.
if newState == ExecutableStateUnknown {
return true
}
switch {
case es == ExecutableStateEmpty:
return newState == ExecutableStateStarting ||
newState == ExecutableStateRunning ||
newState == ExecutableStateTerminated ||
newState == ExecutableStateFailedToStart
case es == ExecutableStateStarting:
return newState == ExecutableStateRunning ||
newState == ExecutableStateFailedToStart ||
newState == ExecutableStateFinished
case es == ExecutableStateRunning:
return newState == ExecutableStateStopping ||
newState == ExecutableStateTerminated ||
newState == ExecutableStateFinished
case es == ExecutableStateStopping:
return newState == ExecutableStateTerminated ||
newState == ExecutableStateFinished
case es.IsTerminal():
return false
default:
return false
}
}
func (es ExecutableState) IsTerminal() bool {
return es == ExecutableStateTerminated || es == ExecutableStateFailedToStart || es == ExecutableStateFinished || es == ExecutableStateUnknown
}
// A valid exit code of a process is a non-negative number. We use UnknownExitCode to indicate that we have not obtained the exit code yet.
var UnknownExitCode *int32 = nil
// Unknown PID code is used when replica is not started (or fails to start)
var UnknownPID *int64 = nil
type ExecutionType string
const (
// Executable will be run directly by the controller, as a child process.
ExecutionTypeProcess ExecutionType = "Process"
// Executable will be run via an IDE such as VS or VS Code.
ExecutionTypeIDE ExecutionType = "IDE"
)
func (et ExecutionType) IsValid() bool {
return et == ExecutionTypeProcess || et == ExecutionTypeIDE
}
func (et ExecutionType) IsValidOrDefault() bool {
return et == "" || et.IsValid()
}
type EnvironmentBehavior string
const (
// The executable will inherit the environment of the controller process.
// This is the default behavior.
EnvironmentBehaviorInherit EnvironmentBehavior = "Inherit"
// The executable will not inherit the environment of the controller process.
EnvironmentBehaviorDoNotInherit EnvironmentBehavior = "DoNotInherit"
)
// +k8s:openapi-gen=true
type AmbientEnvironment struct {
// How environment variables should be inherited from the controller process.
// +kubebuilder:default:=Inherit
Behavior EnvironmentBehavior `json:"behavior,omitempty"`
}
// +k8s:openapi-gen=true
type ExecutableTemplate struct {
// Labels to apply to child Executable objects
Labels map[string]string `json:"labels,omitempty"`
// Annotations to apply to child Executable objects
Annotations map[string]string `json:"annotations,omitempty"`
// Spec for child Executables
Spec ExecutableSpec `json:"spec"`
}
func (et ExecutableTemplate) Equal(other ExecutableTemplate) bool {
if !stdmaps.Equal(et.Labels, other.Labels) {
return false
}
if !stdmaps.Equal(et.Annotations, other.Annotations) {
return false
}
return et.Spec.Equal(other.Spec)
}
// Represents a collection of PEM formatted certificates to be written for the executable
// +k8s:openapi-gen=true
type ExecutablePemCertificates struct {
// The individual certificates in PEM format.
// +listType=atomic
Certificates []PemCertificate `json:"certificates,omitempty"`
// If true, any invalid certificates in the Certificates list will be skipped, but any valid certificates will still be written.
// If false, the entire operation will fail if any invalid certificates are found.
ContinueOnError bool `json:"continueOnError,omitempty"`
}
func (pc *ExecutablePemCertificates) Equal(other *ExecutablePemCertificates) bool {
if pc == other {
return true
}
if pc == nil || other == nil {
return false
}
if !stdslices.EqualFunc(pc.Certificates, other.Certificates, func(c1, c2 PemCertificate) bool {
return c1.Equal(&c2)
}) {
return false
}
if pc.ContinueOnError != other.ContinueOnError {
return false
}
return true
}
func (pc *ExecutablePemCertificates) Validate(fieldPath *field.Path) field.ErrorList {
if pc == nil {
return nil
}
var errorList field.ErrorList
if len(pc.Certificates) == 0 {
errorList = append(errorList, field.Required(fieldPath.Child("certificates"), "at least one certificate must be specified"))
}
for i, cert := range pc.Certificates {
errorList = append(errorList, cert.Validate(fieldPath.Child("certificates").Index(i))...)
}
return errorList
}
// ExecutableSpec defines the desired state of an Executable
// +k8s:openapi-gen=true
type ExecutableSpec struct {
// Path to Executable binary
ExecutablePath string `json:"executablePath"`
// The working directory for the Executable
WorkingDirectory string `json:"workingDirectory,omitempty"`
// Launch arguments to be passed to the Executable
// +listType=atomic
Args []string `json:"args,omitempty"`
// Environment variables to be set for the Executable
// +listType=map
// +listMapKey=name
Env []EnvVar `json:"env,omitempty"`
// Environment files to use to populate Executable environment during startup.
// +listType=set
EnvFiles []string `json:"envFiles,omitempty"`
// The execution type for the Executable.
// +kubebuilder:default:=Process
ExecutionType ExecutionType `json:"executionType,omitempty"`
// Fallback execution types in case the primary execution type is not supported or startup fails.
// +listType=atomic
FallbackExecutionTypes []ExecutionType `json:"fallbackExecutionTypes,omitempty"`
// Controls behavior of environment variables inherited from the controller process.
AmbientEnvironment AmbientEnvironment `json:"ambientEnvironment,omitempty"`
// Should the controller attempt to stop the Executable
// +kubebuilder:default:=false
Stop bool `json:"stop,omitempty"`
// Health probe configuration for the Executable
// +listType=atomic
HealthProbes []HealthProbe `json:"healthProbes,omitempty"`
// PEM formatted certificates to be written for the Executable
// +optional
PemCertificates *ExecutablePemCertificates `json:"pemCertificates,omitempty"`
// Terminal, when non-nil and Enabled, allocates a pseudo-terminal for the
// Executable's process and exposes an HMP v1 producer endpoint that the
// Aspire terminal host connects to as a client. See TerminalSpec for
// details.
// +optional
Terminal *TerminalSpec `json:"terminal,omitempty"`
}
func (es ExecutableSpec) Equal(other ExecutableSpec) bool {
if es.ExecutablePath != other.ExecutablePath {
return false
}
if es.WorkingDirectory != other.WorkingDirectory {
return false
}
if !stdslices.Equal(es.Args, other.Args) {
return false
}
if !stdslices.Equal(es.Env, other.Env) {
return false
}
if !stdslices.Equal(es.EnvFiles, other.EnvFiles) {
return false
}
if es.ExecutionType != other.ExecutionType {
return false
}
if !stdslices.Equal(es.FallbackExecutionTypes, other.FallbackExecutionTypes) {
return false
}
if es.AmbientEnvironment != other.AmbientEnvironment {
return false
}
if es.Stop != other.Stop {
return false
}
if len(es.HealthProbes) != len(other.HealthProbes) {
return false
}
for i, probe := range es.HealthProbes {
if !probe.Equal(&other.HealthProbes[i]) {
return false
}
}
if !es.PemCertificates.Equal(other.PemCertificates) {
return false
}
if !es.Terminal.Equal(other.Terminal) {
return false
}
return true
}
func (es ExecutableSpec) Validate(specPath *field.Path) field.ErrorList {
errorList := field.ErrorList{}
if es.ExecutablePath == "" {
errorList = append(errorList, field.Invalid(specPath.Child("executablePath"), es.ExecutablePath, "Executable path is required."))
}
if !es.ExecutionType.IsValidOrDefault() {
errorList = append(errorList, field.Invalid(specPath.Child("executionType"), es.ExecutionType, "Execution type must be either Process or IDE."))
}
if len(es.FallbackExecutionTypes) > 0 {
// Must be unique and different from the primary execution type
if !stdslices.Equal(slices.Unique(es.FallbackExecutionTypes), es.FallbackExecutionTypes) {
errorList = append(errorList, field.Invalid(specPath.Child("fallbackExecutionTypes"), es.FallbackExecutionTypes, "Fallback execution types must be unique."))
}
if slices.Contains(es.FallbackExecutionTypes, es.ExecutionType) {
errorList = append(errorList, field.Invalid(specPath.Child("fallbackExecutionTypes"), es.FallbackExecutionTypes, "Fallback execution types cannot contain the primary execution type."))
}
if !slices.All(es.FallbackExecutionTypes, ExecutionType.IsValid) {
errorList = append(errorList, field.Invalid(specPath.Child("fallbackExecutionTypes"), es.FallbackExecutionTypes, "At least one of the fallback execution types is invalid."))
}
}
invalidAmbientEnvironmentBehavior := es.AmbientEnvironment.Behavior != "" &&
es.AmbientEnvironment.Behavior != EnvironmentBehaviorInherit &&
es.AmbientEnvironment.Behavior != EnvironmentBehaviorDoNotInherit
if invalidAmbientEnvironmentBehavior {
errorList = append(errorList, field.Invalid(specPath.Child("ambientEnvironment", "behavior"), es.AmbientEnvironment.Behavior, "Ambient environment behavior must be either Inherit or DoNotInherit."))
}
healthProbesPath := specPath.Child("healthProbes")
for i, probe := range es.HealthProbes {
errorList = append(errorList, probe.Validate(healthProbesPath.Index(i))...)
}
errorList = append(errorList, es.PemCertificates.Validate(specPath.Child("pemCertificates"))...)
errorList = append(errorList, es.Terminal.Validate(specPath.Child("terminal"))...)
return errorList
}
// ExecutableStatus describes the status of an Executable.
// +k8s:openapi-gen=true
type ExecutableStatus struct {
// The execution ID is the identifier for the actual-state counterpart of the Executable.
// For ExecutionType == Process it is the process ID. Process IDs will be eventually reused by OS,
// but a combination of process ID and startup timestamp is unique for each Executable instance.
// For ExecutionType == IDE it is the IDE session ID.
// +optional
ExecutionID string `json:"executionID"`
// The PID of the process associated with the Executable
// For either ExecutionType == Process or ExecutionType == IDE, this is the PID of the process that runs the Executable.
// +optional
PID *int64 `json:"pid,omitempty"`
// The current state of the process/IDE session started for this executable
State ExecutableState `json:"state"`
// Start (attempt) timestamp.
StartupTimestamp metav1.MicroTime `json:"startupTimestamp,omitempty"`
// The time when the process/IDE session finished execution
FinishTimestamp metav1.MicroTime `json:"finishTimestamp,omitempty"`
// Exit code of the process associated with the Executable.
// The value is equal to UnknownExitCode if the Executable was not started, is still running, or the exit code is not available.
// +optional
ExitCode *int32 `json:"exitCode,omitempty"`
// The path of a temporary file that contains captured standard output data from the Executable process.
StdOutFile string `json:"stdOutFile,omitempty"`
// The path of a temporary file that contains captured standard error data from the Executable process.
StdErrFile string `json:"stdErrFile,omitempty"`
// Effective values of environment variables, after all substitutions are applied.
// +listType=map
// +listMapKey=name
EffectiveEnv []EnvVar `json:"effectiveEnv,omitempty"`
// Effective values of launch arguments to be passed to the Executable, after all substitutions are applied.
// +listType=atomic
EffectiveArgs []string `json:"effectiveArgs,omitempty"`
// Health status of the Executable
HealthStatus HealthStatus `json:"healthStatus,omitempty"`
// Results of running health probes (most reacent per probe)
// +listType=map
// +listMapKey=probeName
HealthProbeResults []HealthProbeResult `json:"healthProbeResults,omitempty"`
}
func (es ExecutableStatus) CopyTo(dest apiserver_resource.ObjectWithStatusSubResource) {
es.DeepCopyInto(&dest.(*Executable).Status)
}
// Executable resource represents an OS process, with one or more replicas
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +k8s:openapi-gen=true
// +kubebuilder:resource:scope=Cluster
type Executable struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ExecutableSpec `json:"spec,omitempty"`
Status ExecutableStatus `json:"status,omitempty"`
}
// HasStdOut implements StdOutStreamableResource.
func (ce *Executable) HasStdOut() bool {
return true
}
// HasStdErr implements StdOutStreamableResource.
func (ce *Executable) HasStdErr() bool {
return true
}
// StdOutFile implements StdOutStreamableResource.
func (e *Executable) GetStdOutFile() string {
return e.Status.StdOutFile
}
// StdErrFile implements StdOutStreamableResource.
func (e *Executable) GetStdErrFile() string {
return e.Status.StdErrFile
}
// GetResourceId implements StdOutStreamableResource.
func (e *Executable) GetResourceId() string {
return fmt.Sprintf("executable-%s", e.UID)
}
func (e *Executable) GetGroupVersionResource() schema.GroupVersionResource {
return schema.GroupVersionResource{
Group: GroupVersion.Group,
Version: GroupVersion.Version,
Resource: "executables",
}
}
func (e *Executable) GetObjectMeta() *metav1.ObjectMeta {
return &e.ObjectMeta
}
func (e *Executable) GetStatus() apiserver_resource.StatusSubResource {
return e.Status
}
func (e *Executable) New() runtime.Object {
return &Executable{}
}
func (e *Executable) NewList() runtime.Object {
return &ExecutableList{}
}
func (e *Executable) IsStorageVersion() bool {
return true
}
func (e *Executable) NamespaceScoped() bool {
return false
}
func (e *Executable) ShortNames() []string {
return []string{"exe"}
}
func (e *Executable) NamespacedName() types.NamespacedName {
return types.NamespacedName{
Name: e.Name,
Namespace: e.Namespace,
}
}
func (e *Executable) Validate(ctx context.Context) field.ErrorList {
errorList := field.ErrorList{}
if ResourceCreationProhibited.Load() && e.DeletionTimestamp.IsZero() {
errorList = append(errorList, field.Forbidden(nil, errResourceCreationProhibited.Error()))
}
errorList = append(errorList, e.Spec.Validate(field.NewPath("spec"))...)
// Validate that annotations don't exceed the Kubernetes size limit.
// This provides a clearer error message than the generic Kubernetes API server error,
// especially when long arguments or environment variables are stored in annotations.
errorList = append(errorList, ValidateAnnotationsSize(e.Annotations, field.NewPath("metadata", "annotations"))...)
return errorList
}
func (e *Executable) ValidateUpdate(ctx context.Context, obj runtime.Object) field.ErrorList {
errorList := field.ErrorList{}
oldExe := obj.(*Executable)
if oldExe.Spec.Stop && e.Spec.Stop != oldExe.Spec.Stop {
errorList = append(errorList, field.Forbidden(field.NewPath("spec", "stop"), "Cannot unset stop property once it is set."))
}
if oldExe.Spec.AmbientEnvironment.Behavior != e.Spec.AmbientEnvironment.Behavior {
errorList = append(errorList, field.Forbidden(field.NewPath("spec", "ambientEnvironment", "behavior"), "Cannot change ambient environment behavior once it is set."))
}
if len(oldExe.Spec.HealthProbes) != len(e.Spec.HealthProbes) {
errorList = append(errorList, field.Forbidden(field.NewPath("spec", "healthProbes"), "Health probes cannot be changed once an Executable is created."))
} else {
for i, probe := range oldExe.Spec.HealthProbes {
if !probe.Equal(&e.Spec.HealthProbes[i]) {
errorList = append(errorList, field.Forbidden(field.NewPath("spec", "healthProbes").Index(i), "Health probes cannot be changed once an Executable is created."))
}
}
}
if !oldExe.Spec.PemCertificates.Equal(e.Spec.PemCertificates) {
errorList = append(errorList, field.Forbidden(field.NewPath("spec", "pemCertificates"), "pemCertificates cannot be changed once an Executable is created."))
}
return errorList
}
func (e *Executable) Done() bool {
// When the Executable has a FinishTimestamp set, it is considered done no matter what other data says.
return !e.Status.FinishTimestamp.IsZero()
}
func (*Executable) GenericSubResources() []apiserver_resource.GenericSubResource {
return []apiserver_resource.GenericSubResource{
&ExecutableLogResource{},
}
}
// ExecutableList contains a list of Executable instances
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
type ExecutableList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Executable `json:"items"`
}
func (el *ExecutableList) GetListMeta() *metav1.ListMeta {
return &el.ListMeta
}
func (el *ExecutableList) ItemCount() uint32 {
return uint32(len(el.Items))
}
func (el *ExecutableList) GetItems() []*Executable {
retval := make([]*Executable, len(el.Items))
for i := range el.Items {
retval[i] = &el.Items[i]
}
return retval
}
type ExecutableLogResource struct{}
func (elr *ExecutableLogResource) Name() string {
return LogSubresourceName
}
func (elr *ExecutableLogResource) GetStorageProvider(
obj apiserver_resource.Object,
rootPath string,
parentSP apiserver.StorageProvider,
) apiserver.StorageProvider {
return func(scheme *runtime.Scheme, reg generic_registry.RESTOptionsGetter) (registry_rest.Storage, error) {
storage, err := parentSP(scheme, reg)
if err != nil {
return nil, fmt.Errorf("failed to get parent (%s) storage: %w", obj.GetObjectKind().GroupVersionKind().Kind, err)
}
exeStorage, isGetter := storage.(registry_rest.StandardStorage)
if !isGetter {
return nil, fmt.Errorf("parent (%s) should implement registry_rest.Getter", obj.GetObjectKind().GroupVersionKind().Kind)
}
logStreamFactory, found := ResourceLogStreamers.Load(obj.GetGroupVersionResource())
if !found {
return nil, fmt.Errorf("log stream factory not found for resource '%s'", obj.GetGroupVersionResource().String())
}
logStorage, err := NewLogStorage(exeStorage, logStreamFactory)
if err != nil {
return nil, err
}
return logStorage, nil
}
}
func init() {
SchemeBuilder.Register(&Executable{}, &ExecutableList{})
}
// Ensure types support interfaces expected by our API server
var _ apiserver_resource.Object = (*Executable)(nil)
var _ apiserver_resource.ObjectList = (*ExecutableList)(nil)
var _ commonapi.ListWithObjectItems[Executable, *Executable] = (*ExecutableList)(nil)
var _ apiserver_resource.ObjectWithStatusSubResource = (*Executable)(nil)
var _ apiserver_resource.StatusSubResource = (*ExecutableStatus)(nil)
var _ apiserver_resourcerest.ShortNamesProvider = (*Executable)(nil)
var _ apiserver_resourcestrategy.Validater = (*Executable)(nil)
var _ apiserver_resourcestrategy.ValidateUpdater = (*Executable)(nil)
var _ apiserver_resource.ObjectWithGenericSubResource = (*Executable)(nil)
var _ apiserver_resource.GenericSubResource = (*ExecutableLogResource)(nil)
var _ StdIoStreamableResource = (*Executable)(nil)