Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2773b87
Signed release channels
ldmonster Oct 13, 2025
9439049
[deckhouse-cli] feat: add plugins architecture (#176)
ldmonster Oct 13, 2025
ac58b85
mirror: do not pull security databases for editions where they are no…
mvasl Oct 16, 2025
987329a
k8s-client: use Precedence in NewNonInteractiveDeferredLoadingClientC…
pabateman Oct 16, 2025
fdf72ad
[deckhouse-cli] lint revive (#187)
ldmonster Oct 16, 2025
980a614
[deckhouse-cli] fix/lint revive (#188)
ldmonster Oct 17, 2025
cfcb200
[trdl] d8 v0.20.8 for trdl channels (#189)
RottenRat Oct 17, 2025
478e742
Add version before start on d8 mirror pull|push command (#190)
RottenRat Oct 17, 2025
e55ac9e
[deckhouse-cli] feat/rollback revive (#192)
ldmonster Oct 17, 2025
afb02d7
Signed release channels
ldmonster Oct 17, 2025
e8886b5
[deckhouse-cli] feat/mirror pull logic refactor (#194)
ldmonster Oct 17, 2025
1ef2859
[deckhouse-cli] Installation readme (#195)
ldmonster Oct 17, 2025
e30ee34
[deckhouse-cli] incorrect push operation for extra images (#182)
brileyyyy Oct 20, 2025
c7ae07a
[deckhouse-cli] remove tmp dir in all cases
brileyyyy Oct 14, 2025
8860b5a
[deckhouse-cli] handle custom tmp directory
brileyyyy Oct 15, 2025
90eb8b5
[deckhouse-cli] adapt tmp removing for a new arhictecture
brileyyyy Oct 20, 2025
a3882b6
Merge branch 'main' into feat/tmp-dir-pull-removing
brileyyyy Oct 20, 2025
5e5cf22
[deckhouse-cli] fix tests
brileyyyy Oct 20, 2025
8abdfcf
Merge branch 'feat/tmp-dir-pull-removing' of github.com:deckhouse/dec…
brileyyyy Oct 20, 2025
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
6 changes: 5 additions & 1 deletion internal/mirror/cmd/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func buildPullParams(logger params.Logger) *params.PullParams {
BundleDir: ImagesBundlePath,
WorkingDir: filepath.Join(
TempDir,
"mirror",
"pull",
fmt.Sprintf("%x", md5.Sum([]byte(SourceRegistryRepo))),
),
Expand Down Expand Up @@ -246,6 +247,9 @@ func NewPuller(cmd *cobra.Command) *Puller {
}
}
func (p *Puller) Execute() error {
// Ensure temporary directory is cleaned up even if an error occurs
defer p.finalCleanup()

if err := p.cleanupWorkingDirectory(); err != nil {
return err
}
Expand All @@ -266,7 +270,7 @@ func (p *Puller) Execute() error {
return err
}

return p.finalCleanup()
return nil
}

// cleanupWorkingDirectory handles cleanup of the working directory if needed
Expand Down
5 changes: 3 additions & 2 deletions internal/mirror/cmd/pull/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ func TestBuildPullParams(t *testing.T) {
// Check working directory calculation
expectedWorkingDir := filepath.Join(
TempDir,
"mirror",
"pull",
fmt.Sprintf("%x", md5.Sum([]byte(SourceRegistryRepo))),
)
Expand Down Expand Up @@ -422,7 +423,7 @@ func TestWorkingDirectoryCalculation(t *testing.T) {
params := buildPullParams(logger)

expectedHash := fmt.Sprintf("%x", md5.Sum([]byte(SourceRegistryRepo)))
expectedPath := filepath.Join(TempDir, "pull", expectedHash)
expectedPath := filepath.Join(TempDir, "mirror", "pull", expectedHash)

assert.Equal(t, expectedPath, params.WorkingDir)
assert.Contains(t, params.WorkingDir, "pull")
Expand Down Expand Up @@ -528,7 +529,7 @@ func TestValidateTmpPathEmpty(t *testing.T) {
assert.NoError(t, err)

// Check that TempDir was set to default
expectedTempDir := filepath.Join(tempDir, ".tmp", "mirror")
expectedTempDir := filepath.Join(tempDir, ".tmp")
assert.Equal(t, expectedTempDir, TempDir)

// Check that directory was created
Expand Down
2 changes: 1 addition & 1 deletion internal/mirror/cmd/pull/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func validateChunkSizeFlag() error {

func validateTmpPath(args []string) error {
if TempDir == "" {
TempDir = filepath.Join(ImagesBundlePath, ".tmp", "mirror")
TempDir = filepath.Join(ImagesBundlePath, ".tmp")
}
if err := os.MkdirAll(TempDir, 0755); err != nil {
return fmt.Errorf("Error creating temp directory at %s: %w", TempDir, err)
Expand Down
2 changes: 1 addition & 1 deletion internal/mirror/cmd/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func buildPushParams(logger params.Logger) *params.PushParams {
RegistryPath: RegistryPath,
ModulesPathSuffix: ModulesPathSuffix,
BundleDir: ImagesBundlePath,
WorkingDir: filepath.Join(TempDir, "push"),
WorkingDir: filepath.Join(TempDir, "mirror", "push"),
},

Parallelism: params.ParallelismConfig{
Expand Down
4 changes: 2 additions & 2 deletions internal/mirror/cmd/push/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ func validateImagesBundlePathArg(args []string) error {
}

if TempDir == "" {
TempDir = filepath.Join(ImagesBundlePath, ".tmp", "mirror")
TempDir = filepath.Join(ImagesBundlePath, ".tmp")
}

return nil
}

if bundleExtension := filepath.Ext(ImagesBundlePath); bundleExtension == ".tar" || bundleExtension == ".chunk" {
if TempDir == "" {
TempDir = filepath.Join(filepath.Dir(ImagesBundlePath), ".tmp", "mirror")
TempDir = filepath.Join(filepath.Dir(ImagesBundlePath), ".tmp")
}
return nil
}
Expand Down