mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-25 15:39:37 -05:00
deps: upgrade Azure sdk (#887)
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
992e318c1c
commit
f4df4067bd
6
go.mod
6
go.mod
@ -44,9 +44,8 @@ require (
|
|||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights v1.0.0
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights v1.0.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2 v2.0.0
|
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.1.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1
|
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1
|
||||||
github.com/Azure/go-autorest/autorest/to v0.4.0
|
github.com/Azure/go-autorest/autorest/to v0.4.0
|
||||||
github.com/aws/aws-sdk-go-v2 v1.17.3
|
github.com/aws/aws-sdk-go-v2 v1.17.3
|
||||||
@ -117,8 +116,9 @@ require (
|
|||||||
cloud.google.com/go/iam v0.8.0 // indirect
|
cloud.google.com/go/iam v0.8.0 // indirect
|
||||||
cloud.google.com/go/longrunning v0.3.0 // indirect
|
cloud.google.com/go/longrunning v0.3.0 // indirect
|
||||||
code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c // indirect
|
code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c // indirect
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 // indirect
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 // indirect
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
||||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect
|
github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect
|
||||||
|
9
go.sum
9
go.sum
@ -92,8 +92,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 h1:sVW/AFBTGyJxDaMYlq0ct3jUX
|
|||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc=
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM=
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 h1:XUNQ4mw+zJmaA2KXzP9JlQiecy1SI+Eog7xVkPiqIbg=
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 h1:TOFrNxfjslms5nLLIMjW7N0+zSALX4KiGsptmpb16AA=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 h1:TOFrNxfjslms5nLLIMjW7N0+zSALX4KiGsptmpb16AA=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0/go.mod h1:EAyXOW1F6BTJPiK2pDvmnvxOHPxoTYWoqBeIlql+QhI=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0/go.mod h1:EAyXOW1F6BTJPiK2pDvmnvxOHPxoTYWoqBeIlql+QhI=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0 h1:82w8tzLcOwDP/Q35j/wEBPt0n0kVC3cjtPdD62G8UAk=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0 h1:82w8tzLcOwDP/Q35j/wEBPt0n0kVC3cjtPdD62G8UAk=
|
||||||
@ -102,15 +102,14 @@ github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 h1:Lg6BW0VPmCwcMl
|
|||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0/go.mod h1:9V2j0jn9jDEkCkv8w/bKTNppX/d0FVA1ud77xCIP4KA=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0/go.mod h1:9V2j0jn9jDEkCkv8w/bKTNppX/d0FVA1ud77xCIP4KA=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights v1.0.0 h1:BpGGvzarSyE7kQF1x1hptUcGmNzZEE3yYI+uqBSNRxk=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights v1.0.0 h1:BpGGvzarSyE7kQF1x1hptUcGmNzZEE3yYI+uqBSNRxk=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights v1.0.0/go.mod h1:1ijUM40peD7YK5MFEJja2wjjp4eimFNWv0NXoY3nsZM=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights v1.0.0/go.mod h1:1ijUM40peD7YK5MFEJja2wjjp4eimFNWv0NXoY3nsZM=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 h1:/Di3vB4sNeQ+7A8efjUVENvyB945Wruvstucqp7ZArg=
|
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2 v2.0.0 h1:xxe4naFUPYEW1W6C8yWrfFNmyZLnEbO+CsbsSF83wDo=
|
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2 v2.0.0/go.mod h1:aLFjumYDvv63tH1qnqkcmdjdZ6Sn+/viPv7H3jft0oY=
|
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v3 v3.0.1 h1:H3g2mkmu105ON0c/Gqx3Bm+bzoIijLom8LmV9Gjn7X0=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v3 v3.0.1 h1:H3g2mkmu105ON0c/Gqx3Bm+bzoIijLom8LmV9Gjn7X0=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0 h1:KepfQdVTTQl/UmAbRALdkUUUfcWfu8xRaqrQ03ZGwvM=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0 h1:KepfQdVTTQl/UmAbRALdkUUUfcWfu8xRaqrQ03ZGwvM=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0/go.mod h1:Q3u+T/qw3Kb1Wf3DFKiFwEZlyaAyPb4yBgWm9wq7yh8=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0/go.mod h1:Q3u+T/qw3Kb1Wf3DFKiFwEZlyaAyPb4yBgWm9wq7yh8=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 h1:QM6sE5k2ZT/vI5BEe0r7mqjsUSnhVBFbOsVkEuaEfiA=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 h1:QM6sE5k2ZT/vI5BEe0r7mqjsUSnhVBFbOsVkEuaEfiA=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0/go.mod h1:243D9iHbcQXoFUtgHJwL7gl2zx1aDuDMjvBZVGr2uW0=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0/go.mod h1:243D9iHbcQXoFUtgHJwL7gl2zx1aDuDMjvBZVGr2uW0=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.1.0 h1:mk57wRUA8fyjFxVcPPGv4shLcWDXPFYokTJL9zJxQtE=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.1.0/go.mod h1:mU96hbp8qJDA9OzTV1Ji7wCyPyaqC5kI6ZPsZfJ8sE4=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1 h1:YvQv9Mz6T8oR5ypQOL6erY0Z5t71ak1uHV4QFokCOZk=
|
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1 h1:YvQv9Mz6T8oR5ypQOL6erY0Z5t71ak1uHV4QFokCOZk=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1/go.mod h1:c6WvOhtmjNUWbLfOG1qxM/q0SPvQNSVJvolm+C52dIU=
|
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1/go.mod h1:c6WvOhtmjNUWbLfOG1qxM/q0SPvQNSVJvolm+C52dIU=
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/logger"
|
"github.com/edgelesssys/constellation/v2/internal/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
13
hack/go.mod
13
hack/go.mod
@ -36,7 +36,7 @@ require (
|
|||||||
cloud.google.com/go/compute v1.14.0
|
cloud.google.com/go/compute v1.14.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2 v2.0.0
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0
|
||||||
github.com/edgelesssys/constellation/v2 v2.0.0
|
github.com/edgelesssys/constellation/v2 v2.0.0
|
||||||
github.com/fatih/color v1.13.0
|
github.com/fatih/color v1.13.0
|
||||||
github.com/go-git/go-git/v5 v5.5.1
|
github.com/go-git/go-git/v5 v5.5.1
|
||||||
@ -56,19 +56,13 @@ require (
|
|||||||
libvirt.org/go/libvirtxml v1.8009.0
|
libvirt.org/go/libvirtxml v1.8009.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/google/go-sev-guest v0.4.1 // indirect
|
|
||||||
github.com/google/logger v1.1.1 // indirect
|
|
||||||
github.com/pborman/uuid v1.2.0 // indirect
|
|
||||||
)
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.107.0 // indirect
|
cloud.google.com/go v0.107.0 // indirect
|
||||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||||
cloud.google.com/go/iam v0.8.0 // indirect
|
cloud.google.com/go/iam v0.8.0 // indirect
|
||||||
cloud.google.com/go/kms v1.7.0 // indirect
|
cloud.google.com/go/kms v1.7.0 // indirect
|
||||||
cloud.google.com/go/storage v1.28.1 // indirect
|
cloud.google.com/go/storage v1.28.1 // indirect
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 // indirect
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0 // indirect
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 // indirect
|
||||||
@ -158,9 +152,11 @@ require (
|
|||||||
github.com/google/go-attestation v0.4.4-0.20221011162210-17f9c05652a9 // indirect
|
github.com/google/go-attestation v0.4.4-0.20221011162210-17f9c05652a9 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
github.com/google/go-cmp v0.5.9 // indirect
|
||||||
github.com/google/go-containerregistry v0.12.1 // indirect
|
github.com/google/go-containerregistry v0.12.1 // indirect
|
||||||
|
github.com/google/go-sev-guest v0.4.1 // indirect
|
||||||
github.com/google/go-tpm v0.3.3 // indirect
|
github.com/google/go-tpm v0.3.3 // indirect
|
||||||
github.com/google/go-tspi v0.3.0 // indirect
|
github.com/google/go-tspi v0.3.0 // indirect
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
github.com/google/gofuzz v1.2.0 // indirect
|
||||||
|
github.com/google/logger v1.1.1 // indirect
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||||
github.com/google/tink/go v1.7.0 // indirect
|
github.com/google/tink/go v1.7.0 // indirect
|
||||||
github.com/google/trillian v1.5.0 // indirect
|
github.com/google/trillian v1.5.0 // indirect
|
||||||
@ -219,6 +215,7 @@ require (
|
|||||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||||
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
|
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
|
||||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||||
|
github.com/pborman/uuid v1.2.0 // indirect
|
||||||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||||
github.com/pjbgf/sha1cd v0.2.3 // indirect
|
github.com/pjbgf/sha1cd v0.2.3 // indirect
|
||||||
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
|
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
|
||||||
|
10
hack/go.sum
10
hack/go.sum
@ -89,17 +89,17 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 h1:sVW/AFBTGyJxDaMYlq0ct3jUX
|
|||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc=
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM=
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 h1:XUNQ4mw+zJmaA2KXzP9JlQiecy1SI+Eog7xVkPiqIbg=
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 h1:TOFrNxfjslms5nLLIMjW7N0+zSALX4KiGsptmpb16AA=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 h1:TOFrNxfjslms5nLLIMjW7N0+zSALX4KiGsptmpb16AA=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0/go.mod h1:EAyXOW1F6BTJPiK2pDvmnvxOHPxoTYWoqBeIlql+QhI=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0/go.mod h1:EAyXOW1F6BTJPiK2pDvmnvxOHPxoTYWoqBeIlql+QhI=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0 h1:82w8tzLcOwDP/Q35j/wEBPt0n0kVC3cjtPdD62G8UAk=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0 h1:82w8tzLcOwDP/Q35j/wEBPt0n0kVC3cjtPdD62G8UAk=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0/go.mod h1:S78i9yTr4o/nXlH76bKjGUye9Z2wSxO5Tz7GoDr4vfI=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.11.0/go.mod h1:S78i9yTr4o/nXlH76bKjGUye9Z2wSxO5Tz7GoDr4vfI=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 h1:Lg6BW0VPmCwcMlvOviL3ruHFO+H9tZNqscK0AeuFjGM=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0 h1:Lg6BW0VPmCwcMlvOviL3ruHFO+H9tZNqscK0AeuFjGM=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0/go.mod h1:9V2j0jn9jDEkCkv8w/bKTNppX/d0FVA1ud77xCIP4KA=
|
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.0/go.mod h1:9V2j0jn9jDEkCkv8w/bKTNppX/d0FVA1ud77xCIP4KA=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 h1:/Di3vB4sNeQ+7A8efjUVENvyB945Wruvstucqp7ZArg=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v3 v3.0.1 h1:H3g2mkmu105ON0c/Gqx3Bm+bzoIijLom8LmV9Gjn7X0=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2 v2.0.0 h1:xxe4naFUPYEW1W6C8yWrfFNmyZLnEbO+CsbsSF83wDo=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0 h1:KepfQdVTTQl/UmAbRALdkUUUfcWfu8xRaqrQ03ZGwvM=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2 v2.0.0/go.mod h1:aLFjumYDvv63tH1qnqkcmdjdZ6Sn+/viPv7H3jft0oY=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0/go.mod h1:Q3u+T/qw3Kb1Wf3DFKiFwEZlyaAyPb4yBgWm9wq7yh8=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 h1:QM6sE5k2ZT/vI5BEe0r7mqjsUSnhVBFbOsVkEuaEfiA=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 h1:QM6sE5k2ZT/vI5BEe0r7mqjsUSnhVBFbOsVkEuaEfiA=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8=
|
||||||
|
@ -15,8 +15,8 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/cloud"
|
"github.com/edgelesssys/constellation/v2/internal/cloud"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/cloud/azureshared"
|
"github.com/edgelesssys/constellation/v2/internal/cloud/azureshared"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/cloud/metadata"
|
"github.com/edgelesssys/constellation/v2/internal/cloud/metadata"
|
||||||
@ -68,7 +68,7 @@ func New(ctx context.Context) (*Cloud, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
scaleSetsAPI, err := armcomputev2.NewVirtualMachineScaleSetsClient(subscriptionID, cred, nil)
|
scaleSetsAPI, err := armcompute.NewVirtualMachineScaleSetsClient(subscriptionID, cred, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ func New(ctx context.Context) (*Cloud, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
virtualMachineScaleSetVMsAPI, err := armcomputev2.NewVirtualMachineScaleSetVMsClient(subscriptionID, cred, nil)
|
virtualMachineScaleSetVMsAPI, err := armcompute.NewVirtualMachineScaleSetVMsClient(subscriptionID, cred, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ func (c *Cloud) getSubnetworkCIDR(ctx context.Context) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getVMInterfaces retrieves all network interfaces referenced by a scale set virtual machine.
|
// getVMInterfaces retrieves all network interfaces referenced by a scale set virtual machine.
|
||||||
func (c *Cloud) getVMInterfaces(ctx context.Context, vm armcomputev2.VirtualMachineScaleSetVM, resourceGroup, scaleSet, instanceID string) ([]armnetwork.Interface, error) {
|
func (c *Cloud) getVMInterfaces(ctx context.Context, vm armcompute.VirtualMachineScaleSetVM, resourceGroup, scaleSet, instanceID string) ([]armnetwork.Interface, error) {
|
||||||
if vm.Properties == nil || vm.Properties.NetworkProfile == nil {
|
if vm.Properties == nil || vm.Properties.NetworkProfile == nil {
|
||||||
return []armnetwork.Interface{}, errors.New("no network profile found")
|
return []armnetwork.Interface{}, errors.New("no network profile found")
|
||||||
}
|
}
|
||||||
@ -399,7 +399,7 @@ type cloudConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convertToInstanceMetadata converts a armcomputev2.VirtualMachineScaleSetVM to a metadata.InstanceMetadata.
|
// convertToInstanceMetadata converts a armcomputev2.VirtualMachineScaleSetVM to a metadata.InstanceMetadata.
|
||||||
func convertToInstanceMetadata(vm armcomputev2.VirtualMachineScaleSetVM, networkInterfaces []armnetwork.Interface,
|
func convertToInstanceMetadata(vm armcompute.VirtualMachineScaleSetVM, networkInterfaces []armnetwork.Interface,
|
||||||
) (metadata.InstanceMetadata, error) {
|
) (metadata.InstanceMetadata, error) {
|
||||||
if vm.ID == nil {
|
if vm.ID == nil {
|
||||||
return metadata.InstanceMetadata{}, errors.New("missing instance ID")
|
return metadata.InstanceMetadata{}, errors.New("missing instance ID")
|
||||||
|
@ -14,8 +14,8 @@ import (
|
|||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/cloud"
|
"github.com/edgelesssys/constellation/v2/internal/cloud"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/cloud/metadata"
|
"github.com/edgelesssys/constellation/v2/internal/cloud/metadata"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/role"
|
"github.com/edgelesssys/constellation/v2/internal/role"
|
||||||
@ -322,15 +322,15 @@ func TestGetInstance(t *testing.T) {
|
|||||||
someErr := errors.New("failed")
|
someErr := errors.New("failed")
|
||||||
sampleProviderID := "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id"
|
sampleProviderID := "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id"
|
||||||
successVMAPI := &stubVirtualMachineScaleSetVMsAPI{
|
successVMAPI := &stubVirtualMachineScaleSetVMsAPI{
|
||||||
getVM: armcomputev2.VirtualMachineScaleSetVM{
|
getVM: armcompute.VirtualMachineScaleSetVM{
|
||||||
Name: to.Ptr("scale-set-name-instance-id"),
|
Name: to.Ptr("scale-set-name-instance-id"),
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id"),
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetVMProperties{
|
Properties: &armcompute.VirtualMachineScaleSetVMProperties{
|
||||||
OSProfile: &armcomputev2.OSProfile{
|
OSProfile: &armcompute.OSProfile{
|
||||||
ComputerName: to.Ptr("scale-set-name-instance-id"),
|
ComputerName: to.Ptr("scale-set-name-instance-id"),
|
||||||
},
|
},
|
||||||
NetworkProfile: &armcomputev2.NetworkProfile{
|
NetworkProfile: &armcompute.NetworkProfile{
|
||||||
NetworkInterfaces: []*armcomputev2.NetworkInterfaceReference{
|
NetworkInterfaces: []*armcompute.NetworkInterfaceReference{
|
||||||
{
|
{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Network/networkInterfaces/nic-name"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Network/networkInterfaces/nic-name"),
|
||||||
},
|
},
|
||||||
@ -379,15 +379,15 @@ func TestGetInstance(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"success control-plane": {
|
"success control-plane": {
|
||||||
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
||||||
getVM: armcomputev2.VirtualMachineScaleSetVM{
|
getVM: armcompute.VirtualMachineScaleSetVM{
|
||||||
Name: to.Ptr("scale-set-name-instance-id"),
|
Name: to.Ptr("scale-set-name-instance-id"),
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id"),
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetVMProperties{
|
Properties: &armcompute.VirtualMachineScaleSetVMProperties{
|
||||||
OSProfile: &armcomputev2.OSProfile{
|
OSProfile: &armcompute.OSProfile{
|
||||||
ComputerName: to.Ptr("scale-set-name-instance-id"),
|
ComputerName: to.Ptr("scale-set-name-instance-id"),
|
||||||
},
|
},
|
||||||
NetworkProfile: &armcomputev2.NetworkProfile{
|
NetworkProfile: &armcompute.NetworkProfile{
|
||||||
NetworkInterfaces: []*armcomputev2.NetworkInterfaceReference{
|
NetworkInterfaces: []*armcompute.NetworkInterfaceReference{
|
||||||
{
|
{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Network/networkInterfaces/nic-name"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Network/networkInterfaces/nic-name"),
|
||||||
},
|
},
|
||||||
@ -543,7 +543,7 @@ func TestList(t *testing.T) {
|
|||||||
}
|
}
|
||||||
scaleSetsResponse := &stubScaleSetsAPI{
|
scaleSetsResponse := &stubScaleSetsAPI{
|
||||||
pager: &stubVirtualMachineScaleSetsClientListPager{
|
pager: &stubVirtualMachineScaleSetsClientListPager{
|
||||||
list: []armcomputev2.VirtualMachineScaleSet{{
|
list: []armcompute.VirtualMachineScaleSet{{
|
||||||
Name: to.Ptr("scale-set"),
|
Name: to.Ptr("scale-set"),
|
||||||
Tags: map[string]*string{
|
Tags: map[string]*string{
|
||||||
cloud.TagUID: to.Ptr("uid"),
|
cloud.TagUID: to.Ptr("uid"),
|
||||||
@ -552,19 +552,19 @@ func TestList(t *testing.T) {
|
|||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
scaleSetVM := armcomputev2.VirtualMachineScaleSetVM{
|
scaleSetVM := armcompute.VirtualMachineScaleSetVM{
|
||||||
Name: to.Ptr("scale-set_0"),
|
Name: to.Ptr("scale-set_0"),
|
||||||
InstanceID: to.Ptr("instance-id"),
|
InstanceID: to.Ptr("instance-id"),
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set/virtualMachines/0"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set/virtualMachines/0"),
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetVMProperties{
|
Properties: &armcompute.VirtualMachineScaleSetVMProperties{
|
||||||
NetworkProfile: &armcomputev2.NetworkProfile{
|
NetworkProfile: &armcompute.NetworkProfile{
|
||||||
NetworkInterfaces: []*armcomputev2.NetworkInterfaceReference{
|
NetworkInterfaces: []*armcompute.NetworkInterfaceReference{
|
||||||
{
|
{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set/virtualMachines/0/networkInterfaces/interface-name"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set/virtualMachines/0/networkInterfaces/interface-name"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
OSProfile: &armcomputev2.OSProfile{
|
OSProfile: &armcompute.OSProfile{
|
||||||
ComputerName: to.Ptr("scale-set-0"),
|
ComputerName: to.Ptr("scale-set-0"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -598,7 +598,7 @@ func TestList(t *testing.T) {
|
|||||||
scaleSetsAPI: scaleSetsResponse,
|
scaleSetsAPI: scaleSetsResponse,
|
||||||
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
||||||
pager: &stubVirtualMachineScaleSetVMPager{
|
pager: &stubVirtualMachineScaleSetVMPager{
|
||||||
list: []armcomputev2.VirtualMachineScaleSetVM{scaleSetVM},
|
list: []armcompute.VirtualMachineScaleSetVM{scaleSetVM},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wantInstances: []metadata.InstanceMetadata{workerInstance},
|
wantInstances: []metadata.InstanceMetadata{workerInstance},
|
||||||
@ -612,21 +612,21 @@ func TestList(t *testing.T) {
|
|||||||
scaleSetsAPI: scaleSetsResponse,
|
scaleSetsAPI: scaleSetsResponse,
|
||||||
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
||||||
pager: &stubVirtualMachineScaleSetVMPager{
|
pager: &stubVirtualMachineScaleSetVMPager{
|
||||||
list: []armcomputev2.VirtualMachineScaleSetVM{
|
list: []armcompute.VirtualMachineScaleSetVM{
|
||||||
scaleSetVM,
|
scaleSetVM,
|
||||||
{
|
{
|
||||||
Name: to.Ptr("control-set_0"),
|
Name: to.Ptr("control-set_0"),
|
||||||
InstanceID: to.Ptr("0"),
|
InstanceID: to.Ptr("0"),
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/control-set/virtualMachines/0"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/control-set/virtualMachines/0"),
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetVMProperties{
|
Properties: &armcompute.VirtualMachineScaleSetVMProperties{
|
||||||
NetworkProfile: &armcomputev2.NetworkProfile{
|
NetworkProfile: &armcompute.NetworkProfile{
|
||||||
NetworkInterfaces: []*armcomputev2.NetworkInterfaceReference{
|
NetworkInterfaces: []*armcompute.NetworkInterfaceReference{
|
||||||
{
|
{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/control-set/virtualMachines/0/networkInterfaces/interface-name"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/control-set/virtualMachines/0/networkInterfaces/interface-name"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
OSProfile: &armcomputev2.OSProfile{
|
OSProfile: &armcompute.OSProfile{
|
||||||
ComputerName: to.Ptr("control-set-0"),
|
ComputerName: to.Ptr("control-set-0"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -657,7 +657,7 @@ func TestList(t *testing.T) {
|
|||||||
scaleSetsAPI: scaleSetsResponse,
|
scaleSetsAPI: scaleSetsResponse,
|
||||||
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
||||||
pager: &stubVirtualMachineScaleSetVMPager{
|
pager: &stubVirtualMachineScaleSetVMPager{
|
||||||
list: []armcomputev2.VirtualMachineScaleSetVM{scaleSetVM},
|
list: []armcompute.VirtualMachineScaleSetVM{scaleSetVM},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
@ -671,7 +671,7 @@ func TestList(t *testing.T) {
|
|||||||
scaleSetsAPI: scaleSetsResponse,
|
scaleSetsAPI: scaleSetsResponse,
|
||||||
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
scaleSetsVMAPI: &stubVirtualMachineScaleSetVMsAPI{
|
||||||
pager: &stubVirtualMachineScaleSetVMPager{
|
pager: &stubVirtualMachineScaleSetVMPager{
|
||||||
list: []armcomputev2.VirtualMachineScaleSetVM{scaleSetVM},
|
list: []armcompute.VirtualMachineScaleSetVM{scaleSetVM},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
@ -1050,26 +1050,26 @@ func (a *stubIMDSAPI) initSecretHash(ctx context.Context) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type stubVirtualMachineScaleSetVMPager struct {
|
type stubVirtualMachineScaleSetVMPager struct {
|
||||||
list []armcomputev2.VirtualMachineScaleSetVM
|
list []armcompute.VirtualMachineScaleSetVM
|
||||||
fetchErr error
|
fetchErr error
|
||||||
more bool
|
more bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *stubVirtualMachineScaleSetVMPager) moreFunc() func(armcomputev2.VirtualMachineScaleSetVMsClientListResponse) bool {
|
func (p *stubVirtualMachineScaleSetVMPager) moreFunc() func(armcompute.VirtualMachineScaleSetVMsClientListResponse) bool {
|
||||||
return func(armcomputev2.VirtualMachineScaleSetVMsClientListResponse) bool {
|
return func(armcompute.VirtualMachineScaleSetVMsClientListResponse) bool {
|
||||||
return p.more
|
return p.more
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *stubVirtualMachineScaleSetVMPager) fetcherFunc() func(context.Context, *armcomputev2.VirtualMachineScaleSetVMsClientListResponse,
|
func (p *stubVirtualMachineScaleSetVMPager) fetcherFunc() func(context.Context, *armcompute.VirtualMachineScaleSetVMsClientListResponse,
|
||||||
) (armcomputev2.VirtualMachineScaleSetVMsClientListResponse, error) {
|
) (armcompute.VirtualMachineScaleSetVMsClientListResponse, error) {
|
||||||
return func(context.Context, *armcomputev2.VirtualMachineScaleSetVMsClientListResponse) (armcomputev2.VirtualMachineScaleSetVMsClientListResponse, error) {
|
return func(context.Context, *armcompute.VirtualMachineScaleSetVMsClientListResponse) (armcompute.VirtualMachineScaleSetVMsClientListResponse, error) {
|
||||||
page := make([]*armcomputev2.VirtualMachineScaleSetVM, len(p.list))
|
page := make([]*armcompute.VirtualMachineScaleSetVM, len(p.list))
|
||||||
for i := range p.list {
|
for i := range p.list {
|
||||||
page[i] = &p.list[i]
|
page[i] = &p.list[i]
|
||||||
}
|
}
|
||||||
return armcomputev2.VirtualMachineScaleSetVMsClientListResponse{
|
return armcompute.VirtualMachineScaleSetVMsClientListResponse{
|
||||||
VirtualMachineScaleSetVMListResult: armcomputev2.VirtualMachineScaleSetVMListResult{
|
VirtualMachineScaleSetVMListResult: armcompute.VirtualMachineScaleSetVMListResult{
|
||||||
Value: page,
|
Value: page,
|
||||||
},
|
},
|
||||||
}, p.fetchErr
|
}, p.fetchErr
|
||||||
@ -1077,21 +1077,21 @@ func (p *stubVirtualMachineScaleSetVMPager) fetcherFunc() func(context.Context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
type stubVirtualMachineScaleSetVMsAPI struct {
|
type stubVirtualMachineScaleSetVMsAPI struct {
|
||||||
getVM armcomputev2.VirtualMachineScaleSetVM
|
getVM armcompute.VirtualMachineScaleSetVM
|
||||||
getErr error
|
getErr error
|
||||||
pager *stubVirtualMachineScaleSetVMPager
|
pager *stubVirtualMachineScaleSetVMPager
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubVirtualMachineScaleSetVMsAPI) Get(context.Context, string, string, string, *armcomputev2.VirtualMachineScaleSetVMsClientGetOptions,
|
func (a *stubVirtualMachineScaleSetVMsAPI) Get(context.Context, string, string, string, *armcompute.VirtualMachineScaleSetVMsClientGetOptions,
|
||||||
) (armcomputev2.VirtualMachineScaleSetVMsClientGetResponse, error) {
|
) (armcompute.VirtualMachineScaleSetVMsClientGetResponse, error) {
|
||||||
return armcomputev2.VirtualMachineScaleSetVMsClientGetResponse{
|
return armcompute.VirtualMachineScaleSetVMsClientGetResponse{
|
||||||
VirtualMachineScaleSetVM: a.getVM,
|
VirtualMachineScaleSetVM: a.getVM,
|
||||||
}, a.getErr
|
}, a.getErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubVirtualMachineScaleSetVMsAPI) NewListPager(string, string, *armcomputev2.VirtualMachineScaleSetVMsClientListOptions,
|
func (a *stubVirtualMachineScaleSetVMsAPI) NewListPager(string, string, *armcompute.VirtualMachineScaleSetVMsClientListOptions,
|
||||||
) *runtime.Pager[armcomputev2.VirtualMachineScaleSetVMsClientListResponse] {
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetVMsClientListResponse] {
|
||||||
return runtime.NewPager(runtime.PagingHandler[armcomputev2.VirtualMachineScaleSetVMsClientListResponse]{
|
return runtime.NewPager(runtime.PagingHandler[armcompute.VirtualMachineScaleSetVMsClientListResponse]{
|
||||||
More: a.pager.moreFunc(),
|
More: a.pager.moreFunc(),
|
||||||
Fetcher: a.pager.fetcherFunc(),
|
Fetcher: a.pager.fetcherFunc(),
|
||||||
})
|
})
|
||||||
@ -1118,26 +1118,26 @@ func (a *stubNetworkInterfacesAPI) Get(context.Context, string, string, *armnetw
|
|||||||
}
|
}
|
||||||
|
|
||||||
type stubVirtualMachineScaleSetsClientListPager struct {
|
type stubVirtualMachineScaleSetsClientListPager struct {
|
||||||
list []armcomputev2.VirtualMachineScaleSet
|
list []armcompute.VirtualMachineScaleSet
|
||||||
fetchErr error
|
fetchErr error
|
||||||
more bool
|
more bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *stubVirtualMachineScaleSetsClientListPager) moreFunc() func(armcomputev2.VirtualMachineScaleSetsClientListResponse) bool {
|
func (p *stubVirtualMachineScaleSetsClientListPager) moreFunc() func(armcompute.VirtualMachineScaleSetsClientListResponse) bool {
|
||||||
return func(armcomputev2.VirtualMachineScaleSetsClientListResponse) bool {
|
return func(armcompute.VirtualMachineScaleSetsClientListResponse) bool {
|
||||||
return p.more
|
return p.more
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *stubVirtualMachineScaleSetsClientListPager) fetcherFunc() func(context.Context, *armcomputev2.VirtualMachineScaleSetsClientListResponse,
|
func (p *stubVirtualMachineScaleSetsClientListPager) fetcherFunc() func(context.Context, *armcompute.VirtualMachineScaleSetsClientListResponse,
|
||||||
) (armcomputev2.VirtualMachineScaleSetsClientListResponse, error) {
|
) (armcompute.VirtualMachineScaleSetsClientListResponse, error) {
|
||||||
return func(context.Context, *armcomputev2.VirtualMachineScaleSetsClientListResponse) (armcomputev2.VirtualMachineScaleSetsClientListResponse, error) {
|
return func(context.Context, *armcompute.VirtualMachineScaleSetsClientListResponse) (armcompute.VirtualMachineScaleSetsClientListResponse, error) {
|
||||||
page := make([]*armcomputev2.VirtualMachineScaleSet, len(p.list))
|
page := make([]*armcompute.VirtualMachineScaleSet, len(p.list))
|
||||||
for i := range p.list {
|
for i := range p.list {
|
||||||
page[i] = &p.list[i]
|
page[i] = &p.list[i]
|
||||||
}
|
}
|
||||||
return armcomputev2.VirtualMachineScaleSetsClientListResponse{
|
return armcompute.VirtualMachineScaleSetsClientListResponse{
|
||||||
VirtualMachineScaleSetListResult: armcomputev2.VirtualMachineScaleSetListResult{
|
VirtualMachineScaleSetListResult: armcompute.VirtualMachineScaleSetListResult{
|
||||||
Value: page,
|
Value: page,
|
||||||
},
|
},
|
||||||
}, p.fetchErr
|
}, p.fetchErr
|
||||||
@ -1148,9 +1148,9 @@ type stubScaleSetsAPI struct {
|
|||||||
pager *stubVirtualMachineScaleSetsClientListPager
|
pager *stubVirtualMachineScaleSetsClientListPager
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubScaleSetsAPI) NewListPager(string, *armcomputev2.VirtualMachineScaleSetsClientListOptions,
|
func (a *stubScaleSetsAPI) NewListPager(string, *armcompute.VirtualMachineScaleSetsClientListOptions,
|
||||||
) *runtime.Pager[armcomputev2.VirtualMachineScaleSetsClientListResponse] {
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetsClientListResponse] {
|
||||||
return runtime.NewPager(runtime.PagingHandler[armcomputev2.VirtualMachineScaleSetsClientListResponse]{
|
return runtime.NewPager(runtime.PagingHandler[armcompute.VirtualMachineScaleSetsClientListResponse]{
|
||||||
More: a.pager.moreFunc(),
|
More: a.pager.moreFunc(),
|
||||||
Fetcher: a.pager.fetcherFunc(),
|
Fetcher: a.pager.fetcherFunc(),
|
||||||
})
|
})
|
||||||
|
@ -11,8 +11,8 @@ import (
|
|||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
type imdsAPI interface {
|
type imdsAPI interface {
|
||||||
@ -58,16 +58,16 @@ type publicIPAddressesAPI interface {
|
|||||||
|
|
||||||
type virtualMachineScaleSetVMsAPI interface {
|
type virtualMachineScaleSetVMsAPI interface {
|
||||||
Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetVMsClientGetOptions,
|
options *armcompute.VirtualMachineScaleSetVMsClientGetOptions,
|
||||||
) (armcomputev2.VirtualMachineScaleSetVMsClientGetResponse, error)
|
) (armcompute.VirtualMachineScaleSetVMsClientGetResponse, error)
|
||||||
NewListPager(resourceGroupName string, virtualMachineScaleSetName string,
|
NewListPager(resourceGroupName string, virtualMachineScaleSetName string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetVMsClientListOptions,
|
options *armcompute.VirtualMachineScaleSetVMsClientListOptions,
|
||||||
) *runtime.Pager[armcomputev2.VirtualMachineScaleSetVMsClientListResponse]
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetVMsClientListResponse]
|
||||||
}
|
}
|
||||||
|
|
||||||
type scaleSetsAPI interface {
|
type scaleSetsAPI interface {
|
||||||
NewListPager(resourceGroupName string, options *armcomputev2.VirtualMachineScaleSetsClientListOptions,
|
NewListPager(resourceGroupName string, options *armcompute.VirtualMachineScaleSetsClientListOptions,
|
||||||
) *runtime.Pager[armcomputev2.VirtualMachineScaleSetsClientListResponse]
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetsClientListResponse]
|
||||||
}
|
}
|
||||||
|
|
||||||
type loadBalancerAPI interface {
|
type loadBalancerAPI interface {
|
||||||
|
@ -8,7 +8,7 @@ require (
|
|||||||
cloud.google.com/go/compute v1.14.0
|
cloud.google.com/go/compute v1.14.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2 v2.0.0
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0
|
||||||
github.com/googleapis/gax-go/v2 v2.7.0
|
github.com/googleapis/gax-go/v2 v2.7.0
|
||||||
github.com/medik8s/node-maintenance-operator v0.13.1
|
github.com/medik8s/node-maintenance-operator v0.13.1
|
||||||
github.com/onsi/ginkgo v1.16.5
|
github.com/onsi/ginkgo v1.16.5
|
||||||
@ -30,7 +30,7 @@ require (
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect
|
||||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||||
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
|
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
|
||||||
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
|
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
|
||||||
|
@ -46,11 +46,11 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 h1:sVW/AFBTGyJxDaMYlq0ct3jUX
|
|||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc=
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM=
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 h1:XUNQ4mw+zJmaA2KXzP9JlQiecy1SI+Eog7xVkPiqIbg=
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 h1:/Di3vB4sNeQ+7A8efjUVENvyB945Wruvstucqp7ZArg=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v3 v3.0.1 h1:H3g2mkmu105ON0c/Gqx3Bm+bzoIijLom8LmV9Gjn7X0=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2 v2.0.0 h1:xxe4naFUPYEW1W6C8yWrfFNmyZLnEbO+CsbsSF83wDo=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0 h1:KepfQdVTTQl/UmAbRALdkUUUfcWfu8xRaqrQ03ZGwvM=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2 v2.0.0/go.mod h1:aLFjumYDvv63tH1qnqkcmdjdZ6Sn+/viPv7H3jft0oY=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.0.0/go.mod h1:Q3u+T/qw3Kb1Wf3DFKiFwEZlyaAyPb4yBgWm9wq7yh8=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 h1:QM6sE5k2ZT/vI5BEe0r7mqjsUSnhVBFbOsVkEuaEfiA=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 h1:QM6sE5k2ZT/vI5BEe0r7mqjsUSnhVBFbOsVkEuaEfiA=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8=
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8=
|
||||||
|
@ -10,34 +10,34 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
"github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/internal/poller"
|
"github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/internal/poller"
|
||||||
)
|
)
|
||||||
|
|
||||||
type virtualMachineScaleSetVMsAPI interface {
|
type virtualMachineScaleSetVMsAPI interface {
|
||||||
Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetVMsClientGetOptions,
|
options *armcompute.VirtualMachineScaleSetVMsClientGetOptions,
|
||||||
) (armcomputev2.VirtualMachineScaleSetVMsClientGetResponse, error)
|
) (armcompute.VirtualMachineScaleSetVMsClientGetResponse, error)
|
||||||
GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetVMsClientGetInstanceViewOptions,
|
options *armcompute.VirtualMachineScaleSetVMsClientGetInstanceViewOptions,
|
||||||
) (armcomputev2.VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error)
|
) (armcompute.VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error)
|
||||||
NewListPager(resourceGroupName string, virtualMachineScaleSetName string,
|
NewListPager(resourceGroupName string, virtualMachineScaleSetName string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetVMsClientListOptions,
|
options *armcompute.VirtualMachineScaleSetVMsClientListOptions,
|
||||||
) *runtime.Pager[armcomputev2.VirtualMachineScaleSetVMsClientListResponse]
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetVMsClientListResponse]
|
||||||
}
|
}
|
||||||
|
|
||||||
type scaleSetsAPI interface {
|
type scaleSetsAPI interface {
|
||||||
Get(ctx context.Context, resourceGroupName string, vmScaleSetName string,
|
Get(ctx context.Context, resourceGroupName string, vmScaleSetName string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetsClientGetOptions,
|
options *armcompute.VirtualMachineScaleSetsClientGetOptions,
|
||||||
) (armcomputev2.VirtualMachineScaleSetsClientGetResponse, error)
|
) (armcompute.VirtualMachineScaleSetsClientGetResponse, error)
|
||||||
BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters armcomputev2.VirtualMachineScaleSetUpdate,
|
BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters armcompute.VirtualMachineScaleSetUpdate,
|
||||||
options *armcomputev2.VirtualMachineScaleSetsClientBeginUpdateOptions,
|
options *armcompute.VirtualMachineScaleSetsClientBeginUpdateOptions,
|
||||||
) (*runtime.Poller[armcomputev2.VirtualMachineScaleSetsClientUpdateResponse], error)
|
) (*runtime.Poller[armcompute.VirtualMachineScaleSetsClientUpdateResponse], error)
|
||||||
BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs armcomputev2.VirtualMachineScaleSetVMInstanceRequiredIDs,
|
BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs,
|
||||||
options *armcomputev2.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions,
|
options *armcompute.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions,
|
||||||
) (*runtime.Poller[armcomputev2.VirtualMachineScaleSetsClientDeleteInstancesResponse], error)
|
) (*runtime.Poller[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse], error)
|
||||||
NewListPager(resourceGroupName string, options *armcomputev2.VirtualMachineScaleSetsClientListOptions,
|
NewListPager(resourceGroupName string, options *armcompute.VirtualMachineScaleSetsClientListOptions,
|
||||||
) *runtime.Pager[armcomputev2.VirtualMachineScaleSetsClientListResponse]
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetsClientListResponse]
|
||||||
}
|
}
|
||||||
|
|
||||||
type capacityPoller interface {
|
type capacityPoller interface {
|
||||||
|
@ -8,7 +8,7 @@ package client
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
"github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/internal/poller"
|
"github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/internal/poller"
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
)
|
)
|
||||||
@ -34,11 +34,11 @@ func NewFromDefault(configPath string) (*Client, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
scaleSetAPI, err := armcomputev2.NewVirtualMachineScaleSetsClient(config.SubscriptionID, cred, nil)
|
scaleSetAPI, err := armcompute.NewVirtualMachineScaleSetsClient(config.SubscriptionID, cred, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
virtualMachineScaleSetVMsAPI, err := armcomputev2.NewVirtualMachineScaleSetVMsClient(config.SubscriptionID, cred, nil)
|
virtualMachineScaleSetVMsAPI, err := armcompute.NewVirtualMachineScaleSetVMsClient(config.SubscriptionID, cred, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -11,31 +11,31 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stubScaleSetsAPI struct {
|
type stubScaleSetsAPI struct {
|
||||||
scaleSet armcomputev2.VirtualMachineScaleSetsClientGetResponse
|
scaleSet armcompute.VirtualMachineScaleSetsClientGetResponse
|
||||||
getErr error
|
getErr error
|
||||||
updateResponse armcomputev2.VirtualMachineScaleSetsClientUpdateResponse
|
updateResponse armcompute.VirtualMachineScaleSetsClientUpdateResponse
|
||||||
updateErr error
|
updateErr error
|
||||||
deleteResponse armcomputev2.VirtualMachineScaleSetsClientDeleteInstancesResponse
|
deleteResponse armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse
|
||||||
deleteErr error
|
deleteErr error
|
||||||
resultErr error
|
resultErr error
|
||||||
pager *stubVMSSPager
|
pager *stubVMSSPager
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubScaleSetsAPI) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string,
|
func (a *stubScaleSetsAPI) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetsClientGetOptions,
|
options *armcompute.VirtualMachineScaleSetsClientGetOptions,
|
||||||
) (armcomputev2.VirtualMachineScaleSetsClientGetResponse, error) {
|
) (armcompute.VirtualMachineScaleSetsClientGetResponse, error) {
|
||||||
return a.scaleSet, a.getErr
|
return a.scaleSet, a.getErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubScaleSetsAPI) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters armcomputev2.VirtualMachineScaleSetUpdate,
|
func (a *stubScaleSetsAPI) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters armcompute.VirtualMachineScaleSetUpdate,
|
||||||
options *armcomputev2.VirtualMachineScaleSetsClientBeginUpdateOptions,
|
options *armcompute.VirtualMachineScaleSetsClientBeginUpdateOptions,
|
||||||
) (*runtime.Poller[armcomputev2.VirtualMachineScaleSetsClientUpdateResponse], error) {
|
) (*runtime.Poller[armcompute.VirtualMachineScaleSetsClientUpdateResponse], error) {
|
||||||
poller, err := runtime.NewPoller(nil, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), &runtime.NewPollerOptions[armcomputev2.VirtualMachineScaleSetsClientUpdateResponse]{
|
poller, err := runtime.NewPoller(nil, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), &runtime.NewPollerOptions[armcompute.VirtualMachineScaleSetsClientUpdateResponse]{
|
||||||
Handler: &stubPoller[armcomputev2.VirtualMachineScaleSetsClientUpdateResponse]{
|
Handler: &stubPoller[armcompute.VirtualMachineScaleSetsClientUpdateResponse]{
|
||||||
result: a.updateResponse,
|
result: a.updateResponse,
|
||||||
resultErr: a.resultErr,
|
resultErr: a.resultErr,
|
||||||
},
|
},
|
||||||
@ -46,11 +46,11 @@ func (a *stubScaleSetsAPI) BeginUpdate(ctx context.Context, resourceGroupName st
|
|||||||
return poller, a.updateErr
|
return poller, a.updateErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubScaleSetsAPI) BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs armcomputev2.VirtualMachineScaleSetVMInstanceRequiredIDs,
|
func (a *stubScaleSetsAPI) BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs,
|
||||||
options *armcomputev2.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions,
|
options *armcompute.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions,
|
||||||
) (*runtime.Poller[armcomputev2.VirtualMachineScaleSetsClientDeleteInstancesResponse], error) {
|
) (*runtime.Poller[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse], error) {
|
||||||
poller, err := runtime.NewPoller(nil, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), &runtime.NewPollerOptions[armcomputev2.VirtualMachineScaleSetsClientDeleteInstancesResponse]{
|
poller, err := runtime.NewPoller(nil, runtime.NewPipeline("", "", runtime.PipelineOptions{}, nil), &runtime.NewPollerOptions[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse]{
|
||||||
Handler: &stubPoller[armcomputev2.VirtualMachineScaleSetsClientDeleteInstancesResponse]{
|
Handler: &stubPoller[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse]{
|
||||||
result: a.deleteResponse,
|
result: a.deleteResponse,
|
||||||
resultErr: a.resultErr,
|
resultErr: a.resultErr,
|
||||||
},
|
},
|
||||||
@ -61,38 +61,38 @@ func (a *stubScaleSetsAPI) BeginDeleteInstances(ctx context.Context, resourceGro
|
|||||||
return poller, a.deleteErr
|
return poller, a.deleteErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubScaleSetsAPI) NewListPager(resourceGroupName string, options *armcomputev2.VirtualMachineScaleSetsClientListOptions,
|
func (a *stubScaleSetsAPI) NewListPager(resourceGroupName string, options *armcompute.VirtualMachineScaleSetsClientListOptions,
|
||||||
) *runtime.Pager[armcomputev2.VirtualMachineScaleSetsClientListResponse] {
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetsClientListResponse] {
|
||||||
return runtime.NewPager(runtime.PagingHandler[armcomputev2.VirtualMachineScaleSetsClientListResponse]{
|
return runtime.NewPager(runtime.PagingHandler[armcompute.VirtualMachineScaleSetsClientListResponse]{
|
||||||
More: a.pager.moreFunc(),
|
More: a.pager.moreFunc(),
|
||||||
Fetcher: a.pager.fetcherFunc(),
|
Fetcher: a.pager.fetcherFunc(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
type stubvirtualMachineScaleSetVMsAPI struct {
|
type stubvirtualMachineScaleSetVMsAPI struct {
|
||||||
scaleSetVM armcomputev2.VirtualMachineScaleSetVMsClientGetResponse
|
scaleSetVM armcompute.VirtualMachineScaleSetVMsClientGetResponse
|
||||||
getErr error
|
getErr error
|
||||||
instanceView armcomputev2.VirtualMachineScaleSetVMsClientGetInstanceViewResponse
|
instanceView armcompute.VirtualMachineScaleSetVMsClientGetInstanceViewResponse
|
||||||
instanceViewErr error
|
instanceViewErr error
|
||||||
pager *stubVMSSVMPager
|
pager *stubVMSSVMPager
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubvirtualMachineScaleSetVMsAPI) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
func (a *stubvirtualMachineScaleSetVMsAPI) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetVMsClientGetOptions,
|
options *armcompute.VirtualMachineScaleSetVMsClientGetOptions,
|
||||||
) (armcomputev2.VirtualMachineScaleSetVMsClientGetResponse, error) {
|
) (armcompute.VirtualMachineScaleSetVMsClientGetResponse, error) {
|
||||||
return a.scaleSetVM, a.getErr
|
return a.scaleSetVM, a.getErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubvirtualMachineScaleSetVMsAPI) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
func (a *stubvirtualMachineScaleSetVMsAPI) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetVMsClientGetInstanceViewOptions,
|
options *armcompute.VirtualMachineScaleSetVMsClientGetInstanceViewOptions,
|
||||||
) (armcomputev2.VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) {
|
) (armcompute.VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) {
|
||||||
return a.instanceView, a.instanceViewErr
|
return a.instanceView, a.instanceViewErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *stubvirtualMachineScaleSetVMsAPI) NewListPager(resourceGroupName string, virtualMachineScaleSetName string,
|
func (a *stubvirtualMachineScaleSetVMsAPI) NewListPager(resourceGroupName string, virtualMachineScaleSetName string,
|
||||||
options *armcomputev2.VirtualMachineScaleSetVMsClientListOptions,
|
options *armcompute.VirtualMachineScaleSetVMsClientListOptions,
|
||||||
) *runtime.Pager[armcomputev2.VirtualMachineScaleSetVMsClientListResponse] {
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetVMsClientListResponse] {
|
||||||
return runtime.NewPager(runtime.PagingHandler[armcomputev2.VirtualMachineScaleSetVMsClientListResponse]{
|
return runtime.NewPager(runtime.PagingHandler[armcompute.VirtualMachineScaleSetVMsClientListResponse]{
|
||||||
More: a.pager.moreFunc(),
|
More: a.pager.moreFunc(),
|
||||||
Fetcher: a.pager.fetcherFunc(),
|
Fetcher: a.pager.fetcherFunc(),
|
||||||
})
|
})
|
||||||
@ -118,25 +118,25 @@ func (p *stubPoller[T]) Result(ctx context.Context, out *T) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type stubVMSSVMPager struct {
|
type stubVMSSVMPager struct {
|
||||||
list []armcomputev2.VirtualMachineScaleSetVM
|
list []armcompute.VirtualMachineScaleSetVM
|
||||||
fetchErr error
|
fetchErr error
|
||||||
more bool
|
more bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *stubVMSSVMPager) moreFunc() func(armcomputev2.VirtualMachineScaleSetVMsClientListResponse) bool {
|
func (p *stubVMSSVMPager) moreFunc() func(armcompute.VirtualMachineScaleSetVMsClientListResponse) bool {
|
||||||
return func(armcomputev2.VirtualMachineScaleSetVMsClientListResponse) bool {
|
return func(armcompute.VirtualMachineScaleSetVMsClientListResponse) bool {
|
||||||
return p.more
|
return p.more
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *stubVMSSVMPager) fetcherFunc() func(context.Context, *armcomputev2.VirtualMachineScaleSetVMsClientListResponse) (armcomputev2.VirtualMachineScaleSetVMsClientListResponse, error) {
|
func (p *stubVMSSVMPager) fetcherFunc() func(context.Context, *armcompute.VirtualMachineScaleSetVMsClientListResponse) (armcompute.VirtualMachineScaleSetVMsClientListResponse, error) {
|
||||||
return func(context.Context, *armcomputev2.VirtualMachineScaleSetVMsClientListResponse) (armcomputev2.VirtualMachineScaleSetVMsClientListResponse, error) {
|
return func(context.Context, *armcompute.VirtualMachineScaleSetVMsClientListResponse) (armcompute.VirtualMachineScaleSetVMsClientListResponse, error) {
|
||||||
page := make([]*armcomputev2.VirtualMachineScaleSetVM, len(p.list))
|
page := make([]*armcompute.VirtualMachineScaleSetVM, len(p.list))
|
||||||
for i := range p.list {
|
for i := range p.list {
|
||||||
page[i] = &p.list[i]
|
page[i] = &p.list[i]
|
||||||
}
|
}
|
||||||
return armcomputev2.VirtualMachineScaleSetVMsClientListResponse{
|
return armcompute.VirtualMachineScaleSetVMsClientListResponse{
|
||||||
VirtualMachineScaleSetVMListResult: armcomputev2.VirtualMachineScaleSetVMListResult{
|
VirtualMachineScaleSetVMListResult: armcompute.VirtualMachineScaleSetVMListResult{
|
||||||
Value: page,
|
Value: page,
|
||||||
},
|
},
|
||||||
}, p.fetchErr
|
}, p.fetchErr
|
||||||
@ -144,25 +144,25 @@ func (p *stubVMSSVMPager) fetcherFunc() func(context.Context, *armcomputev2.Virt
|
|||||||
}
|
}
|
||||||
|
|
||||||
type stubVMSSPager struct {
|
type stubVMSSPager struct {
|
||||||
list []armcomputev2.VirtualMachineScaleSet
|
list []armcompute.VirtualMachineScaleSet
|
||||||
fetchErr error
|
fetchErr error
|
||||||
more bool
|
more bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *stubVMSSPager) moreFunc() func(armcomputev2.VirtualMachineScaleSetsClientListResponse) bool {
|
func (p *stubVMSSPager) moreFunc() func(armcompute.VirtualMachineScaleSetsClientListResponse) bool {
|
||||||
return func(armcomputev2.VirtualMachineScaleSetsClientListResponse) bool {
|
return func(armcompute.VirtualMachineScaleSetsClientListResponse) bool {
|
||||||
return p.more
|
return p.more
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *stubVMSSPager) fetcherFunc() func(context.Context, *armcomputev2.VirtualMachineScaleSetsClientListResponse) (armcomputev2.VirtualMachineScaleSetsClientListResponse, error) {
|
func (p *stubVMSSPager) fetcherFunc() func(context.Context, *armcompute.VirtualMachineScaleSetsClientListResponse) (armcompute.VirtualMachineScaleSetsClientListResponse, error) {
|
||||||
return func(context.Context, *armcomputev2.VirtualMachineScaleSetsClientListResponse) (armcomputev2.VirtualMachineScaleSetsClientListResponse, error) {
|
return func(context.Context, *armcompute.VirtualMachineScaleSetsClientListResponse) (armcompute.VirtualMachineScaleSetsClientListResponse, error) {
|
||||||
page := make([]*armcomputev2.VirtualMachineScaleSet, len(p.list))
|
page := make([]*armcompute.VirtualMachineScaleSet, len(p.list))
|
||||||
for i := range p.list {
|
for i := range p.list {
|
||||||
page[i] = &p.list[i]
|
page[i] = &p.list[i]
|
||||||
}
|
}
|
||||||
return armcomputev2.VirtualMachineScaleSetsClientListResponse{
|
return armcompute.VirtualMachineScaleSetsClientListResponse{
|
||||||
VirtualMachineScaleSetListResult: armcomputev2.VirtualMachineScaleSetListResult{
|
VirtualMachineScaleSetListResult: armcompute.VirtualMachineScaleSetListResult{
|
||||||
Value: page,
|
Value: page,
|
||||||
},
|
},
|
||||||
}, p.fetchErr
|
}, p.fetchErr
|
||||||
|
@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
updatev1alpha1 "github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/api/v1alpha1"
|
updatev1alpha1 "github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/api/v1alpha1"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ const (
|
|||||||
// reference:
|
// reference:
|
||||||
// - https://docs.microsoft.com/en-us/azure/virtual-machines/states-billing#provisioning-states
|
// - https://docs.microsoft.com/en-us/azure/virtual-machines/states-billing#provisioning-states
|
||||||
// - https://docs.microsoft.com/en-us/azure/virtual-machines/states-billing#power-states-and-billing
|
// - https://docs.microsoft.com/en-us/azure/virtual-machines/states-billing#power-states-and-billing
|
||||||
func nodeStateFromStatuses(statuses []*armcomputev2.InstanceViewStatus) updatev1alpha1.CSPNodeState {
|
func nodeStateFromStatuses(statuses []*armcompute.InstanceViewStatus) updatev1alpha1.CSPNodeState {
|
||||||
for _, status := range statuses {
|
for _, status := range statuses {
|
||||||
if status == nil || status.Code == nil {
|
if status == nil || status.Code == nil {
|
||||||
continue
|
continue
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
updatev1alpha1 "github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/api/v1alpha1"
|
updatev1alpha1 "github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/api/v1alpha1"
|
||||||
@ -22,77 +22,77 @@ const provisioningStateSucceeded = "ProvisioningState/succeeded"
|
|||||||
|
|
||||||
func TestNodeStateFromStatuses(t *testing.T) {
|
func TestNodeStateFromStatuses(t *testing.T) {
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
statuses []*armcomputev2.InstanceViewStatus
|
statuses []*armcompute.InstanceViewStatus
|
||||||
wantState updatev1alpha1.CSPNodeState
|
wantState updatev1alpha1.CSPNodeState
|
||||||
}{
|
}{
|
||||||
"no statuses": {
|
"no statuses": {
|
||||||
wantState: updatev1alpha1.NodeStateUnknown,
|
wantState: updatev1alpha1.NodeStateUnknown,
|
||||||
},
|
},
|
||||||
"invalid status": {
|
"invalid status": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{nil, {Code: nil}},
|
statuses: []*armcompute.InstanceViewStatus{nil, {Code: nil}},
|
||||||
wantState: updatev1alpha1.NodeStateUnknown,
|
wantState: updatev1alpha1.NodeStateUnknown,
|
||||||
},
|
},
|
||||||
"provisioning creating": {
|
"provisioning creating": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{{Code: to.Ptr(provisioningStateCreating)}},
|
statuses: []*armcompute.InstanceViewStatus{{Code: to.Ptr(provisioningStateCreating)}},
|
||||||
wantState: updatev1alpha1.NodeStateCreating,
|
wantState: updatev1alpha1.NodeStateCreating,
|
||||||
},
|
},
|
||||||
"provisioning updating": {
|
"provisioning updating": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{{Code: to.Ptr(provisioningStateUpdating)}},
|
statuses: []*armcompute.InstanceViewStatus{{Code: to.Ptr(provisioningStateUpdating)}},
|
||||||
wantState: updatev1alpha1.NodeStateStopped,
|
wantState: updatev1alpha1.NodeStateStopped,
|
||||||
},
|
},
|
||||||
"provisioning migrating": {
|
"provisioning migrating": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{{Code: to.Ptr(provisioningStateMigrating)}},
|
statuses: []*armcompute.InstanceViewStatus{{Code: to.Ptr(provisioningStateMigrating)}},
|
||||||
wantState: updatev1alpha1.NodeStateStopped,
|
wantState: updatev1alpha1.NodeStateStopped,
|
||||||
},
|
},
|
||||||
"provisioning failed": {
|
"provisioning failed": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{{Code: to.Ptr(provisioningStateFailed)}},
|
statuses: []*armcompute.InstanceViewStatus{{Code: to.Ptr(provisioningStateFailed)}},
|
||||||
wantState: updatev1alpha1.NodeStateFailed,
|
wantState: updatev1alpha1.NodeStateFailed,
|
||||||
},
|
},
|
||||||
"provisioning deleting": {
|
"provisioning deleting": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{{Code: to.Ptr(provisioningStateDeleting)}},
|
statuses: []*armcompute.InstanceViewStatus{{Code: to.Ptr(provisioningStateDeleting)}},
|
||||||
wantState: updatev1alpha1.NodeStateTerminating,
|
wantState: updatev1alpha1.NodeStateTerminating,
|
||||||
},
|
},
|
||||||
"provisioning succeeded (but no power state)": {
|
"provisioning succeeded (but no power state)": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{{Code: to.Ptr(provisioningStateSucceeded)}},
|
statuses: []*armcompute.InstanceViewStatus{{Code: to.Ptr(provisioningStateSucceeded)}},
|
||||||
wantState: updatev1alpha1.NodeStateUnknown,
|
wantState: updatev1alpha1.NodeStateUnknown,
|
||||||
},
|
},
|
||||||
"power starting": {
|
"power starting": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{
|
statuses: []*armcompute.InstanceViewStatus{
|
||||||
{Code: to.Ptr(provisioningStateSucceeded)},
|
{Code: to.Ptr(provisioningStateSucceeded)},
|
||||||
{Code: to.Ptr(powerStateStarting)},
|
{Code: to.Ptr(powerStateStarting)},
|
||||||
},
|
},
|
||||||
wantState: updatev1alpha1.NodeStateCreating,
|
wantState: updatev1alpha1.NodeStateCreating,
|
||||||
},
|
},
|
||||||
"power stopping": {
|
"power stopping": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{
|
statuses: []*armcompute.InstanceViewStatus{
|
||||||
{Code: to.Ptr(provisioningStateSucceeded)},
|
{Code: to.Ptr(provisioningStateSucceeded)},
|
||||||
{Code: to.Ptr(powerStateStopping)},
|
{Code: to.Ptr(powerStateStopping)},
|
||||||
},
|
},
|
||||||
wantState: updatev1alpha1.NodeStateStopped,
|
wantState: updatev1alpha1.NodeStateStopped,
|
||||||
},
|
},
|
||||||
"power stopped": {
|
"power stopped": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{
|
statuses: []*armcompute.InstanceViewStatus{
|
||||||
{Code: to.Ptr(provisioningStateSucceeded)},
|
{Code: to.Ptr(provisioningStateSucceeded)},
|
||||||
{Code: to.Ptr(powerStateStopped)},
|
{Code: to.Ptr(powerStateStopped)},
|
||||||
},
|
},
|
||||||
wantState: updatev1alpha1.NodeStateStopped,
|
wantState: updatev1alpha1.NodeStateStopped,
|
||||||
},
|
},
|
||||||
"power deallocating": {
|
"power deallocating": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{
|
statuses: []*armcompute.InstanceViewStatus{
|
||||||
{Code: to.Ptr(provisioningStateSucceeded)},
|
{Code: to.Ptr(provisioningStateSucceeded)},
|
||||||
{Code: to.Ptr(powerStateDeallocating)},
|
{Code: to.Ptr(powerStateDeallocating)},
|
||||||
},
|
},
|
||||||
wantState: updatev1alpha1.NodeStateStopped,
|
wantState: updatev1alpha1.NodeStateStopped,
|
||||||
},
|
},
|
||||||
"power deallocated": {
|
"power deallocated": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{
|
statuses: []*armcompute.InstanceViewStatus{
|
||||||
{Code: to.Ptr(provisioningStateSucceeded)},
|
{Code: to.Ptr(provisioningStateSucceeded)},
|
||||||
{Code: to.Ptr(powerStateDeallocated)},
|
{Code: to.Ptr(powerStateDeallocated)},
|
||||||
},
|
},
|
||||||
wantState: updatev1alpha1.NodeStateStopped,
|
wantState: updatev1alpha1.NodeStateStopped,
|
||||||
},
|
},
|
||||||
"power running": {
|
"power running": {
|
||||||
statuses: []*armcomputev2.InstanceViewStatus{
|
statuses: []*armcompute.InstanceViewStatus{
|
||||||
{Code: to.Ptr(provisioningStateSucceeded)},
|
{Code: to.Ptr(provisioningStateSucceeded)},
|
||||||
{Code: to.Ptr(powerStateRunning)},
|
{Code: to.Ptr(powerStateRunning)},
|
||||||
},
|
},
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetNodeImage returns the image name of the node.
|
// GetNodeImage returns the image name of the node.
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
"github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/internal/poller"
|
"github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/internal/poller"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
@ -22,17 +22,17 @@ import (
|
|||||||
func TestGetNodeImage(t *testing.T) {
|
func TestGetNodeImage(t *testing.T) {
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
providerID string
|
providerID string
|
||||||
vm armcomputev2.VirtualMachineScaleSetVM
|
vm armcompute.VirtualMachineScaleSetVM
|
||||||
getScaleSetVMErr error
|
getScaleSetVMErr error
|
||||||
wantImage string
|
wantImage string
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
"getting node image works": {
|
"getting node image works": {
|
||||||
providerID: "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id",
|
providerID: "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id",
|
||||||
vm: armcomputev2.VirtualMachineScaleSetVM{
|
vm: armcompute.VirtualMachineScaleSetVM{
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetVMProperties{
|
Properties: &armcompute.VirtualMachineScaleSetVMProperties{
|
||||||
StorageProfile: &armcomputev2.StorageProfile{
|
StorageProfile: &armcompute.StorageProfile{
|
||||||
ImageReference: &armcomputev2.ImageReference{
|
ImageReference: &armcompute.ImageReference{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/images/image-name"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/images/image-name"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -42,10 +42,10 @@ func TestGetNodeImage(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"getting community node image works": {
|
"getting community node image works": {
|
||||||
providerID: "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id",
|
providerID: "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id",
|
||||||
vm: armcomputev2.VirtualMachineScaleSetVM{
|
vm: armcompute.VirtualMachineScaleSetVM{
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetVMProperties{
|
Properties: &armcompute.VirtualMachineScaleSetVMProperties{
|
||||||
StorageProfile: &armcomputev2.StorageProfile{
|
StorageProfile: &armcompute.StorageProfile{
|
||||||
ImageReference: &armcomputev2.ImageReference{
|
ImageReference: &armcompute.ImageReference{
|
||||||
CommunityGalleryImageID: to.Ptr("/CommunityGalleries/gallery-name/Images/image-name/Versions/1.2.3"),
|
CommunityGalleryImageID: to.Ptr("/CommunityGalleries/gallery-name/Images/image-name/Versions/1.2.3"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -64,7 +64,7 @@ func TestGetNodeImage(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"scale set vm does not have valid image reference": {
|
"scale set vm does not have valid image reference": {
|
||||||
providerID: "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id",
|
providerID: "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id",
|
||||||
vm: armcomputev2.VirtualMachineScaleSetVM{},
|
vm: armcompute.VirtualMachineScaleSetVM{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ func TestGetNodeImage(t *testing.T) {
|
|||||||
|
|
||||||
client := Client{
|
client := Client{
|
||||||
virtualMachineScaleSetVMsAPI: &stubvirtualMachineScaleSetVMsAPI{
|
virtualMachineScaleSetVMsAPI: &stubvirtualMachineScaleSetVMsAPI{
|
||||||
scaleSetVM: armcomputev2.VirtualMachineScaleSetVMsClientGetResponse{
|
scaleSetVM: armcompute.VirtualMachineScaleSetVMsClientGetResponse{
|
||||||
VirtualMachineScaleSetVM: tc.vm,
|
VirtualMachineScaleSetVM: tc.vm,
|
||||||
},
|
},
|
||||||
getErr: tc.getScaleSetVMErr,
|
getErr: tc.getScaleSetVMErr,
|
||||||
@ -129,9 +129,9 @@ func TestGetScalingGroupID(t *testing.T) {
|
|||||||
func TestCreateNode(t *testing.T) {
|
func TestCreateNode(t *testing.T) {
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
scalingGroupID string
|
scalingGroupID string
|
||||||
sku *armcomputev2.SKU
|
sku *armcompute.SKU
|
||||||
preexistingVMs []armcomputev2.VirtualMachineScaleSetVM
|
preexistingVMs []armcompute.VirtualMachineScaleSetVM
|
||||||
newVM *armcomputev2.VirtualMachineScaleSetVM
|
newVM *armcompute.VirtualMachineScaleSetVM
|
||||||
fetchErr error
|
fetchErr error
|
||||||
pollErr error
|
pollErr error
|
||||||
getSKUCapacityErr error
|
getSKUCapacityErr error
|
||||||
@ -143,13 +143,13 @@ func TestCreateNode(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
"creating node works": {
|
"creating node works": {
|
||||||
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
||||||
sku: &armcomputev2.SKU{
|
sku: &armcompute.SKU{
|
||||||
Capacity: to.Ptr(int64(0)),
|
Capacity: to.Ptr(int64(0)),
|
||||||
},
|
},
|
||||||
newVM: &armcomputev2.VirtualMachineScaleSetVM{
|
newVM: &armcompute.VirtualMachineScaleSetVM{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/node-name"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/node-name"),
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetVMProperties{
|
Properties: &armcompute.VirtualMachineScaleSetVMProperties{
|
||||||
OSProfile: &armcomputev2.OSProfile{
|
OSProfile: &armcompute.OSProfile{
|
||||||
ComputerName: to.Ptr("node-name"),
|
ComputerName: to.Ptr("node-name"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -159,16 +159,16 @@ func TestCreateNode(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"creating node works with existing nodes": {
|
"creating node works with existing nodes": {
|
||||||
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
||||||
sku: &armcomputev2.SKU{
|
sku: &armcompute.SKU{
|
||||||
Capacity: to.Ptr(int64(1)),
|
Capacity: to.Ptr(int64(1)),
|
||||||
},
|
},
|
||||||
preexistingVMs: []armcomputev2.VirtualMachineScaleSetVM{
|
preexistingVMs: []armcompute.VirtualMachineScaleSetVM{
|
||||||
{ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/preexisting-node")},
|
{ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/preexisting-node")},
|
||||||
},
|
},
|
||||||
newVM: &armcomputev2.VirtualMachineScaleSetVM{
|
newVM: &armcompute.VirtualMachineScaleSetVM{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/new-node"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/new-node"),
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetVMProperties{
|
Properties: &armcompute.VirtualMachineScaleSetVMProperties{
|
||||||
OSProfile: &armcomputev2.OSProfile{
|
OSProfile: &armcompute.OSProfile{
|
||||||
ComputerName: to.Ptr("new-node"),
|
ComputerName: to.Ptr("new-node"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -196,19 +196,19 @@ func TestCreateNode(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"updating scale set capacity fails": {
|
"updating scale set capacity fails": {
|
||||||
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
||||||
sku: &armcomputev2.SKU{Capacity: to.Ptr(int64(0))},
|
sku: &armcompute.SKU{Capacity: to.Ptr(int64(0))},
|
||||||
updateScaleSetErr: errors.New("update scale set error"),
|
updateScaleSetErr: errors.New("update scale set error"),
|
||||||
wantEarlyErr: true,
|
wantEarlyErr: true,
|
||||||
},
|
},
|
||||||
"polling for increased capacity fails": {
|
"polling for increased capacity fails": {
|
||||||
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
||||||
sku: &armcomputev2.SKU{Capacity: to.Ptr(int64(0))},
|
sku: &armcompute.SKU{Capacity: to.Ptr(int64(0))},
|
||||||
pollErr: errors.New("poll error"),
|
pollErr: errors.New("poll error"),
|
||||||
wantLateErr: true,
|
wantLateErr: true,
|
||||||
},
|
},
|
||||||
"new node cannot be found": {
|
"new node cannot be found": {
|
||||||
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
||||||
sku: &armcomputev2.SKU{Capacity: to.Ptr(int64(0))},
|
sku: &armcompute.SKU{Capacity: to.Ptr(int64(0))},
|
||||||
wantLateErr: true,
|
wantLateErr: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -228,8 +228,8 @@ func TestCreateNode(t *testing.T) {
|
|||||||
pager: pager,
|
pager: pager,
|
||||||
},
|
},
|
||||||
scaleSetsAPI: &stubScaleSetsAPI{
|
scaleSetsAPI: &stubScaleSetsAPI{
|
||||||
scaleSet: armcomputev2.VirtualMachineScaleSetsClientGetResponse{
|
scaleSet: armcompute.VirtualMachineScaleSetsClientGetResponse{
|
||||||
VirtualMachineScaleSet: armcomputev2.VirtualMachineScaleSet{
|
VirtualMachineScaleSet: armcompute.VirtualMachineScaleSet{
|
||||||
SKU: tc.sku,
|
SKU: tc.sku,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -321,9 +321,9 @@ func TestCapacityPollingHandler(t *testing.T) {
|
|||||||
var gotCapacity int64
|
var gotCapacity int64
|
||||||
handler := capacityPollingHandler{
|
handler := capacityPollingHandler{
|
||||||
scaleSetsAPI: &stubScaleSetsAPI{
|
scaleSetsAPI: &stubScaleSetsAPI{
|
||||||
scaleSet: armcomputev2.VirtualMachineScaleSetsClientGetResponse{
|
scaleSet: armcompute.VirtualMachineScaleSetsClientGetResponse{
|
||||||
VirtualMachineScaleSet: armcomputev2.VirtualMachineScaleSet{
|
VirtualMachineScaleSet: armcompute.VirtualMachineScaleSet{
|
||||||
SKU: &armcomputev2.SKU{Capacity: to.Ptr(int64(0))},
|
SKU: &armcompute.SKU{Capacity: to.Ptr(int64(0))},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -344,7 +344,7 @@ func TestCapacityPollingHandler(t *testing.T) {
|
|||||||
assert.Error(handler.Poll(context.Background()))
|
assert.Error(handler.Poll(context.Background()))
|
||||||
|
|
||||||
// let Poll finish
|
// let Poll finish
|
||||||
handler.scaleSetsAPI.(*stubScaleSetsAPI).scaleSet.SKU = &armcomputev2.SKU{Capacity: to.Ptr(wantCapacity)}
|
handler.scaleSetsAPI.(*stubScaleSetsAPI).scaleSet.SKU = &armcompute.SKU{Capacity: to.Ptr(wantCapacity)}
|
||||||
assert.NoError(handler.Poll(context.Background()))
|
assert.NoError(handler.Poll(context.Background()))
|
||||||
assert.True(handler.Done())
|
assert.True(handler.Done())
|
||||||
assert.NoError(handler.Result(context.Background(), &gotCapacity))
|
assert.NoError(handler.Result(context.Background(), &gotCapacity))
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
updatev1alpha1 "github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/api/v1alpha1"
|
updatev1alpha1 "github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/api/v1alpha1"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
@ -23,15 +23,15 @@ import (
|
|||||||
func TestGetNodeState(t *testing.T) {
|
func TestGetNodeState(t *testing.T) {
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
providerID string
|
providerID string
|
||||||
instanceView armcomputev2.VirtualMachineScaleSetVMInstanceView
|
instanceView armcompute.VirtualMachineScaleSetVMInstanceView
|
||||||
getInstanceViewErr error
|
getInstanceViewErr error
|
||||||
wantState updatev1alpha1.CSPNodeState
|
wantState updatev1alpha1.CSPNodeState
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
"getting node state works": {
|
"getting node state works": {
|
||||||
providerID: "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id",
|
providerID: "azure:///subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name/virtualMachines/instance-id",
|
||||||
instanceView: armcomputev2.VirtualMachineScaleSetVMInstanceView{
|
instanceView: armcompute.VirtualMachineScaleSetVMInstanceView{
|
||||||
Statuses: []*armcomputev2.InstanceViewStatus{
|
Statuses: []*armcompute.InstanceViewStatus{
|
||||||
{Code: to.Ptr("ProvisioningState/succeeded")},
|
{Code: to.Ptr("ProvisioningState/succeeded")},
|
||||||
{Code: to.Ptr("PowerState/running")},
|
{Code: to.Ptr("PowerState/running")},
|
||||||
},
|
},
|
||||||
@ -61,7 +61,7 @@ func TestGetNodeState(t *testing.T) {
|
|||||||
|
|
||||||
client := Client{
|
client := Client{
|
||||||
virtualMachineScaleSetVMsAPI: &stubvirtualMachineScaleSetVMsAPI{
|
virtualMachineScaleSetVMsAPI: &stubvirtualMachineScaleSetVMsAPI{
|
||||||
instanceView: armcomputev2.VirtualMachineScaleSetVMsClientGetInstanceViewResponse{
|
instanceView: armcompute.VirtualMachineScaleSetVMsClientGetInstanceViewResponse{
|
||||||
VirtualMachineScaleSetVMInstanceView: tc.instanceView,
|
VirtualMachineScaleSetVMInstanceView: tc.instanceView,
|
||||||
},
|
},
|
||||||
instanceViewErr: tc.getInstanceViewErr,
|
instanceViewErr: tc.getInstanceViewErr,
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetScalingGroupImage returns the image URI of the scaling group.
|
// GetScalingGroupImage returns the image URI of the scaling group.
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
||||||
armcomputev2 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2"
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
@ -20,18 +20,18 @@ import (
|
|||||||
func TestGetScalingGroupImage(t *testing.T) {
|
func TestGetScalingGroupImage(t *testing.T) {
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
scalingGroupID string
|
scalingGroupID string
|
||||||
scaleSet armcomputev2.VirtualMachineScaleSet
|
scaleSet armcompute.VirtualMachineScaleSet
|
||||||
getScaleSetErr error
|
getScaleSetErr error
|
||||||
wantImage string
|
wantImage string
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
"getting image works": {
|
"getting image works": {
|
||||||
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
||||||
scaleSet: armcomputev2.VirtualMachineScaleSet{
|
scaleSet: armcompute.VirtualMachineScaleSet{
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetProperties{
|
Properties: &armcompute.VirtualMachineScaleSetProperties{
|
||||||
VirtualMachineProfile: &armcomputev2.VirtualMachineScaleSetVMProfile{
|
VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{
|
||||||
StorageProfile: &armcomputev2.VirtualMachineScaleSetStorageProfile{
|
StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{
|
||||||
ImageReference: &armcomputev2.ImageReference{
|
ImageReference: &armcompute.ImageReference{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/images/image-name"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/images/image-name"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -42,11 +42,11 @@ func TestGetScalingGroupImage(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"getting community image works": {
|
"getting community image works": {
|
||||||
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
scalingGroupID: "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-name",
|
||||||
scaleSet: armcomputev2.VirtualMachineScaleSet{
|
scaleSet: armcompute.VirtualMachineScaleSet{
|
||||||
Properties: &armcomputev2.VirtualMachineScaleSetProperties{
|
Properties: &armcompute.VirtualMachineScaleSetProperties{
|
||||||
VirtualMachineProfile: &armcomputev2.VirtualMachineScaleSetVMProfile{
|
VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{
|
||||||
StorageProfile: &armcomputev2.VirtualMachineScaleSetStorageProfile{
|
StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{
|
||||||
ImageReference: &armcomputev2.ImageReference{
|
ImageReference: &armcompute.ImageReference{
|
||||||
CommunityGalleryImageID: to.Ptr("/CommunityGalleries/gallery-name/Images/image-name/Versions/1.2.3"),
|
CommunityGalleryImageID: to.Ptr("/CommunityGalleries/gallery-name/Images/image-name/Versions/1.2.3"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -77,7 +77,7 @@ func TestGetScalingGroupImage(t *testing.T) {
|
|||||||
|
|
||||||
client := Client{
|
client := Client{
|
||||||
scaleSetsAPI: &stubScaleSetsAPI{
|
scaleSetsAPI: &stubScaleSetsAPI{
|
||||||
scaleSet: armcomputev2.VirtualMachineScaleSetsClientGetResponse{
|
scaleSet: armcompute.VirtualMachineScaleSetsClientGetResponse{
|
||||||
VirtualMachineScaleSet: tc.scaleSet,
|
VirtualMachineScaleSet: tc.scaleSet,
|
||||||
},
|
},
|
||||||
getErr: tc.getScaleSetErr,
|
getErr: tc.getScaleSetErr,
|
||||||
@ -184,14 +184,14 @@ func TestGetScalingGroupName(t *testing.T) {
|
|||||||
|
|
||||||
func TestListScalingGroups(t *testing.T) {
|
func TestListScalingGroups(t *testing.T) {
|
||||||
testCases := map[string]struct {
|
testCases := map[string]struct {
|
||||||
scaleSet armcomputev2.VirtualMachineScaleSet
|
scaleSet armcompute.VirtualMachineScaleSet
|
||||||
fetchPageErr error
|
fetchPageErr error
|
||||||
wantControlPlanes []string
|
wantControlPlanes []string
|
||||||
wantWorkers []string
|
wantWorkers []string
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
"listing control-plane works": {
|
"listing control-plane works": {
|
||||||
scaleSet: armcomputev2.VirtualMachineScaleSet{
|
scaleSet: armcompute.VirtualMachineScaleSet{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/constellation-scale-set-control-planes-uid"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/constellation-scale-set-control-planes-uid"),
|
||||||
Tags: map[string]*string{
|
Tags: map[string]*string{
|
||||||
"constellation-uid": to.Ptr("uid"),
|
"constellation-uid": to.Ptr("uid"),
|
||||||
@ -201,7 +201,7 @@ func TestListScalingGroups(t *testing.T) {
|
|||||||
wantControlPlanes: []string{"/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/constellation-scale-set-control-planes-uid"},
|
wantControlPlanes: []string{"/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/constellation-scale-set-control-planes-uid"},
|
||||||
},
|
},
|
||||||
"listing worker works": {
|
"listing worker works": {
|
||||||
scaleSet: armcomputev2.VirtualMachineScaleSet{
|
scaleSet: armcompute.VirtualMachineScaleSet{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/constellation-scale-set-workers-uid"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/constellation-scale-set-workers-uid"),
|
||||||
Tags: map[string]*string{
|
Tags: map[string]*string{
|
||||||
"constellation-uid": to.Ptr("uid"),
|
"constellation-uid": to.Ptr("uid"),
|
||||||
@ -211,7 +211,7 @@ func TestListScalingGroups(t *testing.T) {
|
|||||||
wantWorkers: []string{"/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/constellation-scale-set-workers-uid"},
|
wantWorkers: []string{"/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/constellation-scale-set-workers-uid"},
|
||||||
},
|
},
|
||||||
"listing is not dependent on resource name": {
|
"listing is not dependent on resource name": {
|
||||||
scaleSet: armcomputev2.VirtualMachineScaleSet{
|
scaleSet: armcompute.VirtualMachineScaleSet{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/some-scale-set"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/some-scale-set"),
|
||||||
Tags: map[string]*string{
|
Tags: map[string]*string{
|
||||||
"constellation-uid": to.Ptr("uid"),
|
"constellation-uid": to.Ptr("uid"),
|
||||||
@ -221,7 +221,7 @@ func TestListScalingGroups(t *testing.T) {
|
|||||||
wantControlPlanes: []string{"/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/some-scale-set"},
|
wantControlPlanes: []string{"/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/some-scale-set"},
|
||||||
},
|
},
|
||||||
"listing other works": {
|
"listing other works": {
|
||||||
scaleSet: armcomputev2.VirtualMachineScaleSet{
|
scaleSet: armcompute.VirtualMachineScaleSet{
|
||||||
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/other"),
|
ID: to.Ptr("/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/other"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -240,7 +240,7 @@ func TestListScalingGroups(t *testing.T) {
|
|||||||
client := Client{
|
client := Client{
|
||||||
scaleSetsAPI: &stubScaleSetsAPI{
|
scaleSetsAPI: &stubScaleSetsAPI{
|
||||||
pager: &stubVMSSPager{
|
pager: &stubVMSSPager{
|
||||||
list: []armcomputev2.VirtualMachineScaleSet{tc.scaleSet},
|
list: []armcompute.VirtualMachineScaleSet{tc.scaleSet},
|
||||||
fetchErr: tc.fetchPageErr,
|
fetchErr: tc.fetchPageErr,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user