Skip to content

Commit ce7cdd7

Browse files
author
Emruz Hossain
committed
Rename components from manifest-backup to kubedump
Signed-off-by: Emruz Hossain <emruz@appscode.com>
1 parent d2a417e commit ce7cdd7

File tree

13 files changed

+24
-26
lines changed

13 files changed

+24
-26
lines changed

Dockerfile.dbg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN set -x
3030

3131
FROM {ARG_FROM}
3232

33-
LABEL org.opencontainers.image.source https://github.com/stashed/manifest-backup
33+
LABEL org.opencontainers.image.source https://github.com/stashed/kubedump
3434

3535
COPY --from=0 restic /bin/restic
3636
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}

Dockerfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN set -x
3030

3131
FROM {ARG_FROM}
3232

33-
LABEL org.opencontainers.image.source https://github.com/stashed/manifest-backup
33+
LABEL org.opencontainers.image.source https://github.com/stashed/kubedump
3434

3535
COPY --from=0 /restic /bin/restic
3636
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SHELL=/bin/bash -o pipefail
1616

1717
GO_PKG := stash.appscode.dev
1818
REPO := $(notdir $(shell pwd))
19-
BIN := manifest-backup
19+
BIN := kubedump
2020
COMPRESS ?= no
2121

2222

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[![Go Report Card](https://goreportcard.com/badge/stash.appscode.dev/manifest-backup)](https://goreportcard.com/report/stash.appscode.dev/manifest-backup)
2-
![CI](https://github.com/stashed/manifest-backup/workflows/CI/badge.svg)
3-
[![Docker Pulls](https://img.shields.io/docker/pulls/stashed/manifest-backup.svg)](https://hub.docker.com/r/stashed/manifest-backup/)
1+
[![Go Report Card](https://goreportcard.com/badge/stash.appscode.dev/kubedump)](https://goreportcard.com/report/stash.appscode.dev/kubedump)
2+
![CI](https://github.com/stashed/kubedump/workflows/CI/badge.svg)
3+
[![Docker Pulls](https://img.shields.io/docker/pulls/stashed/kubedump.svg)](https://hub.docker.com/r/stashed/kubedump/)
44
[![Slack](https://shields.io/badge/Join_Slack-salck?color=4A154B&logo=slack)](https://slack.appscode.com)
55
[![Twitter](https://img.shields.io/twitter/follow/kubestash.svg?style=social&logo=twitter&label=Follow)](https://twitter.com/intent/follow?screen_name=KubeStash)
66

7-
# Manifest Backup
7+
# kubedump
88

9-
Kubernetes manifest backup plugin for [Stash by AppsCode](https://stash.run).
9+
Kubernetes resource backup plugin for [Stash by AppsCode](https://stash.run).
1010

1111
## Support
1212

cmd/manifest-backup/main.go renamed to cmd/kubedump/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"runtime"
2222

2323
_ "stash.appscode.dev/apimachinery/client/clientset/versioned/fake"
24-
"stash.appscode.dev/manifest-backup/pkg"
24+
"stash.appscode.dev/kubedump/pkg"
2525

2626
"gomodules.xyz/logs"
2727
_ "k8s.io/client-go/kubernetes/fake"
File renamed without changes.

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module stash.appscode.dev/manifest-backup
1+
module stash.appscode.dev/kubedump
22

33
go 1.15
44

@@ -14,7 +14,6 @@ require (
1414
k8s.io/client-go v0.21.1
1515
k8s.io/klog/v2 v2.9.0
1616
kmodules.xyz/client-go v0.0.0-20220404224906-af7b092cfac5
17-
kmodules.xyz/custom-resources v0.0.0-20220317220154-7beb809b1f5e
1817
kmodules.xyz/offshoot-api v0.0.0-20220419215722-c7fc995091d3
1918
sigs.k8s.io/yaml v1.3.0
2019
stash.appscode.dev/apimachinery v0.19.1-0.20220425033401-c840c081133c

pkg/backup.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"stash.appscode.dev/apimachinery/pkg/invoker"
2727
"stash.appscode.dev/apimachinery/pkg/restic"
2828
api_util "stash.appscode.dev/apimachinery/pkg/util"
29-
"stash.appscode.dev/manifest-backup/pkg/manager"
29+
"stash.appscode.dev/kubedump/pkg/manager"
3030

3131
"github.com/spf13/cobra"
3232
license "go.bytebuilders.dev/license-verifier/kubernetes"
@@ -54,8 +54,8 @@ func NewCmdBackup() *cobra.Command {
5454
)
5555

5656
cmd := &cobra.Command{
57-
Use: "backup-manifest",
58-
Short: "Takes a backup of Kubernetes manifests",
57+
Use: "backup",
58+
Short: "Takes a backup of Kubernetes resources",
5959
DisableAutoGenTag: true,
6060
RunE: func(cmd *cobra.Command, args []string) error {
6161
flags.EnsureRequiredFlags(cmd, "provider", "storage-secret-name", "storage-secret-namespace")
@@ -89,7 +89,7 @@ func NewCmdBackup() *cobra.Command {
8989
for _, ti := range inv.GetTargetInfo() {
9090
if ti.Target != nil && opt.targetMatched(ti.Target.Ref, opt.targetRef) {
9191
var backupOutput *restic.BackupOutput
92-
backupOutput, err = opt.backupManifests(ti.Target.Ref)
92+
backupOutput, err = opt.backupResources(ti.Target.Ref)
9393
if err != nil {
9494
backupOutput = &restic.BackupOutput{
9595
BackupTargetStatus: v1beta1.BackupTargetStatus{
@@ -148,14 +148,14 @@ func NewCmdBackup() *cobra.Command {
148148

149149
cmd.Flags().StringVar(&opt.outputDir, "output-dir", opt.outputDir, "Directory where output.json file will be written (keep empty if you don't need to write output in file)")
150150

151-
cmd.Flags().BoolVar(&opt.sanitize, "sanitize", true, "Specify whether to remove the decorators from the manifest (default is true)")
151+
cmd.Flags().BoolVar(&opt.sanitize, "sanitize", true, "Specify whether to remove the decorators from the resource YAML (default is true)")
152152
cmd.Flags().StringVar(&opt.selector, "label-selector", "", "Specify a label selector to filter the resources.")
153153
cmd.Flags().BoolVar(&opt.includeDependants, "include-dependants", false, "Specify whether to backup the dependants object along with their parent.")
154154

155155
return cmd
156156
}
157157

158-
func (opt *options) backupManifests(targetRef v1beta1.TargetRef) (*restic.BackupOutput, error) {
158+
func (opt *options) backupResources(targetRef v1beta1.TargetRef) (*restic.BackupOutput, error) {
159159
var err error
160160
opt.setupOptions.StorageSecret, err = opt.kubeClient.CoreV1().Secrets(opt.storageSecret.Namespace).Get(context.TODO(), opt.storageSecret.Name, metav1.GetOptions{})
161161
if err != nil {
@@ -190,7 +190,7 @@ func (opt *options) backupManifests(targetRef v1beta1.TargetRef) (*restic.Backup
190190
}
191191

192192
klog.Infoln("Cleaning up directory: ", opt.dataDir)
193-
opt.dataDir = filepath.Join(opt.setupOptions.ScratchDir, "manifests")
193+
opt.dataDir = filepath.Join(opt.setupOptions.ScratchDir, "resources")
194194
if err := clearDir(opt.dataDir); err != nil {
195195
return nil, err
196196
}

pkg/manager/application.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"path/filepath"
2222

2323
"stash.appscode.dev/apimachinery/apis/stash/v1beta1"
24-
"stash.appscode.dev/manifest-backup/pkg/sanitizers"
24+
"stash.appscode.dev/kubedump/pkg/sanitizers"
2525

2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2727
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

pkg/manager/generic_resources.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"strings"
2222

2323
"stash.appscode.dev/apimachinery/apis"
24-
"stash.appscode.dev/manifest-backup/pkg/sanitizers"
24+
"stash.appscode.dev/kubedump/pkg/sanitizers"
2525

2626
"gomodules.xyz/sets"
2727
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

0 commit comments

Comments
 (0)