-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Philip Laine <[email protected]>
- Loading branch information
1 parent
56e48d4
commit ae6c1dc
Showing
36 changed files
with
3,110 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors | ||
|
||
package packager2 | ||
|
||
import ( | ||
"context" | ||
|
||
layout2 "github.com/zarf-dev/zarf/src/internal/packager2/layout" | ||
) | ||
|
||
type CreateOptions struct { | ||
Flavor string | ||
RegistryOverrides map[string]string | ||
SigningKeyPath string | ||
SigningKeyPassword string | ||
SetVariables map[string]string | ||
MaxPackageSizeMB int | ||
Output string | ||
} | ||
|
||
func Create(ctx context.Context, packagePath string, opt CreateOptions) error { | ||
createOpt := layout2.CreateOptions{ | ||
Flavor: opt.Flavor, | ||
RegistryOverrides: opt.RegistryOverrides, | ||
SigningKeyPath: opt.SigningKeyPath, | ||
SigningKeyPassword: opt.SigningKeyPassword, | ||
SetVariables: opt.SetVariables, | ||
MaxPackageSizeMB: opt.MaxPackageSizeMB, | ||
Output: opt.Output, | ||
} | ||
_, err := layout2.CreatePackage(ctx, packagePath, createOpt) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
} |
Oops, something went wrong.