Skip to content

Commit

Permalink
Merge pull request #72 from Broadcom/AC-34142-terraform-app-icon-issue
Browse files Browse the repository at this point in the history
Ac 34142 terraform app icon issue
  • Loading branch information
yuvalstyrbrod authored Feb 14, 2024
2 parents 8e8c64d + acadb7a commit f182b07
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 40 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.9
1.1.10
6 changes: 1 addition & 5 deletions provider/data_source_aws_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ import (

const testAccResourceAwsIntegration = `
data "luminate_aws_integration" "my-aws_integration" {
integration_name = "terraform-acceptance"
integration_name = "terraform-test"
}
`

func TestAccLuminateDataSourceAwsIntegration(t *testing.T) {
// FIXME: https://jira.luminate.io/browse/AC-27711
t.Skip("Skipping testing see: https://jira.luminate.io/browse/AC-27711")
return

resourceName := "data.luminate_aws_integration.my-aws_integration"

resource.Test(t, resource.TestCase{
Expand Down
12 changes: 12 additions & 0 deletions provider/resource_application.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package provider

import (
"github.com/Broadcom/terraform-provider-luminate/service/dto"
"github.com/Broadcom/terraform-provider-luminate/utils"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
Expand Down Expand Up @@ -68,3 +69,14 @@ func CommonApplicationSchema() map[string]*schema.Schema {
},
}
}
func SetBaseApplicationFields(d *schema.ResourceData, application *dto.Application) {
d.Set("name", application.Name)
if application.Icon != "" {
d.Set("icon", application.Icon)
}
d.Set("visible", application.Visible)
d.Set("notification_enabled", application.NotificationsEnabled)
d.Set("external_address", application.ExternalAddress)
d.Set("subdomain", application.Subdomain)
d.Set("type", application.Type)
}
8 changes: 1 addition & 7 deletions provider/resource_rdp_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,11 @@ func resourceDeleteRDPApplication(ctx context.Context, d *schema.ResourceData, m
}

func setRDPApplicationFields(d *schema.ResourceData, application *dto.Application) {
d.Set("name", application.Name)
SetBaseApplicationFields(d, application)
d.Set("collection_id", application.CollectionID)
d.Set("sub_type", application.SubType)
d.Set("icon", application.Icon)
d.Set("type", application.Type)
d.Set("visible", application.Visible)
d.Set("site_id", application.SiteID)
d.Set("notification_enabled", application.NotificationsEnabled)
d.Set("internal_address", application.InternalAddress)
d.Set("external_address", application.ExternalAddress)
d.Set("subdomain", application.Subdomain)
d.Set("luminate_address", application.LuminateAddress)
}

Expand Down
7 changes: 1 addition & 6 deletions provider/resource_segment_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,8 @@ func extractSegmentApplication(d *schema.ResourceData) *dto.Application {
}

func setSegmentApplicationFields(d *schema.ResourceData, application *dto.Application, tenantBaseDomain string) {
d.Set("name", application.Name)
d.Set("icon", application.Icon)
d.Set("type", application.Type)
SetBaseApplicationFields(d, application)
d.Set("sub_type", application.SubType)
d.Set("visible", application.Visible)
d.Set("notification_enabled", application.NotificationsEnabled)
d.Set("external_address", application.ExternalAddress)
if application.SegmentSettings != nil {
d.Set("segment_settings", flattenSegmentSettings(application.SegmentSettings))
}
Expand Down
8 changes: 1 addition & 7 deletions provider/resource_ssh_gw_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,8 @@ func resourceDeleteSshGwApplication(ctx context.Context, d *schema.ResourceData,
}

func setSshGwApplicationFields(d *schema.ResourceData, application *dto.Application) {
d.Set("name", application.Name)
d.Set("icon", application.Icon)
d.Set("type", application.Type)
d.Set("visible", application.Visible)
d.Set("notification_enabled", application.NotificationsEnabled)
SetBaseApplicationFields(d, application)
d.Set("internal_address", application.InternalAddress)
d.Set("external_address", application.ExternalAddress)
d.Set("subdomain", application.Subdomain)
d.Set("luminate_address", application.LuminateAddress)
d.Set("segment_id", application.CloudIntegrationData.SegmentId)
d.Set("tags", application.CloudIntegrationData.Tags)
Expand Down
8 changes: 1 addition & 7 deletions provider/resource_tcp_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,8 @@ func extractTCPTargets(d *schema.ResourceData) []dto.TCPTarget {
}

func setTCPApplicationFields(d *schema.ResourceData, application *dto.Application) {
d.Set("name", application.Name)
SetBaseApplicationFields(d, application)
d.Set("collection_id", application.CollectionID)
d.Set("icon", application.Icon)
d.Set("type", application.Type)
d.Set("visible", application.Visible)
d.Set("notification_enabled", application.NotificationsEnabled)
d.Set("external_address", application.ExternalAddress)
d.Set("subdomain", application.Subdomain)
d.Set("luminate_address", application.LuminateAddress)
log.Printf("[DEBUG] Settings TCP Targets")

Expand Down
8 changes: 1 addition & 7 deletions provider/resource_web_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,9 @@ func extractWebApplication(d *schema.ResourceData) *dto.Application {
}

func setWebApplicationFields(d *schema.ResourceData, application *dto.Application, tenantBaseDomain string) {
d.Set("name", application.Name)
d.Set("icon", application.Icon)
d.Set("type", application.Type)
SetBaseApplicationFields(d, application)
d.Set("sub_type", application.SubType)
d.Set("visible", application.Visible)
d.Set("notification_enabled", application.NotificationsEnabled)
d.Set("internal_address", application.InternalAddress)
d.Set("external_address", application.ExternalAddress)
d.Set("subdomain", application.Subdomain)
d.Set("custom_external_address", application.CustomExternalAddress)
d.Set("collection_id", application.CollectionID)

Expand Down
1 change: 1 addition & 0 deletions provider/resource_web_application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ resource "luminate_web_application" "new-application" {
site_id = "${luminate_site.new-site.id}"
name = "tfAccApplication"
internal_address = "http://127.0.0.1:8080"
icon = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII="
}
`

Expand Down

0 comments on commit f182b07

Please sign in to comment.