mirror of
https://github.com/niusmallnan/steve.git
synced 2025-06-24 13:41:35 +00:00
Force autoscaling to use v2beta2 API
This commit is contained in:
parent
0badd210b1
commit
00da04b7d5
@ -17,6 +17,9 @@ var (
|
||||
preferredGroups = map[string]string{
|
||||
"extensions": "apps",
|
||||
}
|
||||
preferredVersionOverride = map[string]string{
|
||||
"autoscaling/v1": "v2beta2",
|
||||
}
|
||||
)
|
||||
|
||||
func AddDiscovery(client discovery.DiscoveryInterface, schemasMap map[string]*types.APISchema) error {
|
||||
@ -50,6 +53,14 @@ func indexVersions(groups []*metav1.APIGroup) map[string]string {
|
||||
result := map[string]string{}
|
||||
for _, group := range groups {
|
||||
result[group.Name] = group.PreferredVersion.Version
|
||||
if override, ok := preferredVersionOverride[group.Name+"/"+group.PreferredVersion.Version]; ok {
|
||||
for _, version := range group.Versions {
|
||||
// ensure override version exists
|
||||
if version.Version == override {
|
||||
result[group.Name] = override
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user