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

Commit

Permalink
add port, add nil checks
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor committed Aug 1, 2023
1 parent 5a63652 commit ae78b90
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/artifacts/artifact_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package artifacts
import (
"context"
"crypto/tls"
"fmt"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/artifact"
"github.com/flyteorg/flytestdlib/logger"
"google.golang.org/grpc"
Expand All @@ -24,7 +25,7 @@ func NewArtifactConnection(_ context.Context, cfg *Config, opts ...grpc.DialOpti
opts = append(opts, grpc.WithTransportCredentials(creds))
}

return grpc.Dial(cfg.Host, opts...)
return grpc.Dial(fmt.Sprintf("%s:%d", cfg.Host, cfg.Port), opts...)
}

func InitializeArtifactClient(ctx context.Context, cfg *Config, opts ...grpc.DialOption) artifact.ArtifactRegistryClient {
Expand Down
8 changes: 7 additions & 1 deletion pkg/manager/impl/execution_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,11 @@ func resolveSecurityCtx(ctx context.Context, executionConfigSecurityCtx *core.Se
// ResolveLiteralMapArtifacts will go through the input literal map and resolve any artifact references to their
// literal values.
func (m *ExecutionManager) ResolveLiteralMapArtifacts(ctx context.Context, inputs *core.LiteralMap) (*core.LiteralMap, []*core.ArtifactID, error) {
// only top level replace for now.
var artifactIDs []*core.ArtifactID
if inputs == nil {
return nil, artifactIDs, nil
}
// only top level replace for now.
outputs := map[string]*core.Literal{}
for k, v := range inputs.Literals {
if v.GetArtifactId() != nil {
Expand Down Expand Up @@ -746,6 +749,9 @@ func (m *ExecutionManager) ResolveLiteralMapArtifacts(ctx context.Context, input
func (m *ExecutionManager) ResolveParameterMapArtifacts(ctx context.Context, inputs *core.ParameterMap) (*core.ParameterMap, []*core.ArtifactID, error) {
// only top level replace for now.
var artifactIDs []*core.ArtifactID
if inputs == nil {
return nil, artifactIDs, nil
}
outputs := map[string]*core.Parameter{}
x := *m.artifactClient

Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/impl/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func validateParameterMap(inputMap *core.ParameterMap, fieldName string) error {
"The Variable component of the Parameter %s in %s either is missing, or has a missing Type",
name, fieldName)
}
if defaultInput.GetDefault() == nil && !defaultInput.GetRequired() {
if defaultInput.GetDefault() == nil && defaultInput.GetArtifactQuery() == nil && !defaultInput.GetRequired() {
return errors.NewFlyteAdminErrorf(codes.InvalidArgument,
"Invalid variable %s in %s - variable has neither default, nor is required. "+
"One must be specified", name, fieldName)
Expand Down

0 comments on commit ae78b90

Please sign in to comment.