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

resource/github_issue_label: add invididual user support #519

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions github/resource_github_issue_label.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ func resourceGithubIssueLabel() *schema.Resource {
// same function for two schema funcs.

func resourceGithubIssueLabelCreateOrUpdate(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client
orgName := meta.(*Owner).name
repoName := d.Get("repository").(string)
Expand Down Expand Up @@ -148,11 +143,6 @@ func resourceGithubIssueLabelCreateOrUpdate(d *schema.ResourceData, meta interfa
}

func resourceGithubIssueLabelRead(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client
repoName, name, err := parseTwoPartID(d.Id(), "repository", "name")
if err != nil {
Expand Down Expand Up @@ -194,11 +184,6 @@ func resourceGithubIssueLabelRead(d *schema.ResourceData, meta interface{}) erro
}

func resourceGithubIssueLabelDelete(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client

orgName := meta.(*Owner).name
Expand All @@ -207,7 +192,7 @@ func resourceGithubIssueLabelDelete(d *schema.ResourceData, meta interface{}) er
ctx := context.WithValue(context.Background(), ctxId, d.Id())

log.Printf("[DEBUG] Deleting label: %s (%s/%s)", name, orgName, repoName)
_, err = client.Issues.DeleteLabel(ctx,
_, err := client.Issues.DeleteLabel(ctx,
orgName, repoName, name)
return err
}
12 changes: 0 additions & 12 deletions github/resource_github_issue_label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import (
)

func TestAccGithubIssueLabel_basic(t *testing.T) {
if err := testAccCheckOrganization(); err != nil {
t.Skipf("Skipping because %s.", err.Error())
}

var label, updatedLabel github.Label

rn := "github_issue_label.test"
Expand Down Expand Up @@ -52,10 +48,6 @@ func TestAccGithubIssueLabel_basic(t *testing.T) {
}

func TestAccGithubIssueLabel_existingLabel(t *testing.T) {
if err := testAccCheckOrganization(); err != nil {
t.Skipf("Skipping because %s.", err.Error())
}

var label github.Label

rn := "github_issue_label.test"
Expand Down Expand Up @@ -84,10 +76,6 @@ func TestAccGithubIssueLabel_existingLabel(t *testing.T) {
}

func TestAccGithubIssueLabel_description(t *testing.T) {
if err := testAccCheckOrganization(); err != nil {
t.Skipf("Skipping because %s.", err.Error())
}

var label github.Label

rn := "github_issue_label.test"
Expand Down