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

allow ceph mon stored in secret so when mon changes, cephfs driver can get latest mons and override old ones #136

Merged
merged 3 commits into from
Jan 21, 2019

Conversation

rootfs
Copy link
Member

@rootfs rootfs commented Jan 18, 2019

@gman0 this is a step to make the driver robust to ceph config changes

…n get latest mons and override old ones

Signed-off-by: Huamin Chen <hchen@redhat.com>
Signed-off-by: Huamin Chen <hchen@redhat.com>
@@ -40,7 +42,9 @@ func validateNonEmptyField(field, fieldName string) error {

func (o *volumeOptions) validate() error {
if err := validateNonEmptyField(o.Monitors, "monitors"); err != nil {
return err
if err = validateNonEmptyField(o.MonValueFromSecret, "monValueFromSecret"); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if both monitors and monValueFromSecret are non-empty?

if err = extractOption(&opts.Monitors, "monitors", volOptions); err != nil {
if err = extractOption(&opts.MonValueFromSecret, "monValueFromSecret", volOptions); err != nil {
return nil, err
}
}

From the code, it's obvious that monitors would take precedence but the documentation doesn't mention that.

Copy link
Contributor

@gman0 gman0 Jan 18, 2019

Choose a reason for hiding this comment

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

So IMHO either:

  1. add a simple check that those two options can't be specified at the same time, or
  2. add a comment in the docs that in case both of them are supplied, monitors will take precedence over monValueFromSecret

Copy link
Member Author

Choose a reason for hiding this comment

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

good points, i updated it. Now when monitors are set in the secret, controller and node server favor monValueFromSecret.

The rationale is that monitors, once set in storage class, are immutable. When monitors changes in the ceph cluster, existing PVs are no longer usable. In such case, a mutable setting in secret can solve this problem.

…e set

Signed-off-by: Huamin Chen <hchen@redhat.com>
@rootfs rootfs merged commit be4c88f into ceph:csi-v1.0 Jan 21, 2019
wilmardo pushed a commit to wilmardo/ceph-csi that referenced this pull request Jul 29, 2019
allow ceph mon stored in secret so when mon changes, cephfs driver can get latest mons and override old ones
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