Skip to content

Commit

Permalink
remove comments, make getTrackingString take a pointer receiver
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 Jan 5, 2024
1 parent 1251583 commit 153484b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions flyteartifacts/pkg/lib/url_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ func ParseFlyteURL(urlStr string) (core.ArtifactID, error) {
if err != nil {
return core.ArtifactID{}, err
}
//projectDomainName := strings.Split(strings.Trim(parsed.Path, "/"), "/")
//if len(projectDomainName) < 3 {
// return core.ArtifactID{}, errors.New("invalid URL format")
//}
//project, domain, name := projectDomainName[0], projectDomainName[1], strings.Join(projectDomainName[2:], "/")

var project, domain, name, version string
queryDict := make(map[string]string)

Expand Down
4 changes: 2 additions & 2 deletions flyteartifacts/pkg/server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type CoreService struct {
}

// This string is a tracker basically that will be installed in the metadata of the literal. See the ArtifactKey constant for more information.
func (c *CoreService) getTrackingString(request artifact.CreateArtifactRequest) string {
func (c *CoreService) getTrackingString(request *artifact.CreateArtifactRequest) string {
ak := request.ArtifactKey
t := fmt.Sprintf("%s/%s/%s@%s", ak.Project, ak.Domain, ak.Name, request.Version)

Expand All @@ -36,7 +36,7 @@ func (c *CoreService) CreateArtifact(ctx context.Context, request *artifact.Crea
if request.GetSpec().GetValue().Metadata == nil {
request.GetSpec().GetValue().Metadata = make(map[string]string, 1)
}
trackingStr := c.getTrackingString(*request)
trackingStr := c.getTrackingString(request)
request.GetSpec().GetValue().Metadata[lib.ArtifactKey] = trackingStr

artifactObj, err := models.CreateArtifactModelFromRequest(ctx, request.ArtifactKey, request.Spec, request.Version, request.Partitions, request.Tag, request.Source)
Expand Down

0 comments on commit 153484b

Please sign in to comment.