This commit is contained in:
Amber Brown 2024-07-26 13:56:01 +10:00
Родитель 8ac4ff4b61
Коммит 97cbd296f1
3 изменённых файлов: 39 добавлений и 2 удалений

Просмотреть файл

@ -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)
}