forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge k8s container and sidecar plugins (flyteorg#225)
* initial commit Signed-off-by: Daniel Rammer <[email protected]> * setting container plugins primaryContainerName to '*' meaning the entire pod needs to complete Signed-off-by: Daniel Rammer <[email protected]> * added podBuilder interface Signed-off-by: Daniel Rammer <[email protected]> * building plugin with podBuilders and a defaultPodBuilder for easier testing Signed-off-by: Daniel Rammer <[email protected]> * unexported the podBuilder interface and it's functions Signed-off-by: Daniel Rammer <[email protected]> * converted sidecar tests to this pod plugin Signed-off-by: Daniel Rammer <[email protected]> * ported over container tests Signed-off-by: Daniel Rammer <[email protected]> * updated sidecar test variable names to work with container tests Signed-off-by: Daniel Rammer <[email protected]> * added comments for a little better documentation Signed-off-by: Daniel Rammer <[email protected]> * added mergeMapInto function to each annotation and label setting on sidecar Signed-off-by: Daniel Rammer <[email protected]> * fixed lint issues Signed-off-by: Daniel Rammer <[email protected]> * removed container and sidecar plugins and registered existing task types to use new pod plugin Signed-off-by: Daniel Rammer <[email protected]>
- Loading branch information
Showing
8 changed files
with
465 additions
and
434 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package pod | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" | ||
|
||
pluginsCore "github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/core" | ||
"github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/flytek8s" | ||
|
||
v1 "k8s.io/api/core/v1" | ||
) | ||
|
||
const ( | ||
containerTaskType = "container" | ||
) | ||
|
||
type containerPodBuilder struct { | ||
} | ||
|
||
func (containerPodBuilder) buildPodSpec(ctx context.Context, task *core.TaskTemplate, taskCtx pluginsCore.TaskExecutionContext) (*v1.PodSpec, error) { | ||
podSpec, err := flytek8s.ToK8sPodSpec(ctx, taskCtx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return podSpec, nil | ||
} | ||
|
||
func (containerPodBuilder) updatePodMetadata(ctx context.Context, pod *v1.Pod, task *core.TaskTemplate, taskCtx pluginsCore.TaskExecutionContext) error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.