@@ -57,6 +57,57 @@ type SyncContext interface {
57
57
GetState () (common.OperationPhase , string , []common.ResourceSyncResult )
58
58
}
59
59
60
+ type syncContext struct {
61
+ healthOverride health.HealthOverride
62
+ permissionValidator common.PermissionValidator
63
+ resources map [kubeutil.ResourceKey ]reconciledResource
64
+ hooks []* unstructured.Unstructured
65
+ config * rest.Config
66
+ rawConfig * rest.Config
67
+ dynamicIf dynamic.Interface
68
+ disco discovery.DiscoveryInterface
69
+ extensionsclientset * clientset.Clientset
70
+ kubectl kubeutil.Kubectl
71
+ resourceOps kubeutil.ResourceOperations
72
+ namespace string
73
+
74
+ dryRun bool
75
+ skipDryRunOnMissingResource bool
76
+ force bool
77
+ validate bool
78
+ skipHooks bool
79
+ resourcesFilter func (key kubeutil.ResourceKey , target * unstructured.Unstructured , live * unstructured.Unstructured ) bool
80
+ prune bool
81
+ replace bool
82
+ serverSideApply bool
83
+ serverSideApplyManager string
84
+ pruneLast bool
85
+ prunePropagationPolicy * metav1.DeletionPropagation
86
+ pruneConfirmed bool
87
+ clientSideApplyMigrationManager string
88
+ enableClientSideApplyMigration bool
89
+
90
+ syncRes map [string ]common.ResourceSyncResult
91
+ startedAt time.Time
92
+ revision string
93
+ phase common.OperationPhase
94
+ message string
95
+
96
+ log logr.Logger
97
+ // lock to protect concurrent updates of the result list
98
+ lock sync.Mutex
99
+
100
+ // syncNamespace is a function that will determine if the managed
101
+ // namespace should be synced
102
+ syncNamespace func (* unstructured.Unstructured , * unstructured.Unstructured ) (bool , error )
103
+
104
+ syncWaveHook common.SyncWaveHook
105
+
106
+ applyOutOfSyncOnly bool
107
+ // stores whether the resource is modified or not
108
+ modificationResult map [kubeutil.ResourceKey ]bool
109
+ }
110
+
60
111
// SyncOpt is a callback that update sync operation settings
61
112
type SyncOpt func (ctx * syncContext )
62
113
@@ -340,57 +391,6 @@ func (sc *syncContext) getOperationPhase(obj *unstructured.Unstructured) (common
340
391
return phase , message , nil
341
392
}
342
393
343
- type syncContext struct {
344
- healthOverride health.HealthOverride
345
- permissionValidator common.PermissionValidator
346
- resources map [kubeutil.ResourceKey ]reconciledResource
347
- hooks []* unstructured.Unstructured
348
- config * rest.Config
349
- rawConfig * rest.Config
350
- dynamicIf dynamic.Interface
351
- disco discovery.DiscoveryInterface
352
- extensionsclientset * clientset.Clientset
353
- kubectl kubeutil.Kubectl
354
- resourceOps kubeutil.ResourceOperations
355
- namespace string
356
-
357
- dryRun bool
358
- skipDryRunOnMissingResource bool
359
- force bool
360
- validate bool
361
- skipHooks bool
362
- resourcesFilter func (key kubeutil.ResourceKey , target * unstructured.Unstructured , live * unstructured.Unstructured ) bool
363
- prune bool
364
- replace bool
365
- serverSideApply bool
366
- serverSideApplyManager string
367
- pruneLast bool
368
- prunePropagationPolicy * metav1.DeletionPropagation
369
- pruneConfirmed bool
370
- clientSideApplyMigrationManager string
371
- enableClientSideApplyMigration bool
372
-
373
- syncRes map [string ]common.ResourceSyncResult
374
- startedAt time.Time
375
- revision string
376
- phase common.OperationPhase
377
- message string
378
-
379
- log logr.Logger
380
- // lock to protect concurrent updates of the result list
381
- lock sync.Mutex
382
-
383
- // syncNamespace is a function that will determine if the managed
384
- // namespace should be synced
385
- syncNamespace func (* unstructured.Unstructured , * unstructured.Unstructured ) (bool , error )
386
-
387
- syncWaveHook common.SyncWaveHook
388
-
389
- applyOutOfSyncOnly bool
390
- // stores whether the resource is modified or not
391
- modificationResult map [kubeutil.ResourceKey ]bool
392
- }
393
-
394
394
func (sc * syncContext ) setRunningPhase (tasks []* syncTask , isPendingDeletion bool ) {
395
395
if len (tasks ) > 0 {
396
396
firstTask := tasks [0 ]
0 commit comments