Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor package loading process w/ Provider pattern #1943

Closed
Noxsios opened this issue Aug 2, 2023 · 1 comment · Fixed by #1977
Closed

Refactor package loading process w/ Provider pattern #1943

Noxsios opened this issue Aug 2, 2023 · 1 comment · Fixed by #1977
Assignees
Labels
ga Issues tracking toward Zarf 1.0
Milestone

Comments

@Noxsios
Copy link
Contributor

Noxsios commented Aug 2, 2023

Describe what should be investigated or refactored

The current loading process of a Zarf package is brittle and contains far too many code branches. Refactoring into a Provider pattern will allow for a common interface system to cleanly abstract away the different loading methods (via tarball, HTTP(S), OCI, etc...)

@Noxsios Noxsios self-assigned this Aug 2, 2023
@Noxsios
Copy link
Contributor Author

Noxsios commented Aug 12, 2023

Linking as tech debt to be refactored from #1770:

	if alreadyExtracted && pathsToCheck == nil {
		paths, err := utils.RecursiveFileList(p.tmp.Base, nil, false)
		if err != nil {
			return fmt.Errorf("unable to get a list of files in the package: %w", err)
		}
		for _, path := range paths {
			pathsToCheck = append(pathsToCheck, strings.TrimPrefix(path, p.tmp.Base+string(os.PathSeparator)))
		}
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ga Issues tracking toward Zarf 1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants