Skip to content

Conversation

@spuiuk
Copy link
Collaborator

@spuiuk spuiuk commented Dec 20, 2021

Tested by building the operator image, pushing it to a remote repo and then deploying that remote repo. Confirmed the change by checking the operator logs for the commit id. Once the smbshare was created, I did a kubectl exec into it and checked the generated smb.conf file using the net conf list command

This set of patches contains two changes.

  1. Remove mention of No Printing and
  2. Add the fileid plugin based on a global conf set. This can be replaced by intelligence to check for vfs_fileid requirements in the future.

We shouldn't have any scenario where we could enable printing on the
operator.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
No = "no"

// AddVFSFileid is used to chec if we add vfs_fileid to the config
AddVFSFileid = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't seem like the right approach to me, why is this a global rather than say, an argument to NewGlobals?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've added a new commit which changes the way we pass the configuration options. Let me know if this is what you had in mind. Not squashing patches until they are acceptable.

@spuiuk spuiuk marked this pull request as draft January 4, 2022 23:27
@spuiuk
Copy link
Collaborator Author

spuiuk commented Jan 4, 2022

Switched to Draft PR.

)

// Constructor for the OperatorOptions struct
func NewOperatorOptions() *OperatorOptions {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is more of a taste thing I think but I'd drop this function and simply not provide a "constructor". I'd also make it a pass-by-value (not a pointer). If you want me to elaborate on why please ask, but I'm lazy (and still on vacation ;-)) so I'm not going to elaborate yet. However, it's minor and I could easily live with it as-is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hah. Sorry, I didn't realise that you would be looking at patches today. I have just posted another one.
Please excuse my changes as I navigate go lang. Let's schedule a 1-1 tomorrow to go through the code.

@spuiuk spuiuk force-pushed the fileid branch 3 times, most recently from 39b3e4d to 3d5db38 Compare January 7, 2022 21:15
Provide an option to add vfs_fileid to the smb.conf Globals section.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
@spuiuk
Copy link
Collaborator Author

spuiuk commented Jan 7, 2022

John,
I've made most of the changes we discussed earlier except for the use of a boolean variable in the GlobalOptions. This is a simple check and adding a slice or enum unnecessarily complicates the code and increases the chances of regression. So using the YAGNI principal, I'll stick to boolean for now until we have a requirement for additional modules.

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.

On first glance it looks OK, but I'll give it a more thorough reading during the work week.
Also @raghavendra-talur PTAL.

@spuiuk spuiuk marked this pull request as ready for review January 10, 2022 11:00
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.

@phlogistonjohn phlogistonjohn merged commit 857ae7c into samba-in-kubernetes:master Jan 14, 2022
@spuiuk spuiuk deleted the fileid branch March 13, 2022 16:58
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