@ -40,6 +40,7 @@ An ImageRepository object specifies an image repository to scan.`,
type imageRepoFlags struct {
type imageRepoFlags struct {
image string
image string
secretRef string
secretRef string
certSecretRef string
timeout time . Duration
timeout time . Duration
}
}
@ -49,6 +50,7 @@ func init() {
flags := createImageRepositoryCmd . Flags ( )
flags := createImageRepositoryCmd . Flags ( )
flags . StringVar ( & imageRepoArgs . image , "image" , "" , "the image repository to scan; e.g., library/alpine" )
flags . StringVar ( & imageRepoArgs . image , "image" , "" , "the image repository to scan; e.g., library/alpine" )
flags . StringVar ( & imageRepoArgs . secretRef , "secret-ref" , "" , "the name of a docker-registry secret to use for credentials" )
flags . StringVar ( & imageRepoArgs . secretRef , "secret-ref" , "" , "the name of a docker-registry secret to use for credentials" )
flags . StringVar ( & imageRepoArgs . certSecretRef , "cert-ref" , "" , "the name of a secret to use for TLS certificates" )
// NB there is already a --timeout in the global flags, for
// NB there is already a --timeout in the global flags, for
// controlling timeout on operations while e.g., creating objects.
// controlling timeout on operations while e.g., creating objects.
flags . DurationVar ( & imageRepoArgs . timeout , "scan-timeout" , 0 , "a timeout for scanning; this defaults to the interval if not set" )
flags . DurationVar ( & imageRepoArgs . timeout , "scan-timeout" , 0 , "a timeout for scanning; this defaults to the interval if not set" )
@ -94,6 +96,11 @@ func createImageRepositoryRun(cmd *cobra.Command, args []string) error {
Name : imageRepoArgs . secretRef ,
Name : imageRepoArgs . secretRef ,
}
}
}
}
if imageRepoArgs . certSecretRef != "" {
repo . Spec . CertSecretRef = & meta . LocalObjectReference {
Name : imageRepoArgs . certSecretRef ,
}
}
if createArgs . export {
if createArgs . export {
return printExport ( exportImageRepository ( & repo ) )
return printExport ( exportImageRepository ( & repo ) )