Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit 01ebefd

Browse files
authored
Plugin changes for plumbing k8s events into TaskExecutionEvent (#406)
* Plugin changes for k8s events Signed-off-by: Andrew Dye <[email protected]> * make generate Signed-off-by: Andrew Dye <[email protected]> * Comment for SendObjectEvents Signed-off-by: Andrew Dye <[email protected]> * make generate Signed-off-by: Andrew Dye <[email protected]> --------- Signed-off-by: Andrew Dye <[email protected]>
1 parent 8b417f4 commit 01ebefd

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

go/tasks/pluginmachinery/core/phase.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import (
44
"fmt"
55
"time"
66

7-
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
87
structpb "github.com/golang/protobuf/ptypes/struct"
8+
9+
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
910
)
1011

1112
const DefaultPhaseVersion = uint32(0)
@@ -83,6 +84,11 @@ type ExternalResource struct {
8384
Phase Phase
8485
}
8586

87+
type ReasonInfo struct {
88+
Reason string
89+
OccurredAt *time.Time
90+
}
91+
8692
type TaskInfo struct {
8793
// log information for the task execution
8894
Logs []*core.TaskLog
@@ -96,6 +102,8 @@ type TaskInfo struct {
96102
CustomInfo *structpb.Struct
97103
// A collection of information about external resources launched by this task
98104
ExternalResources []*ExternalResource
105+
// Additional reasons for this case. Note, these are not included in the phase state.
106+
AdditionalReasons []ReasonInfo
99107
}
100108

101109
func (t *TaskInfo) String() string {

go/tasks/pluginmachinery/flytek8s/config/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import (
1010

1111
"k8s.io/apimachinery/pkg/api/resource"
1212

13-
config2 "github.com/flyteorg/flytestdlib/config"
1413
v1 "k8s.io/api/core/v1"
1514

15+
config2 "github.com/flyteorg/flytestdlib/config"
16+
1617
"github.com/flyteorg/flyteplugins/go/tasks/config"
1718
)
1819

@@ -167,6 +168,9 @@ type K8sPluginConfig struct {
167168
// DefaultPodTemplateResync defines the frequency at which the k8s informer resyncs the default
168169
// pod template resources.
169170
DefaultPodTemplateResync config2.Duration `json:"default-pod-template-resync" pflag:",Frequency of resyncing default pod templates"`
171+
172+
// SendObjectEvents indicates whether to send k8s object events in TaskExecutionEvent updates (similar to kubectl get events).
173+
SendObjectEvents bool `json:"send-object-events" pflag:",If true, will send k8s object events in TaskExecutionEvent updates."`
170174
}
171175

172176
// FlyteCoPilotConfig specifies configuration for the Flyte CoPilot system. FlyteCoPilot, allows running flytekit-less containers

go/tasks/pluginmachinery/flytek8s/config/k8spluginconfig_flags.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/tasks/pluginmachinery/flytek8s/config/k8spluginconfig_flags_test.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)