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

[feature] Addition of exclude prefixes when adding versioning to buckets #1401

Open
VerdantForge opened this issue Feb 22, 2024 · 3 comments

Comments

@VerdantForge
Copy link
Contributor

I'm currently adding versioning to some buckets used for job asset storage. These have some temporary files which I don't want to be versionned.
The mc cli tool allows us to specify --exclude-prefixes when setting up versionning as per the docs

This results in the following config

{
 "Op": "info",
 "status": "success",
 "url": "local/my-bucket",
 "versioning": {
  "status": "Enabled",
  "MFADelete": "",
  "ExcludedPrefixes": [
   "prefix1, prefix2"
  ]
 }
}

The python clients VersioningConfig class however only seems to support status and mfa_delete.

Due to this I'm forced to launch mc in a shell from python to complete this configuration step.

Would it be possible to add this option to VersionningConfig?

@balamurugana
Copy link
Member

@VerdantForge This is minio server specific extension

// BucketVersioningConfiguration is the versioning configuration structure
type BucketVersioningConfiguration struct {
	XMLName   xml.Name `xml:"VersioningConfiguration"`
	Status    string   `xml:"Status"`
	MFADelete string   `xml:"MfaDelete,omitempty"`
	// MinIO extension - allows selective, prefix-level versioning exclusion.
	// Requires versioning to be enabled
	ExcludedPrefixes []ExcludedPrefix `xml:",omitempty"`
	ExcludeFolders   bool             `xml:",omitempty"`
}

Feel free to send a PR

@VerdantForge
Copy link
Contributor Author

Aight working on the PR now

@VerdantForge
Copy link
Contributor Author

@VerdantForge This is minio server specific extension

// BucketVersioningConfiguration is the versioning configuration structure
type BucketVersioningConfiguration struct {
	XMLName   xml.Name `xml:"VersioningConfiguration"`
	Status    string   `xml:"Status"`
	MFADelete string   `xml:"MfaDelete,omitempty"`
	// MinIO extension - allows selective, prefix-level versioning exclusion.
	// Requires versioning to be enabled
	ExcludedPrefixes []ExcludedPrefix `xml:",omitempty"`
	ExcludeFolders   bool             `xml:",omitempty"`
}

Feel free to send a PR

PR added #1402

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

No branches or pull requests

2 participants