Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

stage1: generate empty vol if a required one is not provided #1753

Merged
merged 4 commits into from Nov 24, 2015

Conversation

iaguis
Copy link
Member

@iaguis iaguis commented Nov 16, 2015

If there is a mount point in the Image Manifest but the user didn't
provide a matching volume, we create an implicity empty volume.

We warn the user because the empty volume will be deleted when the pod
gets garbage-collected.

Fixes #1480
Closes #1772

@iaguis
Copy link
Member Author

iaguis commented Nov 16, 2015

The warning is not very visible and it can be easily be confused with the app's output:

> sudo rkt --insecure-skip-verify run --interactive ~/temp/rkt/redis-latest.aci
rkt: using image from file /home/iaguis/work/coreos/go/src/github.com/coreos/rkt/build-rkt/bin/stage1-kvm.aci
rkt: using image from file /home/iaguis/temp/rkt/redis-latest.aci
rkt: warning: no volume specified for mount point "volume-data", implicitly creating an "empty" volume. This volume will be removed when the pod gets garbage-collected.
77:C 16 Nov 16:20:35.663 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

Maybe we should think about using a color library like https://github.com/fatih/color for warnings?

@iaguis
Copy link
Member Author

iaguis commented Nov 17, 2015

Semaphore fails because we were relying on the fact that coreos.com/etcd:v2.1.2 doesn't really run because it has a mountpoint and we don't specify a volume.

Now that an implicit empty volume is generated, etcd keeps running. This interrupts the test run and eventually it times out.

@iaguis
Copy link
Member Author

iaguis commented Nov 17, 2015

Fixed the test.

@jonboulle
Copy link
Contributor

@robszumski UX check?

@robszumski
Copy link
Contributor

I think this is the right move. A user wasn't very concerned with the volume since they didn't use it, hence the data getting GC'd isn't a big deal.

We need to add some docs for this, at least just updating this comment:

Note that any volumes that are specified but do not have a matching mount point will be silently ignored.

(from https://coreos.com/rkt/docs/latest/subcommands/run.html)

@iaguis
Copy link
Member Author

iaguis commented Nov 23, 2015

We need to add some docs for this, at least just updating this comment:

Note that any volumes that are specified but do not have a matching mount point will be silently ignored.

This is still the case. If you specify a volume but there's no matching mount point (or --mount flag), it will get ignored.

I'll clarify that and explain implicit empty volumes in the run docs.

"You can inspect the volumes with:\n\t%v\n"+
"App %q requires the following volumes:\n\t%v",
mp.Name, mp.Path, appName, catCmd, appName, volumeCmd)
fmt.Fprintf(os.Stderr, "rkt: warning: no volume specified for mount point %q, implicitly creating an \"empty\" volume. This volume will be removed when the pod gets garbage-collected.\n", mp.Name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't "when the pod is garbage-collected" sound better?

@krnowak
Copy link
Collaborator

krnowak commented Nov 24, 2015

Small nit, otherwise LFAD. When merged, could you create an issue about warnings being barely visible (with a suggestion of using some colored output for them)? Thanks.

@krnowak
Copy link
Collaborator

krnowak commented Nov 24, 2015

Oh, and close #1772 please, when you merge it.

If there is a mount point in the Image Manifest but the user didn't
provide a matching volume, we create an implicity empty volume.

We warn the user because the empty volume will be deleted when the pod
gets garbage-collected.
We now generate an implicit empty volume if a mount point is specified
in the image but no volume is passed to rkt. Some test cases in
TestFetch were relying on the fact that rkt doesn't actually run these
images.

Fix the test by adding an `--exec /dev/null` to make the images not run.
Also, clarify that empty volumes are removed when the pod is garbage
collected.
@iaguis
Copy link
Member Author

iaguis commented Nov 24, 2015

When merged, could you create an issue about warnings being barely visible (with a suggestion of using some colored output for them)? Thanks.

#1787

iaguis added a commit that referenced this pull request Nov 24, 2015
stage1: generate empty vol if a required one is not provided
@iaguis iaguis merged commit bf1d807 into rkt:master Nov 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants