Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commands: Add ctdb-check-ok #30

Merged
merged 3 commits into from
Feb 11, 2022

Conversation

spuiuk
Copy link
Collaborator

@spuiuk spuiuk commented Feb 9, 2022

The return value indicates the status of the ctdb service on the node.
It is expected to be used as the readiness probe by kubernetes.

Signed-off-by: Sachin Prabhu <[email protected]>

@spuiuk
Copy link
Collaborator Author

spuiuk commented Feb 9, 2022

Test:

Ensure ctdb status is ok
[root@smbshare3-0 /]# ctdb nodestatus
pnn:0 10.244.1.15 OK (THIS NODE)

Run the new command and check return condition.
[root@smbshare3-0 /]# samba-container ctdb-check-ok; echo $?
pnn:0 10.244.1.15 OK (THIS NODE)
0

Now disable and test the new command again with return condition.
[root@smbshare3-0 /]# ctdb disable
[root@smbshare3-0 /]# ctdb nodestatus
pnn:0 10.244.1.15 DISABLED (THIS NODE)
[root@smbshare3-0 /]# samba-container ctdb-check-ok; echo $?
pnn:0 10.244.1.15 DISABLED (THIS NODE)
4

@spuiuk spuiuk marked this pull request as draft February 9, 2022 00:20
@spuiuk spuiuk force-pushed the ctdb_check branch 2 times, most recently from 40106f7 to e3e5711 Compare February 9, 2022 17:45
@spuiuk spuiuk marked this pull request as ready for review February 9, 2022 17:46
Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this, a few items inline:

sambacc/commands/ctdb.py Outdated Show resolved Hide resolved
sambacc/ctdb.py Show resolved Hide resolved
tests/test_ctdb.py Outdated Show resolved Hide resolved
sambacc/commands/ctdb.py Outdated Show resolved Hide resolved
The return value indicates the status of the ctdb service on the node.
It is expected to be used as the readiness probe by kubernetes.

Signed-off-by: Sachin Prabhu <[email protected]>
Mode values to chmod are usually in octal.

Signed-off-by: Sachin Prabhu <[email protected]>
Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for finding and fixing the existing chmod issue!

@phlogistonjohn phlogistonjohn merged commit ce29f48 into samba-in-kubernetes:master Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants