Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions cmd/kflashback/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import (

"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/dynamic"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

flashbackv1alpha1 "github.com/kflashback/kflashback/api/v1alpha1"
"github.com/kflashback/kflashback/internal/config"
Expand Down Expand Up @@ -117,8 +118,11 @@ func main() {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
HealthProbeBindAddress: cfg.HealthAddress,
LeaderElection: cfg.LeaderElection,
LeaderElectionID: "kflashback.flashback.io",
Metrics: metricsserver.Options{
BindAddress: cfg.MetricsAddress,
},
LeaderElection: cfg.LeaderElection,
LeaderElectionID: "kflashback.flashback.io",
})
if err != nil {
setupLog.Error(err, "unable to create manager")
Expand Down
6 changes: 3 additions & 3 deletions internal/server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ type apiMeta struct {
}

type diffResponse struct {
FromRevision int64 `json:"fromRevision"`
ToRevision int64 `json:"toRevision"`
FromRevision int64 `json:"fromRevision"`
ToRevision int64 `json:"toRevision"`
Patch json.RawMessage `json:"patch"`
ChangedPaths []string `json:"changedPaths"`
ChangedPaths []string `json:"changedPaths"`
FromSnapshot json.RawMessage `json:"fromSnapshot,omitempty"`
ToSnapshot json.RawMessage `json:"toSnapshot,omitempty"`
}
Expand Down
18 changes: 9 additions & 9 deletions internal/storage/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ type ResourceListQuery struct {

// StorageStats provides storage statistics.
type StorageStats struct {
TotalResources int64 `json:"totalResources"`
TotalRevisions int64 `json:"totalRevisions"`
StorageBytes int64 `json:"storageBytes"`
TotalResources int64 `json:"totalResources"`
TotalRevisions int64 `json:"totalRevisions"`
StorageBytes int64 `json:"storageBytes"`
OldestRevision *time.Time `json:"oldestRevision,omitempty"`
NewestRevision *time.Time `json:"newestRevision,omitempty"`
}
Expand All @@ -93,10 +93,10 @@ type KindStats struct {

// DiffResult represents the diff between two revisions.
type DiffResult struct {
FromRevision int64 `json:"fromRevision"`
ToRevision int64 `json:"toRevision"`
Patch []byte `json:"patch"`
ChangedPaths []string `json:"changedPaths"`
FromSnapshot []byte `json:"fromSnapshot"`
ToSnapshot []byte `json:"toSnapshot"`
FromRevision int64 `json:"fromRevision"`
ToRevision int64 `json:"toRevision"`
Patch []byte `json:"patch"`
ChangedPaths []string `json:"changedPaths"`
FromSnapshot []byte `json:"fromSnapshot"`
ToSnapshot []byte `json:"toSnapshot"`
}
Loading