k8up-io / wrestic

Restic Backup Kubernetes and OpenShift Wrapper - Part of K8up
BSD 3-Clause "New" or "Revised" License
16 stars 3 forks source link

Complete Wrestic rewrite #22

Closed Kidswiss closed 4 years ago

Kidswiss commented 4 years ago

This is a complete rewrite of the Wrestic tool.

The rewrite features:

The current state should cover all the functionality of v.0.1.8 including tags. Some minor things still need to be adjusted as well as some more testing.

Kidswiss commented 4 years ago

Also the integration tests need some love to work again with the internal changes.

mhutter commented 4 years ago

I did the lazy thing and just run golangci-lint, but it had some good points:

restic/restic.go:26:2: `promURLEnv` is unused (deadcode)
        promURLEnv        = "PROM_URL"
        ^
restic/restic.go:27:2: `statsURLEnv` is unused (deadcode)
        statsURLEnv       = "STATS_URL"
        ^
restic/restic.go:29:2: `restoreDirEnv` is unused (deadcode)
        restoreDirEnv     = "RESTORE_DIR"
        ^
restic/restic.go:30:2: `listTimeoutEnv` is unused (deadcode)
        listTimeoutEnv    = "BACKUP_LIST_TIMEOUT"
        ^
restic/restic.go:32:2: `repositoryEnv` is unused (deadcode)
        repositoryEnv     = "RESTIC_REPOSITORY"
        ^

Probably not used anymore?

restic/wait.go:152:6: type `stdErrCatcher` is unused (unused)
restic/backup.go:129:18: func `(*Restic).sendBackupStats` is unused (unused)

The last one may be an error that it is not used at all?

Kidswiss commented 4 years ago

Interesting, I'm using the golangci-lint from withing vscode. Looks like it uses slightly different configuration there as it didn't catch the same issues.

stdErrCatcher is what evolved into the more generic logErrParser in the utils.go file.

Will run it manually and have a look at the issues it finds, thanks for pointing that out  @mhutter

Kidswiss commented 4 years ago

restic/backup.go:129:18: func(*Restic).sendBackupStatsis unused (unused)

Got lost while changing the backup parsing to not use any goroutines. It's now properly added again.

I'll attempt to rebase this whole thing later.