problem CreateDomainRecord with linodego

I'm trying to create a new A record in a domain that linode is hosting. The code is in go and using linodego. When I call CreateDomainRecord(), I get back the following error "[tag] tag is not valid". The tag I'm using is eezhee and it has already been created with a call to CreateTag. Does anyone have an idea why I'm getting this error?

recCreateOpts := linodego.DomainRecordCreateOptions{
            Type: linodego.RecordTypeA,
            Name: "www",
            Target: "127.0.0.1",
        }
recCreateOpts.Tag = strCopy("testTag") // can't assign a constant

        newRecord, err := m.api.CreateDomainRecord(context.Background(), checkDomain.ID, recCreateOpts)
if err != nil {
    return err
}

3 Replies

If I call ListTags, it returns my tag so I'm sure that exists before I try and add the A record to the domain.

I'm debugging into the linodego source and here is the JSON that is sent as part of the API call.

"{"type":"A","name":"www","target":"127.0.0.1","tag":"eezhee"}"

I'm not sure if it matters but the tag I'm trying to add to a domain record is not attached to the domain. This is because the domain is shared across multiple projects and the tag is project specific.

The goal of tagging the A record is that a tool I'm creating will know which projects each A record belongs to.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct