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 go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
kmodules.xyz/offshoot-api v0.34.0
kmodules.xyz/prober v0.34.0
kubedb.dev/apimachinery v0.59.0
kubestash.dev/apimachinery v0.23.0-rc.0
kubestash.dev/apimachinery v0.23.0
sigs.k8s.io/controller-runtime v0.22.4
sigs.k8s.io/yaml v1.6.0
stash.appscode.dev/apimachinery v0.41.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -910,8 +910,8 @@ kubeops.dev/petset v0.0.15 h1:iwTRFAp0RNw0A87sw2c97UZ6WIA9H/nhJBpDhXLa7fk=
kubeops.dev/petset v0.0.15/go.mod h1:sw96WiXfzhpmKpXj4a5AdmEHs0Bx4QMhf+iW15zY4Gg=
kubeops.dev/sidekick v0.0.12 h1:pmUjQLZDKxgREiM6z0PogLR1aDbgvkE9jRjbxG6dEt0=
kubeops.dev/sidekick v0.0.12/go.mod h1:RU7QH3E8DOLw15rBYlOOJSyczuwAnVVtYyZjJb00UB8=
kubestash.dev/apimachinery v0.23.0-rc.0 h1:I+lsx2Q8De6wNEfR/tGnmrcaJONcb9Z8eurNYHeRt/s=
kubestash.dev/apimachinery v0.23.0-rc.0/go.mod h1:zJEjHjd/nYcXFSW+RfGbLxZMJK41IOWjQGosoAWZDRg=
kubestash.dev/apimachinery v0.23.0 h1:EB6w+lB0ACgnqIjtbyvRN5hVEmB8dVHSaN7SJCACHCY=
kubestash.dev/apimachinery v0.23.0/go.mod h1:zJEjHjd/nYcXFSW+RfGbLxZMJK41IOWjQGosoAWZDRg=
open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6 h1:mfcUKaSOYVDLzuontUOcasesbU9whNnvgrA0qf9trKs=
open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6/go.mod h1:YcmA6SpGEekIMxdoeVIIyOaBhMA6ImWRLXP4g8n8T+4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
10 changes: 4 additions & 6 deletions pkg/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ const (
PasswordFile = "/kubestash-tmp/password.txt"
ConfigDir = "/tmp/scratch/config"

ResticEnvs = "restic-envs"
ResticRegistry = "restic"
ResticImage = "restic"
ResticTag = "latest"
EnvHttpProxy = "HTTP_PROXY"
EnvHttpsProxy = "HTTPS_PROXY"
ResticEnvs = "restic-envs"
ResticImage = "ghcr.io/appscode-images/restic:0.18.1"
EnvHttpProxy = "HTTP_PROXY"
EnvHttpsProxy = "HTTPS_PROXY"
)

// Constants for debugging
Expand Down
5 changes: 2 additions & 3 deletions pkg/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ func NewCmdDownload(clientGetter genericclioptions.RESTClientGetter) *cobra.Comm
cmd.Flags().StringSliceVar(&downloadOpt.exclude, "exclude", downloadOpt.exclude, "List of pattern for directory/file to ignore during restore")
cmd.Flags().StringSliceVar(&downloadOpt.include, "include", downloadOpt.include, "List of pattern for directory/file to restore")

cmd.Flags().StringVar(&imgRestic.Registry, "docker-registry", imgRestic.Registry, "Docker image registry for restic cli")
cmd.Flags().StringVar(&imgRestic.Tag, "image-tag", imgRestic.Tag, "Restic docker image tag")
cmd.Flags().StringVar(&imgRestic.Image, "image", imgRestic.Image, "Restic docker image")

cmd.MarkFlagsMutuallyExclusive("exclude", "include")

