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

lib/app: check in upper/ if the pod uses overlay #3791

Merged
merged 3 commits into from
Sep 13, 2017

Conversation

iaguis
Copy link
Member

@iaguis iaguis commented Sep 8, 2017

Getting creation/start time and status of applications will fail for
pods using overlay if stage1 was unmounted (e.g. when rebooting).

This commit checks in the upper/ directory if the pod uses overlay.

Getting creation/start time and status of applications will fail for
pods using overlay if stage1 was unmounted (e.g. when rebooting).

This commit checks in the `upper/` directory if the pod uses overlay.
lib/app.go Outdated
appStatusesPath := filepath.Join(upper, "/rkt/status")

createdFile = filepath.Join(appStatusesPath, fmt.Sprintf("%s-created", app.Name))
startedFile = filepath.Join(appStatusesPath, fmt.Sprintf("%s-started", app.Name))
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer if it was:

	createdFile := common.AppCreatedPathOverlay(pod, app.Name)
	startedFile := common.AppStartedPathOverlay(pod, app.Name)
	appStatusFile := common.AppStatusPathOverlay(pod, app.Name)

And add those 3 new functions with a "Overlay" suffix in common/common.go.

Because at the moment, the way to build the flag filename (e.g. "%s-created") is spread over different Golang packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

I implemented a slightly different thing since we already had some logic for dealing with overlay in pods.go.

@iaguis iaguis requested a review from alban September 12, 2017 13:39
Copy link
Member

@alban alban left a comment

Choose a reason for hiding this comment

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

Confusing that there are two functions with the same name Stage1RootfsPath() and they have different behaviour:

common/common.go:101:func Stage1RootfsPath(root string) string {
pkg/pod/pods.go:1126:func (p *Pod) Stage1RootfsPath() (string, error) {

But it's unrelated to this PR.

LGTM.

@alban alban merged commit 517d5bc into rkt:master Sep 13, 2017
@iaguis iaguis deleted the iaguis/overlay-app-status branch January 9, 2018 12:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants