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

New way to update ObjectACL or Header or Meta data #1010

Merged
merged 4 commits into from Jul 19, 2018
Merged

New way to update ObjectACL or Header or Meta data #1010

merged 4 commits into from Jul 19, 2018

Conversation

pierre-emmanuelJ
Copy link
Contributor

If you Put an object with nothing (no acl, meta...) and you want to update with ObjectACL it's not possible. And you don't want to use bucket policies to make it alternatively

this is an example to update a canned acl:

src := minio.NewSourceInfo("bucketName", "object", nil)

meta := map[string]string{
	"x-amz-acl": "public-read-write",
}

// Destination object
dst, err := minio.NewDestinationInfo("bucketName", "object", nil, meta)
if err != nil {
	return err
}

// Copy object call
err = minioClient.CopyObject(dst, src)
if err != nil {
	return err
}

this source code copy object on itself and can update ACL, userMetaData or Header

… StorageClassHeader

Signed-off-by: Pierre-Emmanuel Jacquier <pierre-emmanuel.jacquier@epitech.eu>
Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

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

LGTM would you mind adding a test as well ?

@pierre-emmanuelJ
Copy link
Contributor Author

Yes I will add a test and why not an example

@pierre-emmanuelJ
Copy link
Contributor Author

pierre-emmanuelJ commented Jul 19, 2018

Need an example in examples folder ?


for k := range r {

println(k)
Copy link

Choose a reason for hiding this comment

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

🦆

@nitisht nitisht requested a review from poornas July 19, 2018 08:13
Signed-off-by: Pierre-Emmanuel Jacquier <pierre-emmanuel.jacquier@epitech.eu>
Signed-off-by: Pierre-Emmanuel Jacquier <pierre-emmanuel.jacquier@epitech.eu>
Signed-off-by: Pierre-Emmanuel Jacquier <pierre-emmanuel.jacquier@epitech.eu>
Copy link
Contributor

@poornas poornas left a comment

Choose a reason for hiding this comment

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

LGTM

@kannappanr kannappanr merged commit fbddea6 into minio:master Jul 19, 2018
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.

None yet

5 participants