Skip to content

Commit

Permalink
Use AzureLogAccessKeysParams as a pointer instead of a nested struct
Browse files Browse the repository at this point in the history
Signed-off-by: Ben <[email protected]>
(cherry picked from commit 8b70af6)
  • Loading branch information
Neon-White authored and nimrod-becker committed Jul 20, 2023
1 parent 8f7116c commit 47e9555
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion pkg/backingstore/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ func (r *Reconciler) MakeExternalConnectionParams() (*nb.AddExternalConnectionPa
logsAnalyticsWorkspaceID := r.Secret.StringData["LogsAnalyticsWorkspaceID"]

if tenantID != "" && appID != "" && appSecret != "" && logsAnalyticsWorkspaceID != "" {
conn.AzureLogAccessKeys = nb.AzureLogAccessKeysParams{
conn.AzureLogAccessKeys = &nb.AzureLogAccessKeysParams{
AzureTenantID: tenantID,
AzureClientID: appID,
AzureClientSecret: appSecret,
Expand Down
2 changes: 1 addition & 1 deletion pkg/namespacestore/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ func (r *Reconciler) MakeExternalConnectionParams() (*nb.AddExternalConnectionPa
logsAnalyticsWorkspaceID := r.Secret.StringData["LogsAnalyticsWorkspaceID"]

if tenantID != "" && appID != "" && appSecret != "" && logsAnalyticsWorkspaceID != "" {
conn.AzureLogAccessKeys = nb.AzureLogAccessKeysParams{
conn.AzureLogAccessKeys = &nb.AzureLogAccessKeysParams{
AzureTenantID: tenantID,
AzureClientID: appID,
AzureClientSecret: appSecret,
Expand Down
44 changes: 22 additions & 22 deletions pkg/nb/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,28 +681,28 @@ type AzureLogAccessKeysParams struct {

// AddExternalConnectionParams is the params of account_api.add_external_connection()
type AddExternalConnectionParams struct {
Name string `json:"name"`
EndpointType EndpointType `json:"endpoint_type"`
Endpoint string `json:"endpoint"`
Identity string `json:"identity"`
Secret string `json:"secret"`
AuthMethod CloudAuthMethod `json:"auth_method,omitempty"`
AWSSTSARN string `json:"aws_sts_arn,omitempty"`
Region string `json:"region,omitempty"`
AzureLogAccessKeys AzureLogAccessKeysParams `json:"azure_log_access_keys,omitempty"`
Name string `json:"name"`
EndpointType EndpointType `json:"endpoint_type"`
Endpoint string `json:"endpoint"`
Identity string `json:"identity"`
Secret string `json:"secret"`
AuthMethod CloudAuthMethod `json:"auth_method,omitempty"`
AWSSTSARN string `json:"aws_sts_arn,omitempty"`
Region string `json:"region,omitempty"`
AzureLogAccessKeys *AzureLogAccessKeysParams `json:"azure_log_access_keys,omitempty"`
}

// CheckExternalConnectionParams is the params of account_api.check_external_connection()
type CheckExternalConnectionParams struct {
Name string `json:"name"`
EndpointType EndpointType `json:"endpoint_type"`
Endpoint string `json:"endpoint"`
Identity string `json:"identity"`
Secret string `json:"secret"`
AuthMethod CloudAuthMethod `json:"auth_method,omitempty"`
AWSSTSARN string `json:"aws_sts_arn,omitempty"`
IgnoreNameAlreadyExist bool `json:"ignore_name_already_exist,omitempty"`
AzureLogAccessKeys AzureLogAccessKeysParams `json:"azure_log_access_keys,omitempty"`
Name string `json:"name"`
EndpointType EndpointType `json:"endpoint_type"`
Endpoint string `json:"endpoint"`
Identity string `json:"identity"`
Secret string `json:"secret"`
AuthMethod CloudAuthMethod `json:"auth_method,omitempty"`
AWSSTSARN string `json:"aws_sts_arn,omitempty"`
IgnoreNameAlreadyExist bool `json:"ignore_name_already_exist,omitempty"`
AzureLogAccessKeys *AzureLogAccessKeysParams `json:"azure_log_access_keys,omitempty"`
}

// CheckExternalConnectionReply is the reply of account_api.check_external_connection()
Expand All @@ -716,10 +716,10 @@ type CheckExternalConnectionReply struct {

// UpdateExternalConnectionParams is the params of account_api.update_external_connection()
type UpdateExternalConnectionParams struct {
Name string `json:"name"`
Identity string `json:"identity"`
Secret string `json:"secret"`
AzureLogAccessKeys AzureLogAccessKeysParams `json:"azure_log_access_keys,omitempty"`
Name string `json:"name"`
Identity string `json:"identity"`
Secret string `json:"secret"`
AzureLogAccessKeys *AzureLogAccessKeysParams `json:"azure_log_access_keys,omitempty"`
}

// DeleteExternalConnectionParams is the params of account_api.delete_external_connection()
Expand Down

0 comments on commit 47e9555

Please sign in to comment.