Skip to content

Commit 6a9190b

Browse files
committed
[coconut] Adapt config import to new behavior of GetLatestTimestamp
1 parent a4ffc5a commit 6a9190b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coconut/configuration/configuration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,12 @@ func Import(cfg *configuration.ConsulSource, cmd *cobra.Command, args []string,
408408
}
409409

410410
if entryExists {
411-
if latestTimestamp != "0" && useNoVersion {
411+
if (latestTimestamp != "0" && latestTimestamp != "") && useNoVersion {
412412
// If a timestamp already exists in the entry specified by the user, than it cannot be used
413413
return errors.New("Specified entry: '" + entry + "' already contains versioned items. Please " +
414414
"specify a different entry name"), invalidArgs
415415
}
416-
if latestTimestamp == "0" && !useNoVersion {
416+
if (latestTimestamp == "0" || latestTimestamp == "") && !useNoVersion {
417417
// If a timestamp does not exist for specified entry but user wants versioning than an error is thrown
418418
return errors.New("Specified entry: '" + entry + "' already contains un-versioned items. Please " +
419419
"specify a different entry name"), invalidArgs

0 commit comments

Comments
 (0)