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

Cannot delete Tags in Elemental MediaTailor Playback Configurations #4337

Open
3 tasks done
thatsddr opened this issue Mar 29, 2022 · 2 comments
Open
3 tasks done

Cannot delete Tags in Elemental MediaTailor Playback Configurations #4337

thatsddr opened this issue Mar 29, 2022 · 2 comments
Labels
bug This issue is a bug. p3 This is a minor priority issue workaround-available

Comments

@thatsddr
Copy link

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
I am using the SDK to update Elemental MediaTailor Playback Configuration using the PutPlaybackConfiguration method.
When I try to update the Tags field (type map[string]*string) of a Playback Configuration with another map that does not include some or all the tags previously included, the previous tags are not deleted.

Version of AWS SDK for Go?
v1.43.27

Version of Go (go version)?
Go1.17.6

To Reproduce (observed behavior)

  1. Initialize MediaTailor

    s, err := session.NewSession(&aws.Config{Region: aws.String("eu-central-1")})
    if err != nil {
    	return
    }
    client := mediatailor.New(s)
  2. Create a Playback Configuration with tags

    inputWithTags := mediatailor.PutPlaybackConfigurationInput{
    		AdDecisionServerUrl:   aws.String("https://example.org/ads"),
    		Name:                  aws.String("example"),
    		VideoContentSourceUrl: aws.String("https://example.org/"),
    		Tags:                  map[string]*string{
    		    "tag1": aws.String("value"), 
    		    "tag2": aws.String("another value"),
    		},
    	}
    _, err = client.PutPlaybackConfiguration(&inputWithTags)
  3. Run aws mediatailor get-playback-configuration --name="example" and verify that Tags is equal to:

    "Tags": {
        "tag1": "value",
        "tag2": "another value"
    },
  4. Update the Tags value to an empty map

    inputWithoutTags := mediatailor.PutPlaybackConfigurationInput{
    	AdDecisionServerUrl:   aws.String("https://example.org/ads"),
    	Name:                  aws.String("example"),
    	VideoContentSourceUrl: aws.String("https://example.org/"),
    	Tags:                  aws.StringMap(map[string]string{}),
    }
    _, err = client.PutPlaybackConfiguration(&inputWithoutTags)
  5. Run aws mediatailor get-playback-configuration --name="example" and verify that Tags is still equal to:

    "Tags": {
        "tag1": "value",
        "tag2": "another value"
    },

Expected behavior
After updating the Tags field with an empty map, its value should be equal to:

    "Tags": {}
@thatsddr thatsddr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 29, 2022
@thatsddr
Copy link
Author

For everyone else encountering the same problem, I am using the UntagResource method as a workaround.

I manually check for differences in the tags and create a list of values that have to be removed, then I call both the UntagResource and PutPlaybackConfiguration methods to edit the tags and everything else respectively.

@vudh1 vudh1 self-assigned this Apr 15, 2022
@vudh1 vudh1 added workaround-available and removed needs-triage This issue or PR still needs to be triaged. labels Jun 1, 2022
@vudh1
Copy link
Contributor

vudh1 commented Jun 6, 2022

Hi, I have reproduced this and seems like when the tags argument is empty, it will be ignored. I will run some more tests to see how other SDKs behavior with this and update again.

@vudh1 vudh1 removed their assignment Aug 25, 2022
@RanVaknin RanVaknin added the p3 This is a minor priority issue label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue workaround-available
Projects
None yet
Development

No branches or pull requests

3 participants