Skip to content

Commit d13d31d

Browse files
Updated as comments, will do test later
1 parent f918f3c commit d13d31d

File tree

7 files changed

+97
-92
lines changed

7 files changed

+97
-92
lines changed

azure/scope/azure_secret_cloud.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ import (
2323
)
2424

2525
const (
26-
// Deprecated: Use ConfigMaps instead
27-
AzureEnvironentFolderEnvName = "AZURE_ENVIRONMENT_FOLDER_CAPZ"
28-
2926
// ConfigMap names for Azure secret cloud configuration
3027
AzureEnvConfigMapName = "azure-capz-env-config"
3128
AzureCertConfigMapName = "azure-capz-cert-config"
@@ -51,12 +48,6 @@ func init() {
5148
defer done()
5249

5350
log.Info("Azure secret cloud init completed - ConfigMap initialization will be performed during controller setup")
54-
55-
// Check for deprecated environment variable
56-
if path := os.Getenv(AzureEnvironentFolderEnvName); path != "" {
57-
log.Info("DEPRECATED: AZURE_ENVIRONMENT_FOLDER_CAPZ is deprecated, use ConfigMaps instead")
58-
fmt.Printf("CAPZ: WARNING - AZURE_ENVIRONMENT_FOLDER_CAPZ is deprecated. Please use ConfigMaps instead.\n")
59-
}
6051
}
6152

6253
// InitializeAzureConfigForCluster initializes Azure environment and certificates from ConfigMaps

azure/scope/cluster.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (s *ClusterScope) PublicIPSpecs() []azure.ResourceSpecGetter {
158158

159159
// Public IP specs for control plane outbound lb
160160
var controlPlaneOutboundIPSpecs []azure.ResourceSpecGetter
161-
if s.ControlPlaneOutboundLB() != nil {
161+
if s.IsAPIServerPrivate() && s.ControlPlaneOutboundLB() != nil {
162162
for _, ip := range s.ControlPlaneOutboundLB().FrontendIPs {
163163
publicIPSpecs = append(publicIPSpecs, &publicips.PublicIPSpec{
164164
Name: ip.PublicIP.Name,
@@ -282,10 +282,6 @@ func (s *ClusterScope) LBSpecs() []azure.ResourceSpecGetter {
282282
// or if the LB is of the type internal, save the only IP allowed for the frontend LB
283283
if frontendIP.PublicIP != nil || frontendLB.Type == infrav1.Internal {
284284
frontendLB.FrontendIPConfigs = []infrav1.FrontendIP{frontendIP}
285-
// Log the IP configuration being used
286-
if frontendLB.Type == infrav1.Internal && frontendIP.PrivateIPAddress != "" {
287-
fmt.Printf("[CAPZ-DEBUG] Internal LB FrontendIP config - Name: %s, PrivateIP: %s\n", frontendIP.Name, frontendIP.PrivateIPAddress)
288-
}
289285
break
290286
}
291287
}

azure/services/managedclusters/spec_test.go

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -376,30 +376,6 @@ func TestParameters(t *testing.T) {
376376
Spec: asocontainerservicev1.ManagedCluster_Spec{
377377
DnsPrefix: ptr.To("set by the user"),
378378
EnablePodSecurityPolicy: ptr.To(true), // set by the user
379-
380-
func getSampleManagedCluster() containerservice.ManagedCluster {
381-
return containerservice.ManagedCluster{
382-
ManagedClusterProperties: &containerservice.ManagedClusterProperties{
383-
KubernetesVersion: to.StringPtr("v1.22.0"),
384-
AgentPoolProfiles: &[]containerservice.ManagedClusterAgentPoolProfile{
385-
converters.AgentPoolToManagedClusterAgentPoolProfile(azure.AgentPoolSpec{
386-
Name: "test-agentpool-0",
387-
Mode: string(infrav1exp.NodePoolModeSystem),
388-
ResourceGroup: "test-rg",
389-
Replicas: int32(2),
390-
}),
391-
converters.AgentPoolToManagedClusterAgentPoolProfile(azure.AgentPoolSpec{
392-
Name: "test-agentpool-1",
393-
Mode: string(infrav1exp.NodePoolModeUser),
394-
ResourceGroup: "test-rg",
395-
Replicas: int32(4),
396-
Cluster: "test-managedcluster",
397-
SKU: "test_SKU",
398-
Version: to.StringPtr("v1.22.0"),
399-
VnetSubnetID: "fake/subnet/id",
400-
MaxPods: to.Int32Ptr(int32(32)),
401-
AvailabilityZones: []string{"1", "2"},
402-
}),
403379
},
404380
Status: asocontainerservicev1.ManagedCluster_STATUS{
405381
AgentPoolProfiles: []asocontainerservicev1.ManagedClusterAgentPoolProfile_STATUS{},
@@ -420,6 +396,35 @@ func getSampleManagedCluster() containerservice.ManagedCluster {
420396
})
421397
}
422398

399+
func getSampleManagedCluster() asocontainerservicev1.ManagedCluster {
400+
return asocontainerservicev1.ManagedCluster{
401+
Spec: asocontainerservicev1.ManagedCluster_Spec{
402+
KubernetesVersion: ptr.To("v1.22.0"),
403+
AgentPoolProfiles: []asocontainerservicev1.ManagedClusterAgentPoolProfile{
404+
{
405+
Name: ptr.To("test-agentpool-0"),
406+
Mode: ptr.To(asocontainerservicev1.AgentPoolMode("System")),
407+
Count: ptr.To(2),
408+
EnableAutoScaling: ptr.To(false),
409+
Type: ptr.To(asocontainerservicev1.AgentPoolType_VirtualMachineScaleSets),
410+
},
411+
{
412+
Name: ptr.To("test-agentpool-1"),
413+
Mode: ptr.To(asocontainerservicev1.AgentPoolMode("User")),
414+
Count: ptr.To(4),
415+
EnableAutoScaling: ptr.To(false),
416+
Type: ptr.To(asocontainerservicev1.AgentPoolType_VirtualMachineScaleSets),
417+
VnetSubnetReference: &genruntime.ResourceReference{
418+
ARMID: "fake/subnet/id",
419+
},
420+
MaxPods: ptr.To(32),
421+
AvailabilityZones: []string{"1", "2"},
422+
},
423+
},
424+
},
425+
}
426+
}
427+
423428
func TestOIDCIssuerURLConfigMap(t *testing.T) {
424429
t.Run("get oidc issuer profile", func(t *testing.T) {
425430
g := NewGomegaWithT(t)
@@ -429,4 +434,4 @@ func TestOIDCIssuerURLConfigMap(t *testing.T) {
429434

430435
g.Expect(actualOIDCIssuerConfigMapName).To(Equal("my-cluster-aso-oidc-issuer-profile"))
431436
})
432-
}
437+
}

azure/services/privatedns/link_reconciler.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ func (s *Service) reconcileLinks(ctx context.Context, links []azure.ResourceSpec
6161
continue
6262
}
6363

64-
// Enhanced logic: check all zones with the same name across all resource groups
64+
// Enhanced logic: check all zones with the same name across all resource groups to prevent duplicate VNet links.
65+
// This prevents DNS resolution conflicts by ensuring a VNet is not linked to multiple private DNS zones
66+
// with the same name, even if they exist in different resource groups.
6567
zoneName := linkSpec.OwnerResourceName()
6668
vnetID := azure.VNetID(linkSpec.(LinkSpec).SubscriptionID, linkSpec.(LinkSpec).VNetResourceGroup, linkSpec.(LinkSpec).VNetName)
6769
zones, err := s.zonesClient.ListAllZonesByName(ctx, zoneName)

controllers/azureasomanagedcontrolplane_controller.go

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import (
4646
"sigs.k8s.io/controller-runtime/pkg/handler"
4747
"sigs.k8s.io/controller-runtime/pkg/reconcile"
4848

49+
"github.com/go-logr/logr"
4950
infrav1alpha "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha1"
5051
"sigs.k8s.io/cluster-api-provider-azure/azure"
5152
"sigs.k8s.io/cluster-api-provider-azure/pkg/mutators"
@@ -326,16 +327,16 @@ func (r *AzureASOManagedControlPlaneReconciler) reconcileKubeconfig(ctx context.
326327

327328
// PATCH POINT: Inject custom CA certificate data here
328329
// This allows patching CA certificates for AAD-enabled clusters with local accounts disabled
329-
fmt.Printf("=== DEBUG: ASO Controller CA injection for cluster: %s ===\n", cluster.Name)
330-
if customCACert := getCustomCACertificateForCluster(cluster.Name); customCACert != nil {
331-
fmt.Printf("DEBUG: ASO - Custom CA certificate found (%d bytes), proceeding with COMBINATION\n", len(customCACert))
330+
log.V(4).Info("ASO Controller CA injection", "cluster", cluster.Name)
331+
if customCACert := getCustomCACertificateForCluster(cluster.Name, log); customCACert != nil {
332+
log.V(4).Info("Custom CA certificate found", "size", len(customCACert))
332333
patchedCount := 0
333334
for clusterName, clusterInfo := range kubeconfig.Clusters {
334-
fmt.Printf("DEBUG: ASO - Processing cluster '%s'\n", clusterName)
335-
fmt.Printf("DEBUG: ASO - Original CA data length: %d bytes\n", len(clusterInfo.CertificateAuthorityData))
335+
log.V(4).Info("Processing cluster", "name", clusterName)
336+
log.V(4).Info("Original CA data", "size", len(clusterInfo.CertificateAuthorityData))
336337

337338
if clusterInfo.CertificateAuthorityData != nil && len(clusterInfo.CertificateAuthorityData) > 0 {
338-
fmt.Printf("DEBUG: ASO - Combining original CA with custom CA\n")
339+
log.V(4).Info("Combining original CA with custom CA")
339340
// Combine: original + newline + custom CA
340341
combinedCA := make([]byte, 0, len(clusterInfo.CertificateAuthorityData)+1+len(customCACert))
341342
combinedCA = append(combinedCA, clusterInfo.CertificateAuthorityData...)
@@ -348,19 +349,21 @@ func (r *AzureASOManagedControlPlaneReconciler) reconcileKubeconfig(ctx context.
348349
combinedCA = append(combinedCA, customCACert...)
349350
clusterInfo.CertificateAuthorityData = combinedCA
350351

351-
fmt.Printf("DEBUG: ASO - Combined CA data length: %d bytes (original: %d + custom: %d)\n",
352-
len(combinedCA), len(clusterInfo.CertificateAuthorityData)-len(customCACert)-1, len(customCACert))
352+
log.V(4).Info("Combined CA data",
353+
"totalSize", len(combinedCA),
354+
"originalSize", len(clusterInfo.CertificateAuthorityData)-len(customCACert)-1,
355+
"customSize", len(customCACert))
353356
} else {
354-
fmt.Printf("DEBUG: ASO - No original CA data, using only custom CA\n")
357+
log.V(4).Info("No original CA data, using only custom CA")
355358
// No original CA, just use custom
356359
clusterInfo.CertificateAuthorityData = customCACert
357-
fmt.Printf("DEBUG: ASO - Set CA data length: %d bytes\n", len(clusterInfo.CertificateAuthorityData))
360+
log.V(4).Info("Set CA data", "size", len(clusterInfo.CertificateAuthorityData))
358361
}
359362
patchedCount++
360363
}
361-
fmt.Printf("DEBUG: ASO - Combined CA certificates in %d clusters total\n", patchedCount)
364+
log.V(4).Info("CA certificates combined", "patchedClusters", patchedCount)
362365
} else {
363-
fmt.Printf("DEBUG: ASO - No custom CA certificate found, keeping original kubeconfig\n")
366+
log.V(4).Info("No custom CA certificate found, keeping original kubeconfig")
364367
}
365368

366369
kubeconfigData, err = clientcmd.Write(*kubeconfig)
@@ -397,37 +400,36 @@ func (r *AzureASOManagedControlPlaneReconciler) reconcileKubeconfig(ctx context.
397400
// getCustomCACertificateForCluster returns custom CA certificate data for a specific cluster
398401
// This function leverages the same certificate that is used for Azure authentication
399402
// by checking the global AzSecretCertPool that gets populated during Azure client initialization
400-
func getCustomCACertificateForCluster(clusterName string) []byte {
401-
fmt.Printf("=== DEBUG: ASO getCustomCACertificateForCluster() called for cluster: %s ===\n", clusterName)
403+
func getCustomCACertificateForCluster(clusterName string, log logr.Logger) []byte {
404+
log.V(4).Info("ASO getCustomCACertificateForCluster() called for cluster", "clusterName", clusterName)
402405

403406
// Debug the condition checks
404407
isConfigured := azure.IsAzSecretCertConfigured()
405408
poolNotNil := azure.AzSecretCertPool != nil
406409
dataLength := len(azure.AzSecretCertData)
407410

408-
fmt.Printf("DEBUG: ASO - azure.IsAzSecretCertConfigured() = %v\n", isConfigured)
409-
fmt.Printf("DEBUG: ASO - azure.AzSecretCertPool != nil = %v\n", poolNotNil)
410-
fmt.Printf("DEBUG: ASO - len(azure.AzSecretCertData) = %d\n", dataLength)
411+
log.V(4).Info("ASO - azure.IsAzSecretCertConfigured()", "isConfigured", isConfigured)
412+
log.V(4).Info("ASO - azure.AzSecretCertPool != nil", "poolNotNil", poolNotNil)
413+
log.V(4).Info("ASO - len(azure.AzSecretCertData)", "dataLength", dataLength)
411414

412415
// Check if we have a certificate in the global AzSecretCertPool
413416
// This is the same certificate pool used for Azure authentication
414417
if azure.IsAzSecretCertConfigured() && azure.AzSecretCertPool != nil {
415-
fmt.Printf("DEBUG: ASO - Passed first condition check (IsConfigured && PoolNotNil)\n")
418+
log.V(4).Info("Passed first condition check (IsConfigured && PoolNotNil)")
416419
// Return the raw certificate data stored in AzSecretCertData
417420
// This contains the original PEM data that was used to populate the certificate pool
418421
if len(azure.AzSecretCertData) > 0 {
419-
fmt.Printf("DEBUG: ASO - Found certificate data, returning %d bytes\n", len(azure.AzSecretCertData))
420-
fmt.Printf("DEBUG: ASO - Certificate data preview (first 100 chars): %s...\n",
421-
string(azure.AzSecretCertData[:int(math.Min(100, float64(len(azure.AzSecretCertData))))]))
422+
log.V(4).Info("Found certificate data, returning", "size", len(azure.AzSecretCertData))
423+
log.V(4).Info("Certificate data preview (first 100 chars)", "preview", string(azure.AzSecretCertData[:int(math.Min(100, float64(len(azure.AzSecretCertData))))]))
422424
return azure.AzSecretCertData
423425
} else {
424-
fmt.Printf("DEBUG: ASO - Certificate data is empty, returning nil\n")
426+
log.V(4).Info("Certificate data is empty, returning nil")
425427
}
426428
} else {
427-
fmt.Printf("DEBUG: ASO - Failed condition check - IsConfigured: %v, PoolNotNil: %v\n", isConfigured, poolNotNil)
429+
log.V(4).Info("Failed condition check - IsConfigured", "isConfigured", isConfigured, "PoolNotNil", poolNotNil)
428430
}
429431

430-
fmt.Printf("DEBUG: ASO - getCustomCACertificateForCluster() returning nil\n")
432+
log.V(4).Info("ASO - getCustomCACertificateForCluster() returning nil")
431433
return nil
432434
}
433435

controllers/azuremanagedcontrolplane_reconciler.go

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"sigs.k8s.io/cluster-api/util/secret"
2828
"sigs.k8s.io/controller-runtime/pkg/client"
2929
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
30+
"sigs.k8s.io/controller-runtime/pkg/log"
3031

3132
"sigs.k8s.io/cluster-api-provider-azure/azure"
3233
"sigs.k8s.io/cluster-api-provider-azure/azure/scope"
@@ -133,24 +134,25 @@ func (r *azureManagedControlPlaneService) reconcileKubeconfig(ctx context.Contex
133134
}
134135

135136
// PATCH POINT: Inject custom CA certificate data into kubeconfig before storing in secret
136-
fmt.Printf("=== DEBUG: AMCP reconcileKubeconfig() - Processing kubeconfig %d (admin=0, user=1) ===\n", i)
137-
fmt.Printf("DEBUG: AMCP - Original kubeconfig size: %d bytes\n", len(kubeConfigData))
137+
logger := log.FromContext(ctx)
138+
logger.V(4).Info("Processing kubeconfig", "index", i, "type", map[int]string{0: "admin", 1: "user"}[i])
139+
logger.V(4).Info("Original kubeconfig size", "bytes", len(kubeConfigData))
138140

139141
if customCACert := getCustomCACertificateForAMCP(r.scope.ClusterName()); customCACert != nil {
140-
fmt.Printf("DEBUG: AMCP - Custom CA certificate found (%d bytes), proceeding with COMBINATION\n", len(customCACert))
142+
logger.V(4).Info("Custom CA certificate found", "size_bytes", len(customCACert))
141143

142144
// Parse kubeconfig
143145
kubeconfig, err := clientcmd.Load(kubeConfigData)
144146
if err != nil {
145-
fmt.Printf("DEBUG: AMCP - ERROR: Failed to parse kubeconfig: %v\n", err)
147+
logger.V(4).Error(err, "Failed to parse kubeconfig")
146148
} else {
147149
patchedCount := 0
148150
for clusterName, clusterInfo := range kubeconfig.Clusters {
149-
fmt.Printf("DEBUG: AMCP - Processing cluster '%s'\n", clusterName)
150-
fmt.Printf("DEBUG: AMCP - Original CA data length: %d bytes\n", len(clusterInfo.CertificateAuthorityData))
151+
logger.V(4).Info("Processing cluster", "name", clusterName)
152+
logger.V(4).Info("Original CA data length", "bytes", len(clusterInfo.CertificateAuthorityData))
151153

152154
if clusterInfo.CertificateAuthorityData != nil && len(clusterInfo.CertificateAuthorityData) > 0 {
153-
fmt.Printf("DEBUG: AMCP - Combining original CA with custom CA\n")
155+
logger.V(4).Info("Combining original CA with custom CA")
154156
// Combine: original + newline + custom CA
155157
combinedCA := make([]byte, 0, len(clusterInfo.CertificateAuthorityData)+1+len(customCACert))
156158
combinedCA = append(combinedCA, clusterInfo.CertificateAuthorityData...)
@@ -163,28 +165,30 @@ func (r *azureManagedControlPlaneService) reconcileKubeconfig(ctx context.Contex
163165
combinedCA = append(combinedCA, customCACert...)
164166
clusterInfo.CertificateAuthorityData = combinedCA
165167

166-
fmt.Printf("DEBUG: AMCP - Combined CA data length: %d bytes (original: %d + custom: %d)\n",
167-
len(combinedCA), len(clusterInfo.CertificateAuthorityData)-len(customCACert)-1, len(customCACert))
168+
logger.V(4).Info("Combined CA data",
169+
"total_bytes", len(combinedCA),
170+
"original_bytes", len(clusterInfo.CertificateAuthorityData)-len(customCACert)-1,
171+
"custom_bytes", len(customCACert))
168172
} else {
169-
fmt.Printf("DEBUG: AMCP - No original CA data, using only custom CA\n")
173+
logger.V(4).Info("No original CA data, using only custom CA")
170174
// No original CA, just use custom
171175
clusterInfo.CertificateAuthorityData = customCACert
172-
fmt.Printf("DEBUG: AMCP - Set CA data length: %d bytes\n", len(clusterInfo.CertificateAuthorityData))
176+
logger.V(4).Info("Set CA data length", "bytes", len(clusterInfo.CertificateAuthorityData))
173177
}
174178
patchedCount++
175179
}
176-
fmt.Printf("DEBUG: AMCP - Combined CA certificates in %d clusters total\n", patchedCount)
180+
logger.V(4).Info("Combined CA certificates", "clusters_patched", patchedCount)
177181

178182
// Write back the modified kubeconfig
179183
if patchedKubeconfig, err := clientcmd.Write(*kubeconfig); err != nil {
180-
fmt.Printf("DEBUG: AMCP - ERROR: Failed to write patched kubeconfig: %v\n", err)
184+
logger.V(4).Error(err, "Failed to write patched kubeconfig")
181185
} else {
182186
kubeConfigData = patchedKubeconfig
183-
fmt.Printf("DEBUG: AMCP - Successfully wrote combined kubeconfig (%d bytes)\n", len(kubeConfigData))
187+
logger.V(4).Info("Successfully wrote combined kubeconfig", "bytes", len(kubeConfigData))
184188
}
185189
}
186190
} else {
187-
fmt.Printf("DEBUG: AMCP - No custom CA certificate found, keeping original kubeconfig\n")
191+
logger.V(4).Info("No custom CA certificate found, keeping original kubeconfig")
188192
}
189193

190194
kubeConfigSecret := r.scope.MakeEmptyKubeConfigSecret()
@@ -210,7 +214,7 @@ func (r *azureManagedControlPlaneService) reconcileKubeconfig(ctx context.Contex
210214
return errors.Wrap(err, "failed to reconcile kubeconfig secret for cluster")
211215
}
212216

213-
fmt.Printf("DEBUG: AMCP - Successfully stored kubeconfig secret '%s' with CA injection\n", kubeConfigSecret.Name)
217+
logger.V(4).Info("Successfully stored kubeconfig secret with CA injection", "secret_name", kubeConfigSecret.Name)
214218
}
215219

216220
// store cluster-info for the cluster with the admin kubeconfig.
@@ -243,35 +247,37 @@ func (r *azureManagedControlPlaneService) reconcileKubeconfig(ctx context.Contex
243247
// This function leverages the same certificate that is used for Azure authentication
244248
// by checking the global AzSecretCertPool that gets populated during Azure client initialization
245249
func getCustomCACertificateForAMCP(clusterName string) []byte {
246-
fmt.Printf("=== DEBUG: AMCP getCustomCACertificateForAMCP() called for cluster: %s ===\n", clusterName)
250+
logger := log.FromContext(context.Background()) // Changed to context.Background() to avoid context leak
251+
logger.V(4).Info("getCustomCACertificateForAMCP called", "cluster_name", clusterName)
247252

248253
// Debug the condition checks
249254
isConfigured := azure.IsAzSecretCertConfigured()
250255
poolNotNil := azure.AzSecretCertPool != nil
251256
dataLength := len(azure.AzSecretCertData)
252257

253-
fmt.Printf("DEBUG: AMCP - azure.IsAzSecretCertConfigured() = %v\n", isConfigured)
254-
fmt.Printf("DEBUG: AMCP - azure.AzSecretCertPool != nil = %v\n", poolNotNil)
255-
fmt.Printf("DEBUG: AMCP - len(azure.AzSecretCertData) = %d\n", dataLength)
258+
logger.V(4).Info("Condition checks",
259+
"is_configured", isConfigured,
260+
"pool_not_nil", poolNotNil,
261+
"data_length", dataLength)
256262

257263
// Check if we have a certificate in the global AzSecretCertPool
258264
// This is the same certificate pool used for Azure authentication
259265
if azure.IsAzSecretCertConfigured() && azure.AzSecretCertPool != nil {
260-
fmt.Printf("DEBUG: AMCP - Passed first condition check (IsConfigured && PoolNotNil)\n")
266+
logger.V(4).Info("Passed first condition check (IsConfigured && PoolNotNil)")
261267
// Return the raw certificate data stored in AzSecretCertData
262268
// This contains the original PEM data that was used to populate the certificate pool
263269
if len(azure.AzSecretCertData) > 0 {
264-
fmt.Printf("DEBUG: AMCP - Found certificate data, returning %d bytes\n", len(azure.AzSecretCertData))
265-
fmt.Printf("DEBUG: AMCP - Certificate data preview (first 100 chars): %s...\n",
270+
logger.V(4).Info("Found certificate data, returning", "bytes", len(azure.AzSecretCertData))
271+
logger.V(4).Info("Certificate data preview (first 100 chars)", "preview",
266272
string(azure.AzSecretCertData[:int(math.Min(100, float64(len(azure.AzSecretCertData))))]))
267273
return azure.AzSecretCertData
268274
} else {
269-
fmt.Printf("DEBUG: AMCP - Certificate data is empty, returning nil\n")
275+
logger.V(4).Info("Certificate data is empty, returning nil")
270276
}
271277
} else {
272-
fmt.Printf("DEBUG: AMCP - Failed condition check - IsConfigured: %v, PoolNotNil: %v\n", isConfigured, poolNotNil)
278+
logger.V(4).Info("Failed condition check - IsConfigured: false, PoolNotNil: false")
273279
}
274280

275-
fmt.Printf("DEBUG: AMCP - getCustomCACertificateForAMCP() returning nil\n")
281+
logger.V(4).Info("getCustomCACertificateForAMCP returning nil")
276282
return nil
277283
}

0 commit comments

Comments
 (0)