From 0817d1a6d6dc31fc1a7d4764a4c80085d3cb3a03 Mon Sep 17 00:00:00 2001 From: Nilesh-chaudhary Date: Tue, 17 Oct 2023 00:25:36 +0530 Subject: [PATCH 01/10] Added missing test coverage for azureimage_validation.go --- api/v1beta1/azureimage_validation_test.go | 65 +++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/api/v1beta1/azureimage_validation_test.go b/api/v1beta1/azureimage_validation_test.go index 878f9164c4b..d76ae43ebd5 100644 --- a/api/v1beta1/azureimage_validation_test.go +++ b/api/v1beta1/azureimage_validation_test.go @@ -223,3 +223,68 @@ func createTestImageByID(imageID string) *Image { ID: &imageID, } } + +func TestValidateSingleDetailsOnly(t *testing.T) { + testCases := map[string]struct { + image *Image + expectedErrors field.ErrorList + }{ + "image.Marketplace != nil, image details are found": { + image: &Image{ + ID: ptr.To("ID1234"), + Marketplace: &AzureMarketplaceImage{ + ImagePlan: ImagePlan{ + Offer: "OFFER", + Publisher: "PUBLISHER", + SKU: "SKU", + }, + Version: "1.0.0", + }, + }, + expectedErrors: field.ErrorList{ + { + Type: "FieldValueForbidden", + Field: "image.Marketplace", + BadValue: "", + Detail: "Marketplace cannot be used as an image ID has been specified", + }, + }, + }, + "image.Marketplace == nil, image.ComputeGallery != nil, image details are found": { + image: &Image{ + ID: ptr.To("ID1234"), + ComputeGallery: &AzureComputeGalleryImage{ + Name: "IMAGENAME", + Gallery: "GALLERY9876", + Version: "1.0.0", + SubscriptionID: ptr.To("SUB1234"), + ResourceGroup: ptr.To("RG1234"), + }, + }, + expectedErrors: field.ErrorList{ + { + Type: "FieldValueForbidden", + Field: "image.ComputeGallery", + BadValue: "", + Detail: "ComputeGallery cannot be used as an image ID. Marketplace or SharedGallery images has been specified", + }, + }, + }, + "image.Marketplace == nil, image.ComputeGallery == nil, image details not found": { + image: &Image{}, + expectedErrors: field.ErrorList{ + { + Type: "FieldValueRequired", + Field: "image", + BadValue: "", + Detail: "You must supply an ID, Marketplace or ComputeGallery image details", + }, + }, + }, + } + + for _, tc := range testCases { + g := NewWithT(t) + g.Expect(ValidateImage(tc.image, field.NewPath("image"))).To(Equal(tc.expectedErrors)) + } +} From fe9482c3cad82d2f76a508564a48122a45eb2a69 Mon Sep 17 00:00:00 2001 From: Cecile Robert-Michon Date: Tue, 12 Dec 2023 21:24:31 +0000 Subject: [PATCH 02/10] Add release notes for v1.12.1 --- CHANGELOG/release-notes-v1.12.1.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 CHANGELOG/release-notes-v1.12.1.md diff --git a/CHANGELOG/release-notes-v1.12.1.md b/CHANGELOG/release-notes-v1.12.1.md new file mode 100644 index 00000000000..6959257de7f --- /dev/null +++ b/CHANGELOG/release-notes-v1.12.1.md @@ -0,0 +1,23 @@ +## Changes by Kind + +### Other (Cleanup or Flake) + +- Bump CAPI to v1.5.4 (#4344, @mboersma) + +### Uncategorized + +- Support AKS BYOCNI by allowing networkPlugin: none (#4318, @illrill) + +## Dependencies + +### Added +_Nothing has changed._ + +### Changed +- github.com/felixge/httpsnoop: [v1.0.3 → v1.0.4](https://github.com/felixge/httpsnoop/compare/v1.0.3...v1.0.4) +- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.44.0 → v0.46.0 +- sigs.k8s.io/cluster-api/test: v1.5.3 → v1.5.4 +- sigs.k8s.io/cluster-api: v1.5.3 → v1.5.4 + +### Removed +_Nothing has changed._ From 9952488e97c0b1761e43e6fbea30e046fb498656 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Tue, 12 Dec 2023 17:42:07 -0600 Subject: [PATCH 03/10] ASO: Return readyErr over not done err when tags fail --- azure/services/aso/aso.go | 3 ++ azure/services/aso/aso_test.go | 65 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/azure/services/aso/aso.go b/azure/services/aso/aso.go index e8f14ee8912..dfc6a6846f7 100644 --- a/azure/services/aso/aso.go +++ b/azure/services/aso/aso.go @@ -152,6 +152,9 @@ func (r *reconciler[T]) CreateOrUpdateResource(ctx context.Context, spec azure.A if t, ok := spec.(TagsGetterSetter[T]); ok { if err := reconcileTags(t, existing, resourceExists, parameters); err != nil { + if azure.IsOperationNotDoneError(err) && readyErr != nil { + return zero, readyErr + } return zero, errors.Wrap(err, "failed to reconcile tags") } } diff --git a/azure/services/aso/aso_test.go b/azure/services/aso/aso_test.go index 9481038f6ed..a96bc95112b 100644 --- a/azure/services/aso/aso_test.go +++ b/azure/services/aso/aso_test.go @@ -823,6 +823,71 @@ func TestCreateOrUpdateResource(t *testing.T) { g.Expect(err.Error()).To(ContainSubstring("failed to reconcile tags")) }) + t.Run("with tags not done error and readyErr", func(t *testing.T) { + g := NewGomegaWithT(t) + + sch := runtime.NewScheme() + g.Expect(asoresourcesv1.AddToScheme(sch)).To(Succeed()) + c := fakeclient.NewClientBuilder(). + WithScheme(sch). + Build() + s := New[*asoresourcesv1.ResourceGroup](c, clusterName) + + mockCtrl := gomock.NewController(t) + specMock := struct { + *mock_azure.MockASOResourceSpecGetter[*asoresourcesv1.ResourceGroup] + *mock_aso.MockTagsGetterSetter[*asoresourcesv1.ResourceGroup] + }{ + MockASOResourceSpecGetter: mock_azure.NewMockASOResourceSpecGetter[*asoresourcesv1.ResourceGroup](mockCtrl), + MockTagsGetterSetter: mock_aso.NewMockTagsGetterSetter[*asoresourcesv1.ResourceGroup](mockCtrl), + } + specMock.MockASOResourceSpecGetter.EXPECT().ResourceRef().Return(&asoresourcesv1.ResourceGroup{ + ObjectMeta: metav1.ObjectMeta{ + Name: "name", + Namespace: "namespace", + }, + }) + specMock.MockASOResourceSpecGetter.EXPECT().Parameters(gomockinternal.AContext(), gomock.Any()).DoAndReturn(func(_ context.Context, group *asoresourcesv1.ResourceGroup) (*asoresourcesv1.ResourceGroup, error) { + return group, nil + }) + + existing := &asoresourcesv1.ResourceGroup{ + ObjectMeta: metav1.ObjectMeta{ + Name: "name", + Namespace: "namespace", + Labels: map[string]string{ + infrav1.OwnedByClusterLabelKey: clusterName, + }, + Annotations: map[string]string{ + asoannotations.ReconcilePolicy: string(asoannotations.ReconcilePolicyManage), + }, + }, + Spec: asoresourcesv1.ResourceGroup_Spec{ + Tags: map[string]string{"desired": "tags"}, + }, + Status: asoresourcesv1.ResourceGroup_STATUS{ + Tags: map[string]string{"actual": "tags"}, + Conditions: []conditions.Condition{ + { + Type: conditions.ConditionTypeReady, + Status: metav1.ConditionFalse, + Message: "not ready :(", + }, + }, + }, + } + + specMock.MockTagsGetterSetter.EXPECT().GetActualTags(gomock.Any()).Return(existing.Status.Tags) + specMock.MockTagsGetterSetter.EXPECT().GetDesiredTags(gomock.Any()).Return(existing.Spec.Tags) + + ctx := context.Background() + g.Expect(c.Create(ctx, existing)).To(Succeed()) + + result, err := s.CreateOrUpdateResource(ctx, specMock, "service") + g.Expect(result).To(BeNil()) + g.Expect(err.Error()).To(ContainSubstring("not ready :(")) + }) + t.Run("reconcile policy annotation resets after un-pause", func(t *testing.T) { g := NewGomegaWithT(t) From 7e27abee417e175c3921fe65ca73e009c345ddf2 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Thu, 7 Dec 2023 17:33:24 -0600 Subject: [PATCH 04/10] update ASO managed clusters to 20231001 --- api/v1beta1/azuremanagedmachinepool_webhook_test.go | 2 +- azure/converters/managedagentpool.go | 2 +- azure/converters/managedagentpool_test.go | 2 +- azure/scope/managedcontrolplane.go | 2 +- azure/scope/managedcontrolplane_test.go | 2 +- azure/scope/managedmachinepool.go | 2 +- azure/scope/managedmachinepool_test.go | 2 +- azure/services/agentpools/agentpools.go | 2 +- azure/services/agentpools/agentpools_test.go | 2 +- .../services/agentpools/mock_agentpools/agentpools_mock.go | 6 +++--- azure/services/agentpools/spec.go | 2 +- azure/services/agentpools/spec_test.go | 2 +- azure/services/managedclusters/managedclusters.go | 2 +- azure/services/managedclusters/managedclusters_test.go | 2 +- .../mock_managedclusters/managedclusters_mock.go | 6 +++--- azure/services/managedclusters/spec.go | 4 ++-- azure/services/managedclusters/spec_test.go | 4 ++-- controllers/azuremanagedcontrolplane_controller_test.go | 2 +- main.go | 2 +- 19 files changed, 25 insertions(+), 25 deletions(-) diff --git a/api/v1beta1/azuremanagedmachinepool_webhook_test.go b/api/v1beta1/azuremanagedmachinepool_webhook_test.go index 5aa197d876d..7853ddaa983 100644 --- a/api/v1beta1/azuremanagedmachinepool_webhook_test.go +++ b/api/v1beta1/azuremanagedmachinepool_webhook_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/azure/converters/managedagentpool.go b/azure/converters/managedagentpool.go index 3dc51f13f6b..13a642bb559 100644 --- a/azure/converters/managedagentpool.go +++ b/azure/converters/managedagentpool.go @@ -17,7 +17,7 @@ limitations under the License. package converters import ( - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "k8s.io/utils/ptr" ) diff --git a/azure/converters/managedagentpool_test.go b/azure/converters/managedagentpool_test.go index 3fa22ebfaf9..da19f15763c 100644 --- a/azure/converters/managedagentpool_test.go +++ b/azure/converters/managedagentpool_test.go @@ -19,7 +19,7 @@ package converters import ( "testing" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" . "github.com/onsi/gomega" "k8s.io/utils/ptr" diff --git a/azure/scope/managedcontrolplane.go b/azure/scope/managedcontrolplane.go index 3f92ea9ef80..1244af52b5e 100644 --- a/azure/scope/managedcontrolplane.go +++ b/azure/scope/managedcontrolplane.go @@ -23,7 +23,7 @@ import ( "strings" "time" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" asonetworkv1 "github.com/Azure/azure-service-operator/v2/api/network/v1api20220701" asoresourcesv1 "github.com/Azure/azure-service-operator/v2/api/resources/v1api20200601" "github.com/pkg/errors" diff --git a/azure/scope/managedcontrolplane_test.go b/azure/scope/managedcontrolplane_test.go index f4c9b7df62b..36f06a1db9f 100644 --- a/azure/scope/managedcontrolplane_test.go +++ b/azure/scope/managedcontrolplane_test.go @@ -21,7 +21,7 @@ import ( "reflect" "testing" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" asonetworkv1 "github.com/Azure/azure-service-operator/v2/api/network/v1api20220701" "github.com/Azure/go-autorest/autorest" . "github.com/onsi/gomega" diff --git a/azure/scope/managedmachinepool.go b/azure/scope/managedmachinepool.go index af279a48a75..4e905f9af95 100644 --- a/azure/scope/managedmachinepool.go +++ b/azure/scope/managedmachinepool.go @@ -21,7 +21,7 @@ import ( "fmt" "strings" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "github.com/pkg/errors" "k8s.io/utils/ptr" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" diff --git a/azure/scope/managedmachinepool_test.go b/azure/scope/managedmachinepool_test.go index ff692ee0c5a..ec4970e02d7 100644 --- a/azure/scope/managedmachinepool_test.go +++ b/azure/scope/managedmachinepool_test.go @@ -21,7 +21,7 @@ import ( "reflect" "testing" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "github.com/google/go-cmp/cmp" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/azure/services/agentpools/agentpools.go b/azure/services/agentpools/agentpools.go index e95f3b287fa..817129ec6c1 100644 --- a/azure/services/agentpools/agentpools.go +++ b/azure/services/agentpools/agentpools.go @@ -19,7 +19,7 @@ package agentpools import ( "context" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "k8s.io/utils/ptr" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure" diff --git a/azure/services/agentpools/agentpools_test.go b/azure/services/agentpools/agentpools_test.go index 7d4c4869729..0fb2e32c181 100644 --- a/azure/services/agentpools/agentpools_test.go +++ b/azure/services/agentpools/agentpools_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" . "github.com/onsi/gomega" "github.com/pkg/errors" "go.uber.org/mock/gomock" diff --git a/azure/services/agentpools/mock_agentpools/agentpools_mock.go b/azure/services/agentpools/mock_agentpools/agentpools_mock.go index f727e3132cc..926944947d8 100644 --- a/azure/services/agentpools/mock_agentpools/agentpools_mock.go +++ b/azure/services/agentpools/mock_agentpools/agentpools_mock.go @@ -28,7 +28,7 @@ import ( reflect "reflect" azcore "github.com/Azure/azure-sdk-for-go/sdk/azcore" - v1api20230201 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + v1api20231001 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" gomock "go.uber.org/mock/gomock" v1beta1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" azure "sigs.k8s.io/cluster-api-provider-azure/azure" @@ -74,10 +74,10 @@ func (mr *MockAgentPoolScopeMockRecorder) AdditionalTags() *gomock.Call { } // AgentPoolSpec mocks base method. -func (m *MockAgentPoolScope) AgentPoolSpec() azure.ASOResourceSpecGetter[*v1api20230201.ManagedClustersAgentPool] { +func (m *MockAgentPoolScope) AgentPoolSpec() azure.ASOResourceSpecGetter[*v1api20231001.ManagedClustersAgentPool] { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AgentPoolSpec") - ret0, _ := ret[0].(azure.ASOResourceSpecGetter[*v1api20230201.ManagedClustersAgentPool]) + ret0, _ := ret[0].(azure.ASOResourceSpecGetter[*v1api20231001.ManagedClustersAgentPool]) return ret0 } diff --git a/azure/services/agentpools/spec.go b/azure/services/agentpools/spec.go index 3bbe0a95139..5d4a2e98ff0 100644 --- a/azure/services/agentpools/spec.go +++ b/azure/services/agentpools/spec.go @@ -19,7 +19,7 @@ package agentpools import ( "context" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/azure/services/agentpools/spec_test.go b/azure/services/agentpools/spec_test.go index ee7de24021d..18031bcefb7 100644 --- a/azure/services/agentpools/spec_test.go +++ b/azure/services/agentpools/spec_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/google/go-cmp/cmp" . "github.com/onsi/gomega" diff --git a/azure/services/managedclusters/managedclusters.go b/azure/services/managedclusters/managedclusters.go index 293281ca381..57888638170 100644 --- a/azure/services/managedclusters/managedclusters.go +++ b/azure/services/managedclusters/managedclusters.go @@ -19,7 +19,7 @@ package managedclusters import ( "context" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/client-go/tools/clientcmd" diff --git a/azure/services/managedclusters/managedclusters_test.go b/azure/services/managedclusters/managedclusters_test.go index 72724776b67..27bcc8600ba 100644 --- a/azure/services/managedclusters/managedclusters_test.go +++ b/azure/services/managedclusters/managedclusters_test.go @@ -21,7 +21,7 @@ import ( "errors" "testing" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" . "github.com/onsi/gomega" "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" diff --git a/azure/services/managedclusters/mock_managedclusters/managedclusters_mock.go b/azure/services/managedclusters/mock_managedclusters/managedclusters_mock.go index 14dbc01a3e6..b83690742d9 100644 --- a/azure/services/managedclusters/mock_managedclusters/managedclusters_mock.go +++ b/azure/services/managedclusters/mock_managedclusters/managedclusters_mock.go @@ -29,7 +29,7 @@ import ( reflect "reflect" azcore "github.com/Azure/azure-sdk-for-go/sdk/azcore" - v1api20230201 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + v1api20231001 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" gomock "go.uber.org/mock/gomock" v1 "k8s.io/api/core/v1" v1beta1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" @@ -270,10 +270,10 @@ func (mr *MockManagedClusterScopeMockRecorder) MakeEmptyKubeConfigSecret() *gomo } // ManagedClusterSpec mocks base method. -func (m *MockManagedClusterScope) ManagedClusterSpec() azure.ASOResourceSpecGetter[*v1api20230201.ManagedCluster] { +func (m *MockManagedClusterScope) ManagedClusterSpec() azure.ASOResourceSpecGetter[*v1api20231001.ManagedCluster] { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ManagedClusterSpec") - ret0, _ := ret[0].(azure.ASOResourceSpecGetter[*v1api20230201.ManagedCluster]) + ret0, _ := ret[0].(azure.ASOResourceSpecGetter[*v1api20231001.ManagedCluster]) return ret0 } diff --git a/azure/services/managedclusters/spec.go b/azure/services/managedclusters/spec.go index fa939bfcaa2..b7330099ccb 100644 --- a/azure/services/managedclusters/spec.go +++ b/azure/services/managedclusters/spec.go @@ -22,7 +22,7 @@ import ( "fmt" "net" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -330,7 +330,7 @@ func (s *ManagedClusterSpec) Parameters(ctx context.Context, existing *asocontai ClientId: ptr.To("msi"), } managedCluster.Spec.NetworkProfile = &asocontainerservicev1.ContainerServiceNetworkProfile{ - NetworkPlugin: azure.AliasOrNil[asocontainerservicev1.ContainerServiceNetworkProfile_NetworkPlugin](&s.NetworkPlugin), + NetworkPlugin: azure.AliasOrNil[asocontainerservicev1.NetworkPlugin](&s.NetworkPlugin), LoadBalancerSku: azure.AliasOrNil[asocontainerservicev1.ContainerServiceNetworkProfile_LoadBalancerSku](&s.LoadBalancerSKU), NetworkPolicy: azure.AliasOrNil[asocontainerservicev1.ContainerServiceNetworkProfile_NetworkPolicy](&s.NetworkPolicy), } diff --git a/azure/services/managedclusters/spec_test.go b/azure/services/managedclusters/spec_test.go index ad032b45e8a..a64bf9cc022 100644 --- a/azure/services/managedclusters/spec_test.go +++ b/azure/services/managedclusters/spec_test.go @@ -21,7 +21,7 @@ import ( "encoding/base64" "testing" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/google/go-cmp/cmp" . "github.com/onsi/gomega" @@ -193,7 +193,7 @@ func TestParameters(t *testing.T) { }, }, LoadBalancerSku: ptr.To(asocontainerservicev1.ContainerServiceNetworkProfile_LoadBalancerSku("lb sku")), - NetworkPlugin: ptr.To(asocontainerservicev1.ContainerServiceNetworkProfile_NetworkPlugin("network plugin")), + NetworkPlugin: ptr.To(asocontainerservicev1.NetworkPlugin("network plugin")), NetworkPluginMode: ptr.To(asocontainerservicev1.ContainerServiceNetworkProfile_NetworkPluginMode("network plugin mode")), NetworkPolicy: ptr.To(asocontainerservicev1.ContainerServiceNetworkProfile_NetworkPolicy("network policy")), OutboundType: ptr.To(asocontainerservicev1.ContainerServiceNetworkProfile_OutboundType("outbound type")), diff --git a/controllers/azuremanagedcontrolplane_controller_test.go b/controllers/azuremanagedcontrolplane_controller_test.go index e2ae2da6361..c3a7bdbc7b2 100644 --- a/controllers/azuremanagedcontrolplane_controller_test.go +++ b/controllers/azuremanagedcontrolplane_controller_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" asoresourcesv1 "github.com/Azure/azure-service-operator/v2/api/resources/v1api20200601" . "github.com/onsi/gomega" "go.uber.org/mock/gomock" diff --git a/main.go b/main.go index c420cccb9af..d0fa1a723d5 100644 --- a/main.go +++ b/main.go @@ -27,7 +27,7 @@ import ( // +kubebuilder:scaffold:imports aadpodv1 "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1" - asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20230201" + asocontainerservicev1 "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20231001" asonetworkv1 "github.com/Azure/azure-service-operator/v2/api/network/v1api20220701" asoresourcesv1 "github.com/Azure/azure-service-operator/v2/api/resources/v1api20200601" "github.com/spf13/pflag" From 849d35d0b0fdddc0392cb7956cbeb270243934d4 Mon Sep 17 00:00:00 2001 From: Julien Klaer Date: Mon, 6 Nov 2023 19:34:09 +0100 Subject: [PATCH 05/10] docs: bringing clarity regarding Azure CNI usage with CAPZ --- docs/book/src/topics/addons.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/book/src/topics/addons.md b/docs/book/src/topics/addons.md index 98893d2c0e0..a1f3790b9af 100644 --- a/docs/book/src/topics/addons.md +++ b/docs/book/src/topics/addons.md @@ -279,6 +279,22 @@ The following resources need to be updated when using `capi-quickstart.yaml` (th . ``` +### Disable Azure network discovery (if using custom images without image-builder) + +By default, Azure assigns secondary IP Configurations to the host OS. + +This behavior interfere with Azure CNI who needs those free to allocate them to pod netns's/veth's. + +Simply create a file in `/etc/cloud/cloud.cfg.d/15_azure-vnet.cfg` with: +```yaml +datasource: + Azure: + apply_network_config: false +``` + +For more information, here's a [link](https://github.com/kubernetes-sigs/image-builder/pull/1090) to the entire discussion for context. + + # External Cloud Provider The "external" or "out-of-tree" cloud provider for Azure is the recommended cloud provider for CAPZ clusters. The "in-tree" cloud provider has been deprecated since v1.20 and only bug fixes are allowed in its Kubernetes repository directory. From e7a122e971c234fc39ff4c7d807df7851e59ec64 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Wed, 13 Dec 2023 10:56:18 -0600 Subject: [PATCH 06/10] Add test, comment, cleanup for DNSPrefix webhook fix --- .../azuremanagedcontrolplane_default.go | 3 +- .../azuremanagedcontrolplane_webhook.go | 33 ++++++++++--------- .../azuremanagedcontrolplane_webhook_test.go | 23 +++++++++++++ 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/api/v1beta1/azuremanagedcontrolplane_default.go b/api/v1beta1/azuremanagedcontrolplane_default.go index b8def0f6322..f4b0cd4f4c6 100644 --- a/api/v1beta1/azuremanagedcontrolplane_default.go +++ b/api/v1beta1/azuremanagedcontrolplane_default.go @@ -19,7 +19,6 @@ package v1beta1 import ( "encoding/base64" "fmt" - "reflect" "strings" "golang.org/x/crypto/ssh" @@ -195,7 +194,7 @@ func (m *AzureManagedControlPlane) setDefaultOIDCIssuerProfile() { } func (m *AzureManagedControlPlane) setDefaultDNSPrefix() { - if reflect.ValueOf(m.Spec.DNSPrefix).IsZero() { + if m.Spec.DNSPrefix == nil { m.Spec.DNSPrefix = ptr.To(m.Name) } } diff --git a/api/v1beta1/azuremanagedcontrolplane_webhook.go b/api/v1beta1/azuremanagedcontrolplane_webhook.go index 3a8c853da88..3285c059143 100644 --- a/api/v1beta1/azuremanagedcontrolplane_webhook.go +++ b/api/v1beta1/azuremanagedcontrolplane_webhook.go @@ -207,22 +207,23 @@ func (mw *azureManagedControlPlaneWebhook) ValidateUpdate(ctx context.Context, o allErrs = append(allErrs, err) } - oldDNSPrefix := old.Spec.DNSPrefix - newDNSPrefix := m.Spec.DNSPrefix - if reflect.ValueOf(oldDNSPrefix).IsZero() { - oldDNSPrefix = ptr.To(old.Name) - } - - if reflect.ValueOf(newDNSPrefix).IsZero() { - newDNSPrefix = ptr.To(m.Name) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("Spec", "DNSPrefix"), - oldDNSPrefix, - newDNSPrefix, - ); err != nil { - allErrs = append(allErrs, err) + // This nil check is only to streamline tests from having to define this correctly in every test case. + // Normally, the defaulting webhooks will always set the new DNSPrefix so users can never entirely unset it. + if m.Spec.DNSPrefix != nil { + // Pre-1.12 versions of CAPZ do not set this field while 1.12+ defaults it, so emulate the current + // defaulting here to avoid unrelated updates from failing this immutability check due to the + // nil -> non-nil transition. + oldDNSPrefix := old.Spec.DNSPrefix + if oldDNSPrefix == nil { + oldDNSPrefix = ptr.To(old.Name) + } + if err := webhookutils.ValidateImmutable( + field.NewPath("Spec", "DNSPrefix"), + oldDNSPrefix, + m.Spec.DNSPrefix, + ); err != nil { + allErrs = append(allErrs, err) + } } // Consider removing this once moves out of preview diff --git a/api/v1beta1/azuremanagedcontrolplane_webhook_test.go b/api/v1beta1/azuremanagedcontrolplane_webhook_test.go index a8ca849dedc..3c695a57a8e 100644 --- a/api/v1beta1/azuremanagedcontrolplane_webhook_test.go +++ b/api/v1beta1/azuremanagedcontrolplane_webhook_test.go @@ -2559,6 +2559,29 @@ func TestAzureManagedControlPlane_ValidateUpdate(t *testing.T) { }, wantErr: true, }, + { + name: "AzureManagedControlPlane DNSPrefix can be updated from nil when resource name matches", + oldAMCP: &AzureManagedControlPlane{ + ObjectMeta: metav1.ObjectMeta{ + Name: "capz-aks", + }, + Spec: AzureManagedControlPlaneSpec{ + DNSPrefix: nil, + AzureManagedControlPlaneClassSpec: AzureManagedControlPlaneClassSpec{ + Version: "v1.18.0", + }, + }, + }, + amcp: &AzureManagedControlPlane{ + Spec: AzureManagedControlPlaneSpec{ + DNSPrefix: ptr.To("capz-aks"), + AzureManagedControlPlaneClassSpec: AzureManagedControlPlaneClassSpec{ + Version: "v1.18.0", + }, + }, + }, + wantErr: false, + }, { name: "DisableLocalAccounts cannot be set for non AAD clusters", oldAMCP: &AzureManagedControlPlane{ From 79d1d4aa80815b53de808810b31565451bfc6aee Mon Sep 17 00:00:00 2001 From: Cecile Robert-Michon Date: Wed, 13 Dec 2023 18:47:38 +0000 Subject: [PATCH 07/10] Add release notes for v1.12.1 (fixed) --- CHANGELOG/v1.12.1.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 CHANGELOG/v1.12.1.md diff --git a/CHANGELOG/v1.12.1.md b/CHANGELOG/v1.12.1.md new file mode 100644 index 00000000000..3d3bd0827eb --- /dev/null +++ b/CHANGELOG/v1.12.1.md @@ -0,0 +1,24 @@ +## Changes by Kind + +### Bug or Regression + +- Fix: DNSPrefix error on existing tenant cluster (#4368, @mihaiandreiratoiu) +- Support AKS BYOCNI by allowing networkPlugin: none (#4318, @illrill) + +### Other (Cleanup or Flake) + +- Bump CAPI to v1.5.4 (#4344, @mboersma) + +## Dependencies + +### Added +_Nothing has changed._ + +### Changed +- github.com/felixge/httpsnoop: [v1.0.3 → v1.0.4](https://github.com/felixge/httpsnoop/compare/v1.0.3...v1.0.4) +- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.44.0 → v0.46.0 +- sigs.k8s.io/cluster-api/test: v1.5.3 → v1.5.4 +- sigs.k8s.io/cluster-api: v1.5.3 → v1.5.4 + +### Removed +_Nothing has changed._ From e5184f1aac961fbf2663d311636e6b3c26f3307b Mon Sep 17 00:00:00 2001 From: Cecile Robert-Michon Date: Tue, 12 Dec 2023 21:58:06 +0000 Subject: [PATCH 08/10] Fix release-notes make target to work with new process --- CHANGELOG/release-notes-v1.12.1.md | 23 ----------------------- Makefile | 23 +++++++++++++++++------ docs/book/src/developers/releasing.md | 12 +++++++++--- 3 files changed, 26 insertions(+), 32 deletions(-) delete mode 100644 CHANGELOG/release-notes-v1.12.1.md diff --git a/CHANGELOG/release-notes-v1.12.1.md b/CHANGELOG/release-notes-v1.12.1.md deleted file mode 100644 index 6959257de7f..00000000000 --- a/CHANGELOG/release-notes-v1.12.1.md +++ /dev/null @@ -1,23 +0,0 @@ -## Changes by Kind - -### Other (Cleanup or Flake) - -- Bump CAPI to v1.5.4 (#4344, @mboersma) - -### Uncategorized - -- Support AKS BYOCNI by allowing networkPlugin: none (#4318, @illrill) - -## Dependencies - -### Added -_Nothing has changed._ - -### Changed -- github.com/felixge/httpsnoop: [v1.0.3 → v1.0.4](https://github.com/felixge/httpsnoop/compare/v1.0.3...v1.0.4) -- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.44.0 → v0.46.0 -- sigs.k8s.io/cluster-api/test: v1.5.3 → v1.5.4 -- sigs.k8s.io/cluster-api: v1.5.3 → v1.5.4 - -### Removed -_Nothing has changed._ diff --git a/Makefile b/Makefile index 6bb6cca68dc..7889eec537d 100644 --- a/Makefile +++ b/Makefile @@ -583,15 +583,24 @@ RELEASE_TAG ?= $(shell git describe --abbrev=0 2>/dev/null) ifneq (,$(findstring -,$(RELEASE_TAG))) PRE_RELEASE=true endif +FULL_VERSION := $(RELEASE_TAG:v%=%) +MINOR_VERSION := $(shell v='$(FULL_VERSION)'; echo "$${v%.*}") +PATCH_VERSION := $(shell v='$(FULL_VERSION)'; echo "$${v##*.}") +# if the release tag is a .0 version, use the main branch +ifeq ($(PATCH_VERSION),0) + RELEASE_BRANCH ?= main +else + RELEASE_BRANCH ?= release-$(MINOR_VERSION) +endif # the previous release tag, e.g., v0.3.9, excluding pre-release tags -PREVIOUS_TAG ?= $(shell git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$" | sort -V | grep -B1 $(RELEASE_TAG) | head -n 1 2>/dev/null) +PREVIOUS_TAG ?= $(shell git tag --merged $(GIT_REMOTE_NAME)/$(RELEASE_BRANCH) -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$" | sort -V | tail -n 1 2>/dev/null) +START_SHA ?= $(shell git rev-list -n 1 $(PREVIOUS_TAG) 2>/dev/null) +END_SHA ?= $(shell git rev-parse $(GIT_REMOTE_NAME)/$(RELEASE_BRANCH) 2>/dev/null) RELEASE_DIR ?= out RELEASE_NOTES_DIR := CHANGELOG GIT_REPO_NAME ?= cluster-api-provider-azure GIT_ORG_NAME ?= kubernetes-sigs -FULL_VERSION := $(RELEASE_TAG:v%=%) -MINOR_VERSION := $(shell v='$(FULL_VERSION)'; echo "$${v%.*}") -RELEASE_BRANCH ?= release-$(MINOR_VERSION) +GIT_REMOTE_NAME ?= upstream USER_FORK ?= $(shell git config --get remote.origin.url | cut -d/ -f4) IMAGE_REVIEWERS ?= $(shell ./hack/get-project-maintainers.sh) @@ -650,9 +659,11 @@ release-alias-tag: ## Adds the tag to the last build tag. .PHONY: release-notes release-notes: $(RELEASE_NOTES) $(RELEASE_NOTES_DIR) ## Generate/update release notes. + @echo "generating release notes from $(PREVIOUS_TAG) to $(RELEASE_TAG) with start sha $(START_SHA) and end sha $(END_SHA)" @if [ -n "${PRE_RELEASE}" ]; then echo ":rotating_light: This is a RELEASE CANDIDATE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/new)." > $(RELEASE_NOTES_DIR)/release-notes-$(RELEASE_TAG).md; \ - else $(RELEASE_NOTES) --org $(GIT_ORG_NAME) --repo $(GIT_REPO_NAME) --branch $(RELEASE_BRANCH) --start-rev $(PREVIOUS_TAG) --end-rev $(RELEASE_TAG) --output $(RELEASE_NOTES_DIR)/tmp-release-notes.md --list-v2; \ - sed 's/\[SIG Cluster Lifecycle\]//g' $(RELEASE_NOTES_DIR)/tmp-release-notes.md > $(RELEASE_NOTES_DIR)/release-notes-$(RELEASE_TAG).md; \ + else $(RELEASE_NOTES) --org $(GIT_ORG_NAME) --repo $(GIT_REPO_NAME) --branch $(RELEASE_BRANCH) --start-sha $(START_SHA) --end-sha $(END_SHA) --markdown-links true --output $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md --list-v2; \ + sed 's/\[SIG Cluster Lifecycle\]//g' $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md > $(RELEASE_NOTES_DIR)/tmp-release-notes.md; \ + cp $(RELEASE_NOTES_DIR)/tmp-release-notes.md $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md; \ rm -f $(RELEASE_NOTES_DIR)/tmp-release-notes.md; \ fi diff --git a/docs/book/src/developers/releasing.md b/docs/book/src/developers/releasing.md index 9e19b41dd68..0d07747a11d 100644 --- a/docs/book/src/developers/releasing.md +++ b/docs/book/src/developers/releasing.md @@ -73,11 +73,19 @@ This can be done in parallel with release publishing and does not impact the rel ### Open a PR for release notes -1. Checkout the latest commit on the release branch, e.g. `release-1.4`, or the main branch if the release branch doesn't yet exist (e.g. beta release). +1. If you don't have a GitHub token, create one by going to your GitHub settings, in [Personal access tokens](https://github.com/settings/tokens). Make sure you give the token the `repo` scope. + +1. Fetch the latest changes from upstream and checkout the main branch: + + ```sh + git fetch upstream + git checkout main + ``` 1. Generate release notes by running the following command: ```sh + export GITHUB_TOKEN= export RELEASE_TAG=v1.2.3 # change this to the tag of the release to be cut make release-notes ``` @@ -93,9 +101,7 @@ Merging the PR will automatically trigger a [Github Action](https://github.com/k ### Promote image to prod repo - Images are built by the [post push images job](https://testgrid.k8s.io/sig-cluster-lifecycle-cluster-api-provider-azure#post-cluster-api-provider-azure-push-images). This will push the image to a [staging repository][staging-repository]. -- If you don't have a GitHub token, create one by going to your GitHub settings, in [Personal access tokens](https://github.com/settings/tokens). Make sure you give the token the `repo` scope. - Wait for the above job to complete for the tag commit and for the image to exist in the staging directory, then create a PR to promote the image and tag: - - `export GITHUB_TOKEN=` - `make promote-images` This will automatically create a PR in [k8s.io](https://github.com/kubernetes/k8s.io) and assign the CAPZ maintainers. Example PR: https://github.com/kubernetes/k8s.io/pull/4284. From 5f66b48827983bb6fd48d8c20ccbb0b596a4692d Mon Sep 17 00:00:00 2001 From: Cecile Robert-Michon Date: Wed, 13 Dec 2023 22:26:21 +0000 Subject: [PATCH 09/10] Add release notes for v1.11.7 --- CHANGELOG/v1.11.7.md | 162 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 CHANGELOG/v1.11.7.md diff --git a/CHANGELOG/v1.11.7.md b/CHANGELOG/v1.11.7.md new file mode 100644 index 00000000000..3b0c2a02594 --- /dev/null +++ b/CHANGELOG/v1.11.7.md @@ -0,0 +1,162 @@ +## Changes by Kind + +### Other (Cleanup or Flake) + +- Bump CAPI to v1.5.4 ([#4348](https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/4348), [@mboersma](https://github.com/mboersma)) + +## Dependencies + +### Added +_Nothing has changed._ + +### Changed +- cloud.google.com/go/bigquery: v1.53.0 → v1.8.0 +- cloud.google.com/go/datastore: v1.13.0 → v1.1.0 +- cloud.google.com/go/firestore: v1.11.0 → v1.9.0 +- cloud.google.com/go/longrunning: v0.5.1 → v0.4.1 +- cloud.google.com/go/pubsub: v1.33.0 → v1.3.1 +- cloud.google.com/go: v0.110.6 → v0.110.0 +- github.com/docker/docker: [v24.0.5+incompatible → v24.0.7+incompatible](https://github.com/docker/docker/compare/v24.0.5...v24.0.7) +- github.com/felixge/httpsnoop: [v1.0.3 → v1.0.4](https://github.com/felixge/httpsnoop/compare/v1.0.3...v1.0.4) +- github.com/go-logr/logr: [v1.2.4 → v1.3.0](https://github.com/go-logr/logr/compare/v1.2.4...v1.3.0) +- github.com/golang/glog: [v1.1.0 → v1.1.2](https://github.com/golang/glog/compare/v1.1.0...v1.1.2) +- github.com/google/cel-go: [v0.12.6 → v0.12.7](https://github.com/google/cel-go/compare/v0.12.6...v0.12.7) +- github.com/google/go-cmp: [v0.5.9 → v0.6.0](https://github.com/google/go-cmp/compare/v0.5.9...v0.6.0) +- github.com/rogpeppe/go-internal: [v1.10.0 → v1.11.0](https://github.com/rogpeppe/go-internal/compare/v1.10.0...v1.11.0) +- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc: v0.35.0 → v0.46.0 +- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.44.0 → v0.46.0 +- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.19.0 → v1.20.0 +- go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.19.0 → v1.20.0 +- go.opentelemetry.io/otel/metric: v1.19.0 → v1.20.0 +- go.opentelemetry.io/otel/sdk: v1.19.0 → v1.20.0 +- go.opentelemetry.io/otel/trace: v1.19.0 → v1.20.0 +- go.opentelemetry.io/otel: v1.19.0 → v1.20.0 +- go.uber.org/goleak: v1.2.1 → v1.3.0 +- golang.org/x/oauth2: v0.10.0 → v0.11.0 +- golang.org/x/sys: v0.13.0 → v0.14.0 +- google.golang.org/genproto/googleapis/api: f966b18 → b8732ec +- google.golang.org/genproto/googleapis/rpc: f966b18 → b8732ec +- google.golang.org/genproto: f966b18 → b8732ec +- google.golang.org/grpc: v1.58.3 → v1.59.0 +- k8s.io/api: v0.27.2 → v0.27.7 +- k8s.io/apiextensions-apiserver: v0.27.2 → v0.27.7 +- k8s.io/apimachinery: v0.27.2 → v0.27.7 +- k8s.io/apiserver: v0.27.2 → v0.27.7 +- k8s.io/client-go: v0.27.2 → v0.27.7 +- k8s.io/code-generator: v0.27.2 → v0.27.7 +- k8s.io/component-base: v0.27.2 → v0.27.7 +- k8s.io/kms: v0.27.2 → v0.27.7 +- sigs.k8s.io/cluster-api/test: v1.5.3 → v1.5.4 +- sigs.k8s.io/cluster-api: v1.5.3 → v1.5.4 +- sigs.k8s.io/controller-runtime: v0.15.1 → v0.15.3 + +### Removed +- cloud.google.com/go/accessapproval: v1.7.1 +- cloud.google.com/go/accesscontextmanager: v1.8.1 +- cloud.google.com/go/aiplatform: v1.48.0 +- cloud.google.com/go/analytics: v0.21.3 +- cloud.google.com/go/apigateway: v1.6.1 +- cloud.google.com/go/apigeeconnect: v1.6.1 +- cloud.google.com/go/apigeeregistry: v0.7.1 +- cloud.google.com/go/appengine: v1.8.1 +- cloud.google.com/go/area120: v0.8.1 +- cloud.google.com/go/artifactregistry: v1.14.1 +- cloud.google.com/go/asset: v1.14.1 +- cloud.google.com/go/assuredworkloads: v1.11.1 +- cloud.google.com/go/automl: v1.13.1 +- cloud.google.com/go/baremetalsolution: v1.1.1 +- cloud.google.com/go/batch: v1.3.1 +- cloud.google.com/go/beyondcorp: v1.0.0 +- cloud.google.com/go/billing: v1.16.0 +- cloud.google.com/go/binaryauthorization: v1.6.1 +- cloud.google.com/go/certificatemanager: v1.7.1 +- cloud.google.com/go/channel: v1.16.0 +- cloud.google.com/go/cloudbuild: v1.13.0 +- cloud.google.com/go/clouddms: v1.6.1 +- cloud.google.com/go/cloudtasks: v1.12.1 +- cloud.google.com/go/contactcenterinsights: v1.10.0 +- cloud.google.com/go/container: v1.24.0 +- cloud.google.com/go/containeranalysis: v0.10.1 +- cloud.google.com/go/datacatalog: v1.16.0 +- cloud.google.com/go/dataflow: v0.9.1 +- cloud.google.com/go/dataform: v0.8.1 +- cloud.google.com/go/datafusion: v1.7.1 +- cloud.google.com/go/datalabeling: v0.8.1 +- cloud.google.com/go/dataplex: v1.9.0 +- cloud.google.com/go/dataproc/v2: v2.0.1 +- cloud.google.com/go/dataqna: v0.8.1 +- cloud.google.com/go/datastream: v1.10.0 +- cloud.google.com/go/deploy: v1.13.0 +- cloud.google.com/go/dialogflow: v1.40.0 +- cloud.google.com/go/dlp: v1.10.1 +- cloud.google.com/go/documentai: v1.22.0 +- cloud.google.com/go/domains: v0.9.1 +- cloud.google.com/go/edgecontainer: v1.1.1 +- cloud.google.com/go/errorreporting: v0.3.0 +- cloud.google.com/go/essentialcontacts: v1.6.2 +- cloud.google.com/go/eventarc: v1.13.0 +- cloud.google.com/go/filestore: v1.7.1 +- cloud.google.com/go/functions: v1.15.1 +- cloud.google.com/go/gkebackup: v1.3.0 +- cloud.google.com/go/gkeconnect: v0.8.1 +- cloud.google.com/go/gkehub: v0.14.1 +- cloud.google.com/go/gkemulticloud: v1.0.0 +- cloud.google.com/go/gsuiteaddons: v1.6.1 +- cloud.google.com/go/iam: v1.1.1 +- cloud.google.com/go/iap: v1.8.1 +- cloud.google.com/go/ids: v1.4.1 +- cloud.google.com/go/iot: v1.7.1 +- cloud.google.com/go/kms: v1.15.0 +- cloud.google.com/go/language: v1.10.1 +- cloud.google.com/go/lifesciences: v0.9.1 +- cloud.google.com/go/logging: v1.7.0 +- cloud.google.com/go/managedidentities: v1.6.1 +- cloud.google.com/go/maps: v1.4.0 +- cloud.google.com/go/mediatranslation: v0.8.1 +- cloud.google.com/go/memcache: v1.10.1 +- cloud.google.com/go/metastore: v1.12.0 +- cloud.google.com/go/monitoring: v1.15.1 +- cloud.google.com/go/networkconnectivity: v1.12.1 +- cloud.google.com/go/networkmanagement: v1.8.0 +- cloud.google.com/go/networksecurity: v0.9.1 +- cloud.google.com/go/notebooks: v1.9.1 +- cloud.google.com/go/optimization: v1.4.1 +- cloud.google.com/go/orchestration: v1.8.1 +- cloud.google.com/go/orgpolicy: v1.11.1 +- cloud.google.com/go/osconfig: v1.12.1 +- cloud.google.com/go/oslogin: v1.10.1 +- cloud.google.com/go/phishingprotection: v0.8.1 +- cloud.google.com/go/policytroubleshooter: v1.8.0 +- cloud.google.com/go/privatecatalog: v0.9.1 +- cloud.google.com/go/pubsublite: v1.8.1 +- cloud.google.com/go/recaptchaenterprise/v2: v2.7.2 +- cloud.google.com/go/recommendationengine: v0.8.1 +- cloud.google.com/go/recommender: v1.10.1 +- cloud.google.com/go/redis: v1.13.1 +- cloud.google.com/go/resourcemanager: v1.9.1 +- cloud.google.com/go/resourcesettings: v1.6.1 +- cloud.google.com/go/retail: v1.14.1 +- cloud.google.com/go/run: v1.2.0 +- cloud.google.com/go/scheduler: v1.10.1 +- cloud.google.com/go/secretmanager: v1.11.1 +- cloud.google.com/go/security: v1.15.1 +- cloud.google.com/go/securitycenter: v1.23.0 +- cloud.google.com/go/servicedirectory: v1.11.0 +- cloud.google.com/go/shell: v1.7.1 +- cloud.google.com/go/spanner: v1.47.0 +- cloud.google.com/go/speech: v1.19.0 +- cloud.google.com/go/storagetransfer: v1.10.0 +- cloud.google.com/go/talent: v1.6.2 +- cloud.google.com/go/texttospeech: v1.7.1 +- cloud.google.com/go/tpu: v1.6.1 +- cloud.google.com/go/trace: v1.10.1 +- cloud.google.com/go/translate: v1.8.2 +- cloud.google.com/go/video: v1.19.0 +- cloud.google.com/go/videointelligence: v1.11.1 +- cloud.google.com/go/vision/v2: v2.7.2 +- cloud.google.com/go/vmmigration: v1.7.1 +- cloud.google.com/go/vmwareengine: v1.0.0 +- cloud.google.com/go/vpcaccess: v1.7.1 +- cloud.google.com/go/webrisk: v1.9.1 +- cloud.google.com/go/websecurityscanner: v1.6.1 +- cloud.google.com/go/workflows: v1.11.1 From b702ca21f4c9a57fa532715aa530a5c2c4a039d3 Mon Sep 17 00:00:00 2001 From: Aravindh Puthiyaparambil Date: Wed, 13 Dec 2023 14:15:03 -0800 Subject: [PATCH 10/10] hack: Use absolute path for SSH key vars - Use absolute path for AZURE_SSH_KEY which will extend to other SSH env vars. This is needed for tests that are executed after a directory change. - Add KUBE_SSH_KEY which is required if e2e.test is run with --provider=skeleton --- hack/util.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hack/util.sh b/hack/util.sh index 8a515cfe87f..cff56f4839f 100755 --- a/hack/util.sh +++ b/hack/util.sh @@ -82,12 +82,21 @@ capz::util::generate_ssh_key() { AZURE_SSH_PUBLIC_KEY_FILE=${AZURE_SSH_PUBLIC_KEY_FILE:-""} if [ -z "${AZURE_SSH_PUBLIC_KEY_FILE}" ]; then echo "generating sshkey for e2e" - AZURE_SSH_KEY=.sshkey + AZURE_SSH_KEY="${PWD}"/.sshkey + # This is required if e2e.test is run with --provider=skeleton. This option is used when + # running Windows e2e tests against a CAPZ cluster to ensure no extra Azure resources are + # created by e2e.test. + # Ref: https://github.com/kubernetes-sigs/windows-testing/blob/be73dd57a551be4f9527e7a3a3e6491e86cae6d2/capz/run-capz-e2e.sh#L300 + # Further more, --provider is what decides which SSH environment variable is used to create + # the signer needed to SSH into nodes. + # Ref: https://github.com/kubernetes/kubernetes/blob/41890534532931742770a7dc98f78bcdc59b1a6f/test/e2e/framework/ssh/ssh.go#L58 + KUBE_SSH_KEY="${AZURE_SSH_KEY}" rm -f "${AZURE_SSH_KEY}" 2>/dev/null ssh-keygen -t rsa -b 2048 -f "${AZURE_SSH_KEY}" -N '' 1>/dev/null AZURE_SSH_PUBLIC_KEY_FILE="${AZURE_SSH_KEY}.pub" # This is needed to run tests that required SSH access to nodes export AZURE_SSH_KEY + export KUBE_SSH_KEY fi AZURE_SSH_PUBLIC_KEY_B64=$(base64 < "${AZURE_SSH_PUBLIC_KEY_FILE}" | tr -d '\r\n') export AZURE_SSH_PUBLIC_KEY_B64