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

Commit

Permalink
Plugin changes for k8s events
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Dye <andrewwdye@gmail.com>
  • Loading branch information
andrewwdye committed Sep 21, 2023
1 parent 08dd79b commit 736c1e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion go/tasks/pluginmachinery/core/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"fmt"
"time"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
structpb "github.com/golang/protobuf/ptypes/struct"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
)

const DefaultPhaseVersion = uint32(0)
Expand Down Expand Up @@ -83,6 +84,11 @@ type ExternalResource struct {
Phase Phase
}

type ReasonInfo struct {
Reason string
OccurredAt *time.Time
}

type TaskInfo struct {
// log information for the task execution
Logs []*core.TaskLog
Expand All @@ -96,6 +102,8 @@ type TaskInfo struct {
CustomInfo *structpb.Struct
// A collection of information about external resources launched by this task
ExternalResources []*ExternalResource
// Additional reasons for this case. Note, these are not included in the phase state.
AdditionalReasons []ReasonInfo
}

func (t *TaskInfo) String() string {
Expand Down
5 changes: 4 additions & 1 deletion go/tasks/pluginmachinery/flytek8s/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (

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

config2 "github.com/flyteorg/flytestdlib/config"
v1 "k8s.io/api/core/v1"

config2 "github.com/flyteorg/flytestdlib/config"

"github.com/flyteorg/flyteplugins/go/tasks/config"
)

Expand Down Expand Up @@ -167,6 +168,8 @@ type K8sPluginConfig struct {
// DefaultPodTemplateResync defines the frequency at which the k8s informer resyncs the default
// pod template resources.
DefaultPodTemplateResync config2.Duration `json:"default-pod-template-resync" pflag:",Frequency of resyncing default pod templates"`

SendObjectEvents bool `json:"send-object-events" pflag:",If true, will send object events as TaskExecutionEvent updates."`
}

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

0 comments on commit 736c1e5

Please sign in to comment.