Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Create missing directories #274

Merged
merged 1 commit into from
Aug 27, 2021
Merged

Create missing directories #274

merged 1 commit into from
Aug 27, 2021

Conversation

siegfriedweber
Copy link
Member

@siegfriedweber siegfriedweber commented Aug 27, 2021

Description

The following directories are created if they do not exist:

  • config
  • data
  • log
  • package
  • directory of the certificate file if the file does not exist
  • directory of the key file if the file does not exist

Log output if a directory was created:

[2021-08-27T07:24:53Z INFO  stackable_agent] Directory [data] created which is specified in the configuration option [data-directory].

Log output if an IO error occurred:

[2021-08-27T07:28:51Z ERROR stackable_agent] Could not create the directory [/etc/passwd/data] which is specified in the configuration option [data-directory]. Not a directory (os error 20)
[2021-08-27T07:29:23Z ERROR stackable_agent] Could not create the directory [/lib/data] which is specified in the configuration option [data-directory]. Permission denied (os error 13)

This change is not tested with unit tests because it is mainly about IO, so it does not make sense to try to mock the IO. Furthermore unit tests should not modify the filesystem. It is also not possible to test this change with the integration tests because they only communicate with the agent via the Kubernetes API. So they cannot manipulate the file system on the node and cannot restart the agent.

Closes #105

Review Checklist

  • Code contains useful comments
  • (Integration-)Test cases added (or not applicable)
  • Documentation added (or not applicable)
  • Changelog updated (or not applicable)

The following directories are created if they do not exist:
* config
* data
* log
* package
* directory of the certificate file if the file does not exist
* directory of the key file if the file does not exist
@siegfriedweber siegfriedweber requested a review from a team August 27, 2021 12:45
@siegfriedweber siegfriedweber self-assigned this Aug 27, 2021
Copy link
Member

@maltesander maltesander left a comment

Choose a reason for hiding this comment

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

LGTM.

@siegfriedweber siegfriedweber merged commit 4966ef7 into main Aug 27, 2021
@siegfriedweber siegfriedweber deleted the create_dirs branch August 27, 2021 14:00
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.

Create missing directories required by the agent
2 participants