Skip to content

Commit de1c457

Browse files
committed
feat(config): extend the config to include startup node taint key
we extend the provisioner config to include the startup node taint key.
1 parent 6e965cc commit de1c457

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

pkg/common/common.go

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ type UserConfig struct {
119119
LabelsForPV map[string]string
120120
// SetPVOwnerRef indicates if PVs should be dependents of the owner Node
121121
SetPVOwnerRef bool
122+
// RemoveNodeNotReadyTaint indicates if the provisioner should remove the taint with provisionerNotReadyNodeTaintKey
123+
// once it becomes ready.
124+
RemoveNodeNotReadyTaint bool
125+
// ProvisionerNotReadyNodeTaintKey is the key of the startup taint that provisioner will remove once it becomes ready.
126+
ProvisionerNotReadyNodeTaintKey string
122127
}
123128

124129
// MountConfig stores a configuration for discoverying a specific storageclass
@@ -228,6 +233,13 @@ type ProvisionerConfiguration struct {
228233
LabelsForPV map[string]string `json:"labelsForPV" yaml:"labelsForPV"`
229234
// SetPVOwnerRef indicates if PVs should be dependents of the owner Node, default to false
230235
SetPVOwnerRef bool `json:"setPVOwnerRef" yaml:"setPVOwnerRef"`
236+
// RemoveNodeNotReadyTaint controls whether the provisioner should remove the taint with provisionerNotReadyNodeTaintKey
237+
// once it becomes ready.
238+
// +optional
239+
RemoveNodeNotReadyTaint bool `json:"removeNodeNotReadyTaint" yaml:"removeNodeNotReadyTaint"`
240+
// ProvisionerNotReadyNodeTaintKey is the key of the startup taint that provisioner will remove once it becomes ready.
241+
// +optional
242+
ProvisionerNotReadyNodeTaintKey string `json:"provisionerNotReadyNodeTaintKey" yaml:"provisionerNotReadyNodeTaintKey"`
231243
}
232244

233245
// CreateLocalPVSpec returns a PV spec that can be used for PV creation
@@ -403,18 +415,20 @@ func insertSpaces(original string) string {
403415
// UserConfigFromProvisionerConfig creates a UserConfig from the provided ProvisionerConfiguration struct
404416
func UserConfigFromProvisionerConfig(node *v1.Node, namespace, jobImage string, config ProvisionerConfiguration) *UserConfig {
405417
return &UserConfig{
406-
Node: node,
407-
DiscoveryMap: config.StorageClassConfig,
408-
NodeLabelsForPV: config.NodeLabelsForPV,
409-
UseAlphaAPI: config.UseAlphaAPI,
410-
UseJobForCleaning: config.UseJobForCleaning,
411-
MinResyncPeriod: config.MinResyncPeriod,
412-
UseNodeNameOnly: config.UseNodeNameOnly,
413-
Namespace: namespace,
414-
JobContainerImage: jobImage,
415-
JobTolerations: config.JobTolerations,
416-
LabelsForPV: config.LabelsForPV,
417-
SetPVOwnerRef: config.SetPVOwnerRef,
418+
Node: node,
419+
DiscoveryMap: config.StorageClassConfig,
420+
NodeLabelsForPV: config.NodeLabelsForPV,
421+
UseAlphaAPI: config.UseAlphaAPI,
422+
UseJobForCleaning: config.UseJobForCleaning,
423+
MinResyncPeriod: config.MinResyncPeriod,
424+
UseNodeNameOnly: config.UseNodeNameOnly,
425+
Namespace: namespace,
426+
JobContainerImage: jobImage,
427+
JobTolerations: config.JobTolerations,
428+
LabelsForPV: config.LabelsForPV,
429+
SetPVOwnerRef: config.SetPVOwnerRef,
430+
RemoveNodeNotReadyTaint: config.RemoveNodeNotReadyTaint,
431+
ProvisionerNotReadyNodeTaintKey: config.ProvisionerNotReadyNodeTaintKey,
418432
}
419433
}
420434

0 commit comments

Comments
 (0)