File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ func bibCmdBuild(cmd *cobra.Command, args []string) error {
282282 progressType , _ := cmd .Flags ().GetString ("progress" )
283283
284284 logrus .Debug ("Validating environment" )
285- if err := setup .Validate (targetArch ); err != nil {
285+ if err := setup .Validate (targetArch , false ); err != nil {
286286 return fmt .Errorf ("cannot validate the setup: %w" , err )
287287 }
288288 logrus .Debug ("Ensuring environment setup" )
Original file line number Diff line number Diff line change @@ -82,12 +82,12 @@ func EnsureEnvironment(storePath string, inVm bool) error {
8282
8383// Validate checks that the environment is supported (e.g. caller set up the
8484// container correctly)
85- func Validate (targetArch string ) error {
85+ func Validate (targetArch string , inVm bool ) error {
8686 isRootless , err := podmanutil .IsRootless ()
8787 if err != nil {
8888 return fmt .Errorf ("checking rootless: %w" , err )
8989 }
90- if isRootless {
90+ if isRootless && ! inVm {
9191 return fmt .Errorf ("this command must be run in rootful (not rootless) podman" )
9292 }
9393
@@ -97,7 +97,7 @@ func Validate(targetArch string) error {
9797 if err := unix .Statfs ("/sys" , & stvfsbuf ); err != nil {
9898 return fmt .Errorf ("failed to stat /sys: %w" , err )
9999 }
100- if (stvfsbuf .Flags & unix .ST_RDONLY ) > 0 {
100+ if ! inVm && (stvfsbuf .Flags & unix .ST_RDONLY ) > 0 {
101101 return fmt .Errorf ("this command requires a privileged container" )
102102 }
103103
You can’t perform that action at this time.
0 commit comments