add feature for live-reload when configuration changed
Signed-off-by: x893675 <x893675@icloud.com>
This commit is contained in:
@@ -50,7 +50,7 @@ type openpitrixHandler struct {
|
||||
openpitrix openpitrix.Interface
|
||||
}
|
||||
|
||||
func newOpenpitrixHandler(ksInformers informers.InformerFactory, ksClient versioned.Interface, option *openpitrixoptions.Options) *openpitrixHandler {
|
||||
func newOpenpitrixHandler(ksInformers informers.InformerFactory, ksClient versioned.Interface, option *openpitrixoptions.Options, stopCh <-chan struct{}) *openpitrixHandler {
|
||||
var s3Client s3.Interface
|
||||
if option != nil && option.S3Options != nil && len(option.S3Options.Endpoint) != 0 {
|
||||
var err error
|
||||
@@ -61,7 +61,7 @@ func newOpenpitrixHandler(ksInformers informers.InformerFactory, ksClient versio
|
||||
}
|
||||
|
||||
return &openpitrixHandler{
|
||||
openpitrix.NewOpenpitrixOperator(ksInformers, ksClient, s3Client),
|
||||
openpitrix.NewOpenpitrixOperator(ksInformers, ksClient, s3Client, stopCh),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,11 +38,11 @@ const (
|
||||
|
||||
var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
|
||||
|
||||
func AddToContainer(c *restful.Container, ksInfomrers informers.InformerFactory, ksClient versioned.Interface, options *openpitrixoptions.Options) error {
|
||||
func AddToContainer(c *restful.Container, ksInfomrers informers.InformerFactory, ksClient versioned.Interface, options *openpitrixoptions.Options, stopCh <-chan struct{}) error {
|
||||
mimePatch := []string{restful.MIME_JSON, runtime.MimeJsonPatchJson, runtime.MimeMergePatchJson}
|
||||
webservice := runtime.NewWebService(GroupVersion)
|
||||
|
||||
handler := newOpenpitrixHandler(ksInfomrers, ksClient, options)
|
||||
handler := newOpenpitrixHandler(ksInfomrers, ksClient, options, stopCh)
|
||||
|
||||
webservice.Route(webservice.POST("/repos").
|
||||
To(handler.CreateRepo).
|
||||
|
||||
Reference in New Issue
Block a user