Skip to content

Commit

Permalink
changed Port field to Optional (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishekism9450 authored Jun 14, 2023
1 parent 8b1dd17 commit 9ff598f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions client/karbon/karbon_private_registry_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ package karbon
type PrivateRegistryListResponse []PrivateRegistryResponse

type PrivateRegistryResponse struct {
Name *string `json:"name" mapstructure:"name, omitempty"`
Endpoint *string `json:"endpoint" mapstructure:"endpoint, omitempty"`
UUID *string `json:"uuid" mapstructure:"uuid, omitempty"`
Name *string `json:"name" mapstructure:"name,omitempty"`
Endpoint *string `json:"endpoint" mapstructure:"endpoint,omitempty"`
UUID *string `json:"uuid" mapstructure:"uuid,omitempty"`
}

type PrivateRegistryIntentInput struct {
Name *string `json:"name" mapstructure:"name, omitempty"`
Cert *string `json:"cert" mapstructure:"cert, omitempty"`
URL *string `json:"url" mapstructure:"url, omitempty"`
Port *int64 `json:"port" mapstructure:"port, omitempty"`
Username *string `json:"username" mapstructure:"username, omitempty"`
Password *string `json:"password" mapstructure:"password, omitempty"`
Name *string `json:"name" mapstructure:"name,omitempty"`
Cert *string `json:"cert" mapstructure:"cert,omitempty"`
URL *string `json:"url" mapstructure:"url,omitempty"`
Port *int64 `json:"port,omitempty" mapstructure:"port,omitempty"`
Username *string `json:"username,omitempty" mapstructure:"username,omitempty"`
Password *string `json:"password,omitempty" mapstructure:"password,omitempty"`
}

type PrivateRegistryOperationResponse struct {
RegistryName *string `json:"registry_name" mapstructure:"registry_name, omitempty"`
RegistryName *string `json:"registry_name" mapstructure:"registry_name,omitempty"`
}

type PrivateRegistryOperationIntentInput struct {
RegistryName *string `json:"registry_name" mapstructure:"registry_name, omitempty"`
RegistryName *string `json:"registry_name" mapstructure:"registry_name,omitempty"`
}
4 changes: 2 additions & 2 deletions nutanix/resource_nutanix_karbon_private_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func KarbonPrivateRegistryResourceMap() map[string]*schema.Schema {
},
"port": {
Type: schema.TypeInt,
Required: true,
Optional: true,
ValidateFunc: validation.IntAtLeast(1),
},
"endpoint": {
Expand Down Expand Up @@ -87,7 +87,7 @@ func resourceNutanixKarbonPrivateRegistryCreate(ctx context.Context, d *schema.R
} else {
return diag.Errorf("error occurred during private registry creation: url must be set")
}
if port, ok := d.GetOk("port"); ok {
if port, ok := d.GetOk("port"); ok && port.(int) > 0 {
p := int64(port.(int))
karbonPrivateRegistry.Port = &p
}
Expand Down

0 comments on commit 9ff598f

Please sign in to comment.