зеркало из https://github.com/Azure/ARO-RP.git
Adds exported APIVersion constants to API packages
This commit is contained in:
Родитель
726c1b0784
Коммит
a5cf880ca2
|
@ -7,13 +7,16 @@ import (
|
|||
"github.com/Azure/ARO-RP/pkg/api"
|
||||
)
|
||||
|
||||
// APIVersion contains a version string as it will be used by clients
|
||||
const APIVersion = "admin"
|
||||
|
||||
const (
|
||||
resourceProviderNamespace = "Microsoft.RedHatOpenShift"
|
||||
resourceType = "openShiftClusters"
|
||||
)
|
||||
|
||||
func init() {
|
||||
api.APIs["admin"] = &api.Version{
|
||||
api.APIs[APIVersion] = &api.Version{
|
||||
OpenShiftClusterConverter: func() api.OpenShiftClusterConverter {
|
||||
return &openShiftClusterConverter{}
|
||||
},
|
||||
|
|
|
@ -7,13 +7,16 @@ import (
|
|||
"github.com/Azure/ARO-RP/pkg/api"
|
||||
)
|
||||
|
||||
// APIVersion contains a version string as it will be used by clients
|
||||
const APIVersion = "2019-12-31-preview"
|
||||
|
||||
const (
|
||||
resourceProviderNamespace = "Microsoft.RedHatOpenShift"
|
||||
resourceType = "openShiftClusters"
|
||||
)
|
||||
|
||||
func init() {
|
||||
api.APIs["2019-12-31-preview"] = &api.Version{
|
||||
api.APIs[APIVersion] = &api.Version{
|
||||
OpenShiftClusterConverter: func() api.OpenShiftClusterConverter {
|
||||
return &openShiftClusterConverter{}
|
||||
},
|
||||
|
|
|
@ -17,6 +17,7 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/api"
|
||||
"github.com/Azure/ARO-RP/pkg/api/admin"
|
||||
"github.com/Azure/ARO-RP/pkg/database/cosmosdb"
|
||||
"github.com/Azure/ARO-RP/pkg/frontend/middleware"
|
||||
)
|
||||
|
@ -142,7 +143,7 @@ func (f *frontend) _putOrPatchOpenShiftCluster(ctx context.Context, r *http.Requ
|
|||
} else {
|
||||
// TODO: Get rid of the special case
|
||||
vars := mux.Vars(r)
|
||||
if vars["api-version"] == "admin" {
|
||||
if vars["api-version"] == admin.APIVersion {
|
||||
doc.OpenShiftCluster.Properties.ProvisioningState = api.ProvisioningStateAdminUpdating
|
||||
} else {
|
||||
doc.OpenShiftCluster.Properties.ProvisioningState = api.ProvisioningStateUpdating
|
||||
|
|
Загрузка…
Ссылка в новой задаче