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

New Resource: azurerm_site_recovery_hyperv_replicated_vm #20838

Closed

Conversation

ziyeqf
Copy link
Contributor

@ziyeqf ziyeqf commented Mar 8, 2023

test

terraform-provider-azurerm ❯ TF_ACC=1 go test -v ./internal/services/recoveryservices -run=TestAccSiteRecoveryHyperVReplicatedVM_basic -timeout=600m
=== RUN   TestAccSiteRecoveryHyperVReplicatedVM_basic
=== PAUSE TestAccSiteRecoveryHyperVReplicatedVM_basic
=== CONT  TestAccSiteRecoveryHyperVReplicatedVM_basic
--- PASS: TestAccSiteRecoveryHyperVReplicatedVM_basic (3469.97s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices      3470.022s
terraform-provider-azurerm ❯  TF_ACC=1 go test -v ./internal/services/recoveryservices -run=TestAccSiteRecoveryHyperVReplicatedVM_complete -timeout=600m
=== RUN   TestAccSiteRecoveryHyperVReplicatedVM_complete
=== PAUSE TestAccSiteRecoveryHyperVReplicatedVM_complete
=== CONT  TestAccSiteRecoveryHyperVReplicatedVM_complete
--- PASS: TestAccSiteRecoveryHyperVReplicatedVM_complete (3294.71s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices      3294.756s

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @ziyeqf

Taking a look through here there appears to be an issue which needs to be fixed in hashicorp/go-azure-sdk, rather than necessarily needing fixing in the Swagger - can you please open an issue there so that we can dig into this?

Thanks!

Comment on lines +5 to +6
// TODO 4.0: check if this is could be removed
// workaround for https://github.com/Azure/azure-rest-api-specs/issues/22947
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue on hashicorp/go-azure-sdk to track this? We can likely workaround this there

package azuresdkhacks

type DisableProtectionInput struct {
Properties EmptyInput `json:"properties"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the model here, since ReplicationProviderInput is a Discriminated Type that's Optional, as such this:

package main

import (
	"encoding/json"
	"log"

	"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicessiterecovery/2022-10-01/replicationprotecteditems"
)

func main() {
	foo := replicationprotecteditems.DisableProtectionInput{}
	out, err := json.Marshal(foo)
	if err != nil {
		log.Fatalf("error: %+v", err)
	}
	log.Printf("JSON: %s", out)
}

Should output:

JSON: {"properties":{}}

But actually outputs:

JSON: {"properties":{"replicationProviderInput":null}}

As such this looks to be something we can workaround in hashicorp/go-azure-sdk - can you open an issue about this, with the full HTTP Requests/Responses so that we can diagnose this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to confirm if we need to wait for the go-azure-sdk workaround to merge this PR?

Signed-off-by: ziyeqf <[email protected]>
@ziyeqf ziyeqf force-pushed the tengzh/recovery/hyperv/replicated_vm branch from 097056e to c96e43b Compare May 30, 2023 06:10
@tombuildsstuff tombuildsstuff added the upstream/pandora This issue/PR has a dependency on an issue in `github.com/hashicorp/pandora` label Dec 7, 2023
@tombuildsstuff tombuildsstuff added the upstream/go-azure-sdk This issue/PR requires a fix in `hashicorp/go-azure-sdk` label Dec 7, 2023
@tombuildsstuff
Copy link
Contributor

hey @ziyeqf

Apologies for the delayed response here.

Taking a look through since this continues to be blocked by this issue in hashicorp/pandora rather than leaving this open I'm going to close this PR for the moment - but when the upstream issue is resolved since this is cross-linked we should be able to take another look into this one.

Thanks!

Copy link

github-actions bot commented May 4, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies documentation service/recovery-services size/XL upstream/go-azure-sdk This issue/PR requires a fix in `hashicorp/go-azure-sdk` upstream/pandora This issue/PR has a dependency on an issue in `github.com/hashicorp/pandora`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants