Add a new OpenAPI v3 REST API to warewulfd at /api
Co-authored-by: jason yang <jasonyangshadow@gmail.com> Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -163,7 +163,7 @@ func ImageImport(cip *wwapiv1.ImageImportParameter) (imageName string, err error
|
||||
} else if strings.HasPrefix(cip.Source, "docker://") || strings.HasPrefix(cip.Source, "docker-daemon://") ||
|
||||
strings.HasPrefix(cip.Source, "file://") || util.IsFile(cip.Source) {
|
||||
var sCtx *types.SystemContext
|
||||
sCtx, err = getSystemContext(cip.OciNoHttps, cip.OciUsername, cip.OciPassword, cip.Platform)
|
||||
sCtx, err = GetSystemContext(cip.OciNoHttps, cip.OciUsername, cip.OciPassword, cip.Platform)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -386,7 +386,7 @@ func ImageRename(crp *wwapiv1.ImageRenameParameter) (err error) {
|
||||
}
|
||||
|
||||
// create the system context and reading out environment variables
|
||||
func getSystemContext(noHttps bool, username string, password string, platform string) (sCtx *types.SystemContext, err error) {
|
||||
func GetSystemContext(noHttps bool, username string, password string, platform string) (sCtx *types.SystemContext, err error) {
|
||||
sCtx = &types.SystemContext{}
|
||||
// only check env if noHttps wasn't set
|
||||
if !noHttps {
|
||||
|
||||
Reference in New Issue
Block a user