|
9 | 9 | )
|
10 | 10 |
|
11 | 11 | // FeatureGateDescription is a golang-only interface used to contains details for a feature gate.
|
| 12 | +// |
| 13 | +//nolint:all |
12 | 14 | type FeatureGateDescription struct {
|
13 | 15 | // FeatureGateAttributes is the information that appears in the API
|
14 | 16 | FeatureGateAttributes configv1.FeatureGateAttributes
|
@@ -45,12 +47,14 @@ var (
|
45 | 47 | kubernetes = OwningProduct("Kubernetes")
|
46 | 48 | )
|
47 | 49 |
|
| 50 | +//nolint:all |
48 | 51 | type featureGateBuilder struct {
|
49 |
| - name string |
50 |
| - owningJiraComponent string |
51 |
| - responsiblePerson string |
52 |
| - owningProduct OwningProduct |
53 |
| - enhancementPRURL string |
| 52 | + name string |
| 53 | + owningJiraComponent string |
| 54 | + responsiblePerson string |
| 55 | + owningProduct OwningProduct |
| 56 | + enhancementPRURL string |
| 57 | + minimumKubeletVersion string |
54 | 58 |
|
55 | 59 | statusByClusterProfileByFeatureSet map[ClusterProfileName]map[configv1.FeatureSet]bool
|
56 | 60 | }
|
@@ -111,6 +115,11 @@ func (b *featureGateBuilder) enableForClusterProfile(clusterProfile ClusterProfi
|
111 | 115 | return b
|
112 | 116 | }
|
113 | 117 |
|
| 118 | +func (b *featureGateBuilder) requiredMinimumKubeletVersion(version string) *featureGateBuilder { |
| 119 | + b.minimumKubeletVersion = version |
| 120 | + return b |
| 121 | +} |
| 122 | + |
114 | 123 | func (b *featureGateBuilder) register() (configv1.FeatureGateName, error) {
|
115 | 124 | if len(b.name) == 0 {
|
116 | 125 | return "", fmt.Errorf("missing name")
|
@@ -142,9 +151,20 @@ func (b *featureGateBuilder) register() (configv1.FeatureGateName, error) {
|
142 | 151 | }
|
143 | 152 |
|
144 | 153 | featureGateName := configv1.FeatureGateName(b.name)
|
| 154 | + var minComponentVersions []configv1.MinimumComponentVersion |
| 155 | + if b.minimumKubeletVersion != "" { |
| 156 | + if minComponentVersions == nil { |
| 157 | + minComponentVersions = []configv1.MinimumComponentVersion{} |
| 158 | + } |
| 159 | + minComponentVersions = append(minComponentVersions, configv1.MinimumComponentVersion{ |
| 160 | + Component: configv1.MinimumComponentKubelet, |
| 161 | + Version: b.minimumKubeletVersion, |
| 162 | + }) |
| 163 | + } |
145 | 164 | description := FeatureGateDescription{
|
146 | 165 | FeatureGateAttributes: configv1.FeatureGateAttributes{
|
147 |
| - Name: featureGateName, |
| 166 | + Name: featureGateName, |
| 167 | + RequiredMinimumComponentVersions: minComponentVersions, |
148 | 168 | },
|
149 | 169 | OwningJiraComponent: b.owningJiraComponent,
|
150 | 170 | ResponsiblePerson: b.responsiblePerson,
|
|
0 commit comments