зеркало из https://github.com/Azure/ARO-RP.git
more work on sets
This commit is contained in:
Родитель
8ac4ff4b61
Коммит
97cbd296f1
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/Azure/ARO-RP/pkg/metrics/statsd"
|
||||
"github.com/Azure/ARO-RP/pkg/metrics/statsd/golang"
|
||||
"github.com/Azure/ARO-RP/pkg/mimo/actuator"
|
||||
"github.com/Azure/ARO-RP/pkg/mimo/sets"
|
||||
"github.com/Azure/ARO-RP/pkg/proxy"
|
||||
utillog "github.com/Azure/ARO-RP/pkg/util/log"
|
||||
"github.com/Azure/ARO-RP/pkg/util/service"
|
||||
|
|
|
@ -1,8 +1,28 @@
|
|||
package sets
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/api"
|
||||
"github.com/Azure/ARO-RP/pkg/util/mimo"
|
||||
"github.com/Azure/ARO-RP/pkg/util/steps"
|
||||
)
|
||||
|
||||
const DEFAULT_POLL_TIME = time.Second * 10
|
||||
const DEFAULT_TIMEOUT_DURATION = time.Minute * 20
|
||||
|
||||
var DEFAULT_MAINTENANCE_SETS = map[string]MaintenanceSet{}
|
||||
var DEFAULT_MAINTENANCE_SETS = map[string]MaintenanceSet{
|
||||
"9b741734-6505-447f-8510-85eb0ae561a2": TLSCertRotation,
|
||||
}
|
||||
|
||||
func run(t mimo.TaskContext, s []steps.Step) (api.MaintenanceManifestState, string) {
|
||||
_, err := steps.Run(t, t.Log(), DEFAULT_POLL_TIME, s, t.Now)
|
||||
|
||||
if err != nil {
|
||||
if mimo.IsRetryableError(err) {
|
||||
return api.MaintenanceManifestStatePending, err.Error()
|
||||
}
|
||||
return api.MaintenanceManifestStateFailed, err.Error()
|
||||
}
|
||||
return api.MaintenanceManifestStateCompleted, t.GetResultMessage()
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package sets
|
||||
|
||||
import (
|
||||
"github.com/Azure/ARO-RP/pkg/api"
|
||||
"github.com/Azure/ARO-RP/pkg/mimo/tasks/cluster"
|
||||
"github.com/Azure/ARO-RP/pkg/util/mimo"
|
||||
"github.com/Azure/ARO-RP/pkg/util/steps"
|
||||
)
|
||||
|
||||
func TLSCertRotation(t mimo.TaskContext, doc *api.MaintenanceManifestDocument, oc *api.OpenShiftClusterDocument) (api.MaintenanceManifestState, string) {
|
||||
s := []steps.Step{
|
||||
steps.Action(cluster.EnsureAPIServerIsUp),
|
||||
}
|
||||
|
||||
return run(t, s)
|
||||
}
|
Загрузка…
Ссылка в новой задаче