Expand Down Expand Up @@ -304,7 +303,7 @@ func (opt *downloadOptions) runRestoreViaDocker(destination string, args []strin
"--env", fmt.Sprintf("%s=", EnvHttpProxy) + os.Getenv(EnvHttpProxy),
"--env", fmt.Sprintf("%s=", EnvHttpsProxy) + os.Getenv(EnvHttpsProxy),
"--env-file", filepath.Join(ConfigDir, ResticEnvs),
imgRestic.ToContainerImage(),
imgRestic.Image,
}

restoreArgs = append(restoreArgs, args...)
Expand Down
2 changes: 1 addition & 1 deletion pkg/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (opt *keyOptions) runCmdViaDocker(args []string) error {
keyArgs = append(keyArgs, "-v", opt.File+":"+opt.File)
}

keyArgs = append(keyArgs, imgRestic.ToContainerImage())
keyArgs = append(keyArgs, imgRestic.Image)
keyArgs = append(keyArgs, args...)

if opt.ID != "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func (opt *options) runRestoreViaDocker(destination string, args []string) error
"--env", fmt.Sprintf("%s=", EnvHttpProxy) + os.Getenv(EnvHttpProxy),
"--env", fmt.Sprintf("%s=", EnvHttpsProxy) + os.Getenv(EnvHttpsProxy),
"--env-file", filepath.Join(ConfigDir, ResticEnvs),
imgRestic.ToContainerImage(),
imgRestic.Image,
}

restoreArgs = append(restoreArgs, args...)
Expand Down
2 changes: 1 addition & 1 deletion pkg/unlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (opt *unlockOptions) runCmdViaDocker(args []string) error {
"--env", fmt.Sprintf("%s=", EnvHttpProxy) + os.Getenv(EnvHttpProxy),
"--env", fmt.Sprintf("%s=", EnvHttpsProxy) + os.Getenv(EnvHttpsProxy),
"--env-file", filepath.Join(ConfigDir, ResticEnvs),
imgRestic.ToContainerImage(),
imgRestic.Image,
}

unlockArgs = append(unlockArgs, args...)
Expand Down
2 changes: 0 additions & 2 deletions pkg/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ var (
)

func init() {
imgRestic.Registry = ResticRegistry
imgRestic.Image = ResticImage
imgRestic.Tag = ResticTag
}

func getSecret(ref kmapi.ObjectReference) (*core.Secret, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ func (opt *viewOptions) listFilesViaDockerThenFilter(args []string) ([]string, e
"--env", fmt.Sprintf("%s=%s", EnvHttpsProxy, os.Getenv(EnvHttpsProxy)),
"--env-file", filepath.Join(ConfigDir, ResticEnvs),
"--entrypoint", "sh",
imgRestic.ToContainerImage(),
imgRestic.Image,
"-c", "sleep infinity",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,8 @@ type GenericWebhookInfo struct {
}

type Docker struct {
// Registry specifies the name of a Docker registry
Registry string `json:"registry,omitempty"`

// Image specifies the name of a Docker image
Image string `json:"image,omitempty"`

// Tag specifies the Docker image tag
Tag string `json:"tag,omitempty"`
Image string `json:"image"`
}

type NetVolAccessor struct {
Expand All @@ -94,10 +88,6 @@ type NetVolAccessor struct {
PrivilegedMode bool `json:"privilegedMode,omitempty"`
}

func (docker Docker) ToContainerImage() string {
return docker.Registry + "/" + docker.Image + ":" + docker.Tag
}

func init() {
SchemeBuilder.Register(&KubeStashConfig{})
}
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ kubeops.dev/petset/crds
kubeops.dev/sidekick/apis/apps
kubeops.dev/sidekick/apis/apps/v1alpha1
kubeops.dev/sidekick/crds
# kubestash.dev/apimachinery v0.23.0-rc.0
# kubestash.dev/apimachinery v0.23.0
## explicit; go 1.25.0
kubestash.dev/apimachinery/apis
kubestash.dev/apimachinery/apis/addons/v1alpha1
Expand Down
Loading