Skip to content

Commit

Permalink
fixing paning while removing the null tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehul-Kumar-27 committed Oct 13, 2024
1 parent 3d0e209 commit 6e54a14
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"name": "harbor-satellite",
"sdk": "go",
"source": "ci",
"engineVersion": "v0.13.3"
"engineVersion": "v0.13.0"
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ require (
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0
go.opentelemetry.io/otel/log v0.3.0
go.opentelemetry.io/otel/log v0.7.0
go.opentelemetry.io/otel/metric v1.27.0 // indirect
go.opentelemetry.io/otel/sdk v1.27.0
go.opentelemetry.io/otel/sdk/log v0.3.0
Expand Down
7 changes: 3 additions & 4 deletions internal/state/state_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ func (f *FetchAndReplicateStateProcess) Execute(ctx context.Context) error {

func (f *FetchAndReplicateStateProcess) GetChanges(newState StateReader, log *zerolog.Logger) ([]ArtifactReader, []ArtifactReader, StateReader) {
log.Info().Msg("Getting changes")
// Remove artifacts with null tags from the new state
newState = f.RemoveNullTagArtifacts(newState)

var entityToDelete []ArtifactReader
var entityToReplicate []ArtifactReader
Expand All @@ -97,10 +99,7 @@ func (f *FetchAndReplicateStateProcess) GetChanges(newState StateReader, log *ze
log.Warn().Msg("Old state is nil")
return entityToDelete, newState.GetArtifacts(), newState
}

// Remove artifacts with null tags from the new state
newState = f.RemoveNullTagArtifacts(newState)


// Create maps for quick lookups
oldArtifactsMap := make(map[string]ArtifactReader)
for _, oldArtifact := range f.stateReader.GetArtifacts() {
Expand Down

0 comments on commit 6e54a14

Please sign in to comment.