Ignore stale notification queues in notification.xml (#7673)

Allow renaming/editing a notification config. By replying with 
a successful GetBucketNotification response, without checking 
for any missing config ARN in targetList.

Fixes #7650
This commit is contained in:
Praveen raj Mani
2019-07-30 14:19:06 +05:30
committed by Nitish Tiwari
parent 8d47ef503c
commit 63e0a81760
2 changed files with 33 additions and 17 deletions

View File

@@ -276,15 +276,20 @@ func (conf *Config) ToRulesMap() RulesMap {
// ParseConfig - parses data in reader to notification configuration.
func ParseConfig(reader io.Reader, region string, targetList *TargetList) (*Config, error) {
var config Config
if err := xml.NewDecoder(reader).Decode(&config); err != nil {
var err error
if err = xml.NewDecoder(reader).Decode(&config); err != nil {
return nil, err
}
if err := config.Validate(region, targetList); err != nil {
return nil, err
}
err = config.Validate(region, targetList)
config.SetRegion(region)
return &config, nil
// If xml namespace is empty, set a default value before returning.
if config.XMLNS == "" {
config.XMLNS = "http://s3.amazonaws.com/doc/2006-03-01/"
}
return &config, err
}