Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
pingsutw committed Sep 5, 2024
1 parent 4d89c29 commit a9d7bee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion flyteadmin/pkg/common/naming/execution_name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestGetExecutionName(t *testing.T) {
})

t.Run("deterministic name", func(t *testing.T) {
hashValue := identifier.HashScheduledTimeStamp(context.Background(), core.Identifier{
hashValue := identifier.HashScheduledTimeStamp(context.Background(), &core.Identifier{
Project: "Project",
Domain: "Domain",
Name: "Name",
Expand Down
2 changes: 1 addition & 1 deletion flyteadmin/scheduler/executor/executor_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (w *executor) Execute(ctx context.Context, scheduledTime time.Time, s model
}

// Making the identifier deterministic using the hash of the identifier and scheduled time
hashValue := identifier.HashScheduledTimeStamp(ctx, core.Identifier{
hashValue := identifier.HashScheduledTimeStamp(ctx, &core.Identifier{
Project: s.Project,
Domain: s.Domain,
Name: s.Name,
Expand Down
4 changes: 2 additions & 2 deletions flyteadmin/scheduler/identifier/identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func GetScheduleName(ctx context.Context, s models.SchedulableEntity) string {
}

// GetExecutionIdentifier returns UUID using the hashed value of the schedule identifier and the scheduledTime
func GetExecutionIdentifier(ctx context.Context, identifier core.Identifier, scheduledTime time.Time) (uuid.UUID, error) {
func GetExecutionIdentifier(ctx context.Context, identifier *core.Identifier, scheduledTime time.Time) (uuid.UUID, error) {
hashValue := HashScheduledTimeStamp(ctx, identifier, scheduledTime)

Check warning on line 37 in flyteadmin/scheduler/identifier/identifier.go

View check run for this annotation

Codecov / codecov/patch

flyteadmin/scheduler/identifier/identifier.go#L37

Added line #L37 was not covered by tests
b := make([]byte, 16)
binary.LittleEndian.PutUint64(b, hashValue)
Expand All @@ -56,7 +56,7 @@ func hashIdentifier(ctx context.Context, identifier *core.Identifier) uint64 {
}

// HashScheduledTimeStamp return the hash of the identifier and the scheduledTime
func HashScheduledTimeStamp(ctx context.Context, identifier core.Identifier, scheduledTime time.Time) uint64 {
func HashScheduledTimeStamp(ctx context.Context, identifier *core.Identifier, scheduledTime time.Time) uint64 {
h := fnv.New64()
_, err := h.Write([]byte(fmt.Sprintf(executionIDInputsFormat,
identifier.Project, identifier.Domain, identifier.Name, identifier.Version, scheduledTime.Unix())))
Expand Down

0 comments on commit a9d7bee

Please sign in to comment.