Skip to content

Commit 3f8258c

Browse files
committed
add controller: true to azure.json Secret ownerRef
1 parent fd11629 commit 3f8258c

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

controllers/azurejson_machine_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2929
"k8s.io/apimachinery/pkg/types"
3030
"k8s.io/client-go/tools/record"
31+
"k8s.io/utils/pointer"
3132
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
3233
"sigs.k8s.io/cluster-api-provider-azure/azure/scope"
3334
"sigs.k8s.io/cluster-api-provider-azure/azure/services/identities"
@@ -208,6 +209,7 @@ func (r *AzureJSONMachineReconciler) Reconcile(ctx context.Context, req ctrl.Req
208209
Kind: kind,
209210
Name: azureMachine.GetName(),
210211
UID: azureMachine.GetUID(),
212+
Controller: pointer.Bool(true),
211213
}
212214

213215
// Construct secret for this machine

controllers/azurejson_machinepool_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2828
"k8s.io/apimachinery/pkg/types"
2929
"k8s.io/client-go/tools/record"
30+
"k8s.io/utils/pointer"
3031
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
3132
"sigs.k8s.io/cluster-api-provider-azure/azure/scope"
3233
"sigs.k8s.io/cluster-api-provider-azure/azure/services/identities"
@@ -189,6 +190,7 @@ func (r *AzureJSONMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl
189190
Kind: kind,
190191
Name: azureMachinePool.GetName(),
191192
UID: azureMachinePool.GetUID(),
193+
Controller: pointer.Bool(true),
192194
}
193195

194196
if azureMachinePool.Spec.Identity == infrav1.VMIdentityNone {

controllers/azurejson_machinetemplate_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2828
"k8s.io/apimachinery/pkg/types"
2929
"k8s.io/client-go/tools/record"
30+
"k8s.io/utils/pointer"
3031
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
3132
"sigs.k8s.io/cluster-api-provider-azure/azure/scope"
3233
"sigs.k8s.io/cluster-api-provider-azure/azure/services/identities"
@@ -168,6 +169,7 @@ func (r *AzureJSONTemplateReconciler) Reconcile(ctx context.Context, req ctrl.Re
168169
Kind: kind,
169170
Name: azureMachineTemplate.GetName(),
170171
UID: azureMachineTemplate.GetUID(),
172+
Controller: pointer.Bool(true),
171173
}
172174

173175
// Construct secret for this machine template

0 commit comments

Comments
 (0)