Add 'kpod login' and 'kpod logout' commands
Signed-off-by: umohnani8 <umohnani@redhat.com>
This commit is contained in:
parent
b21a3e36ac
commit
d664a58a6d
9 changed files with 334 additions and 4 deletions
|
@ -36,11 +36,12 @@ func GetCopyOptions(reportWriter io.Writer, signaturePolicyPath string, srcDocke
|
|||
}
|
||||
|
||||
// GetSystemContext Constructs a new containers/image/types.SystemContext{} struct from the given signaturePolicy path
|
||||
func GetSystemContext(signaturePolicyPath string) *types.SystemContext {
|
||||
func GetSystemContext(signaturePolicyPath, authFilePath string) *types.SystemContext {
|
||||
sc := &types.SystemContext{}
|
||||
if signaturePolicyPath != "" {
|
||||
sc.SignaturePolicyPath = signaturePolicyPath
|
||||
}
|
||||
sc.AuthFilePath = authFilePath
|
||||
return sc
|
||||
}
|
||||
|
||||
|
|
|
@ -413,7 +413,7 @@ func (r *Runtime) GetImageCopyData(image string) (*CopyData, error) {
|
|||
return nil, errors.Wrapf(err, "error locating image %q for importing settings", image)
|
||||
}
|
||||
|
||||
systemContext := common.GetSystemContext("")
|
||||
systemContext := common.GetSystemContext("", "")
|
||||
data, err := r.ImportCopyDataFromImage(systemContext, img.ID, "", "")
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error reading image")
|
||||
|
@ -435,7 +435,7 @@ func (r *Runtime) importCopyData(store storage.Store, container, signaturePolicy
|
|||
return nil, err
|
||||
}
|
||||
|
||||
systemContext := common.GetSystemContext(signaturePolicyPath)
|
||||
systemContext := common.GetSystemContext(signaturePolicyPath, "")
|
||||
|
||||
data, err := r.ImportCopyDataFromImage(systemContext, c.ImageID, container, c.ID)
|
||||
if err != nil {
|
||||
|
|
|
@ -103,7 +103,7 @@ func (r *Runtime) PullImage(imgName string, allTags bool, signaturePolicyPath st
|
|||
signaturePolicyPath = r.config.SignaturePolicyPath
|
||||
}
|
||||
|
||||
sc := common.GetSystemContext(signaturePolicyPath)
|
||||
sc := common.GetSystemContext(signaturePolicyPath, "")
|
||||
|
||||
srcRef, err := alltransports.ParseImageName(imgName)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue