ctrox / csi-s3

A Container Storage Interface for S3
Apache License 2.0
758 stars 167 forks source link

Clear .passwd-s3fs before write new AccessKey & SecretKey #52

Open joshuafc opened 3 years ago

joshuafc commented 3 years ago

Two Storage Class, with different s3 cluster, so different AccessKey & SecretKey. The second s3 cluster cannot mount. Because of .passwd-s3fs is not cleared before write it's new AccessKey & SecretKey. for examble: *:****xxxx *is new AccessKey & SecretKey. And xxxx is part of old AccessKey & SecretKey.

Use os.O_TRUNC to clear .passwd-s3fs before write new AccessKey & SecretKey.