You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// EmulationForwardCompatible is an option to implicitly enable all APIs which are introduced after the emulation version and
158
+
// have higher priority than APIs of the same group resource enabled at the emulation version.
159
+
// If true, all APIs that have higher priority than the APIs of the same group resource enabled at the emulation version will be installed.
160
+
// This is needed when a controller implementation migrates to newer API versions, for the binary version, and also uses the newer API versions even when emulation version is set.
161
+
EmulationForwardCompatiblebool
162
+
// RuntimeConfigEmulationForwardCompatible is an option to explicitly enable specific APIs introduced after the emulation version through the runtime-config.
163
+
// If true, APIs identified by group/version that are enabled in the --runtime-config flag will be installed even if it is introduced after the emulation version. --runtime-config flag values that identify multiple APIs, such as api/all,api/ga,api/beta, are not influenced by this flag and will only enable APIs available at the current emulation version.
164
+
// If false, error would be thrown if any GroupVersion or GroupVersionResource explicitly enabled in the --runtime-config flag is introduced after the emulation version.
165
+
RuntimeConfigEmulationForwardCompatiblebool
157
166
// FeatureGate is a way to plumb feature gate through if you have them.
158
167
FeatureGate featuregate.FeatureGate
159
168
// AuditBackend is where audit events are sent to.
// resourceExpirationEvaluator holds info for deciding if a particular rest.Storage needs to excluded from the API
35
39
typeresourceExpirationEvaluatorstruct {
36
-
currentVersion*apimachineryversion.Version
37
-
isAlphabool
40
+
currentVersion*apimachineryversion.Version
41
+
emulationForwardCompatiblebool
42
+
runtimeConfigEmulationForwardCompatiblebool
43
+
isAlphabool
38
44
// Special flag checking for the existence of alpha.0
39
45
// alpha.0 is a special case where everything merged to master is auto propagated to the release-1.n branch
40
46
isAlphaZerobool
@@ -50,20 +56,41 @@ type resourceExpirationEvaluator struct {
50
56
51
57
// ResourceExpirationEvaluator indicates whether or not a resource should be served.
52
58
typeResourceExpirationEvaluatorinterface {
53
-
// RemoveDeletedKinds inspects the storage map and modifies it in place by removing storage for kinds that have been deleted.
59
+
// RemoveUnavailableKinds inspects the storage map and modifies it in place by removing storage for kinds that have been deleted or are introduced after the current version.
54
60
// versionedResourcesStorageMap mirrors the field on APIGroupInfo, it's a map from version to resource to the storage.
// removeUnintroducedKinds inspects the storage map and modifies it in place by removing storage for kinds that are introduced after the current version.
217
+
// versionedResourcesStorageMap mirrors the field on APIGroupInfo, it's a map from version to resource to the storage.
// we check the resource enablement from low priority to high priority.
233
+
// If the same resource with a different version that we have checked so far is already enabled, that means some resource with the same resourceName and a lower priority version has been enabled.
234
+
// Then emulation forward compatibility for the version being checked now is made based on this information.
klog.V(1).Infof("Removing resource %v.%v.%v because it is introduced after the current version %s per APILifecycle.", resourceName, apiVersion, groupName, e.currentVersion.String())
"cannot enable version %s in runtime-config because all the resources have been introduced after the current version %s. Consider setting --runtime-config-emulation-forward-compatible=true",
272
+
gv, e.currentVersion)
273
+
}
274
+
klog.V(1).Infof("Removing version %v.%v because it is introduced after the current version %s and because it has no resources per APILifecycle.", apiVersion, groupName, e.currentVersion.String())
returnfalse, fmt.Errorf("cannot enable resource %s in runtime-config because it is introduced at %s after the current version %s. Consider setting --runtime-config-emulation-forward-compatible=true",
0 commit comments