Skip to content

Commit 0272f58

Browse files
committed
using latest fork bump for o/api
1 parent 7329a7e commit 0272f58

12 files changed

Lines changed: 35 additions & 67 deletions

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ require (
115115

116116
replace github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12
117117

118-
replace github.com/openshift/api => github.com/miyadav/api v0.0.0-20260617162329-2cf942dc34c9
118+
replace github.com/openshift/api => github.com/miyadav/api v0.0.0-20260618103613-8816b16ded02

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
9696
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
9797
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
9898
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
99-
github.com/miyadav/api v0.0.0-20260617162329-2cf942dc34c9 h1:4g4WrcEUqtgQFhXfl1DrCFV6XYoR01k728G5LqEvP9I=
100-
github.com/miyadav/api v0.0.0-20260617162329-2cf942dc34c9/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo=
99+
github.com/miyadav/api v0.0.0-20260618103613-8816b16ded02 h1:3+MX3YjdG+fdc7TO12YT1wsWvHkzpzlqvEK765+Y778=
100+
github.com/miyadav/api v0.0.0-20260618103613-8816b16ded02/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo=
101101
github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU=
102102
github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
103103
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=

lib/capability/capability.go

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,34 @@ import (
99
configv1 "github.com/openshift/api/config/v1"
1010
)
1111

12-
// featureGatedCapabilities maps feature gate names to the capabilities they
13-
// gate. When a feature gate is absent from the enabled set, its capabilities
14-
// are excluded from Known, Enabled, and baseline capability set resolution.
15-
// This mirrors the FeatureGateAwareEnum annotations on ClusterVersionCapability
16-
// in the openshift/api types.
17-
var featureGatedCapabilities = map[string][]configv1.ClusterVersionCapability{
18-
"CRDCompatibilityRequirementOperator": {
19-
configv1.ClusterVersionCapabilityCompatibilityRequirements,
20-
configv1.ClusterVersionCapabilityClusterAPI,
12+
// featureGatedCapabilities maps each gated capability to the feature gates
13+
// that can make it available. A capability is included when ANY of its listed
14+
// gates is present in the enabled set. This mirrors the FeatureGateAwareEnum
15+
// annotations on ClusterVersionCapability in the openshift/api types.
16+
var featureGatedCapabilities = map[configv1.ClusterVersionCapability][]string{
17+
configv1.ClusterVersionCapabilityCompatibilityRequirements: {
18+
"CRDCompatibilityRequirementOperator",
19+
"ClusterAPIMachineManagement",
20+
},
21+
configv1.ClusterVersionCapabilityClusterAPI: {
22+
"ClusterAPIMachineManagement",
2123
},
2224
}
2325

2426
// gatedCapabilities returns the set of capabilities that should be excluded
25-
// because their required feature gates are not in enabledFeatureGates.
27+
// because none of their enabling feature gates are in enabledFeatureGates.
2628
func gatedCapabilities(enabledFeatureGates sets.Set[string]) sets.Set[configv1.ClusterVersionCapability] {
2729
excluded := sets.New[configv1.ClusterVersionCapability]()
28-
for gate, caps := range featureGatedCapabilities {
29-
if !enabledFeatureGates.Has(gate) {
30-
excluded.Insert(caps...)
30+
for cap, gates := range featureGatedCapabilities {
31+
enabled := false
32+
for _, gate := range gates {
33+
if enabledFeatureGates.Has(gate) {
34+
enabled = true
35+
break
36+
}
37+
}
38+
if !enabled {
39+
excluded.Insert(cap)
3140
}
3241
}
3342
return excluded

lib/capability/capability_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
// allFeatureGates returns a feature gate set with all gates that gate capabilities enabled.
1515
func allFeatureGates() sets.Set[string] {
1616
gates := sets.New[string]()
17-
for gate := range featureGatedCapabilities {
18-
gates.Insert(gate)
17+
for _, capGates := range featureGatedCapabilities {
18+
gates.Insert(capGates...)
1919
}
2020
return gates
2121
}

vendor/github.com/openshift/api/config/v1/types_cluster_version.go

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-CustomNoUpgrade.crd.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-DevPreviewNoUpgrade.crd.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-OKD.crd.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-TechPreviewNoUpgrade.crd.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)