diff --git a/embedded_spec.go b/embedded_spec.go index 78cc6b3f..40fb939b 100644 --- a/embedded_spec.go +++ b/embedded_spec.go @@ -22412,6 +22412,9 @@ func init() { "name": "file_upload", "in": "formData" }, + { + "$ref": "#/parameters/skip_reload" + }, { "$ref": "#/parameters/force_reload" } @@ -29765,6 +29768,7 @@ func init() { "set-tos", "set-uri", "set-var", + "set-var-fmt", "silent-drop", "strict-mode", "tarpit", @@ -74052,6 +74056,13 @@ func init() { "name": "file_upload", "in": "formData" }, + { + "type": "boolean", + "default": false, + "description": "If set, no reload will be initiated after update", + "name": "skip_reload", + "in": "query" + }, { "type": "boolean", "default": false, @@ -82277,6 +82288,7 @@ func init() { "set-tos", "set-uri", "set-var", + "set-var-fmt", "silent-drop", "strict-mode", "tarpit", diff --git a/go.mod b/go.mod index 53f45667..7aed2eb0 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/renameio v1.0.1 github.com/google/uuid v1.6.0 - github.com/haproxytech/client-native/v6 v6.1.1-0.20250227130014-5f594df98579 + github.com/haproxytech/client-native/v6 v6.1.1-0.20250317131355-4fd44b5ebeb7 github.com/jessevdk/go-flags v1.6.1 github.com/joho/godotenv v1.5.1 github.com/json-iterator/go v1.1.12 @@ -39,7 +39,7 @@ require ( github.com/stretchr/testify v1.10.0 go.uber.org/automaxprocs v1.6.0 golang.org/x/net v0.36.0 - golang.org/x/sys v0.30.0 + golang.org/x/sys v0.31.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -86,6 +86,6 @@ require ( github.com/tklauser/numcpus v0.9.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.mongodb.org/mongo-driver v1.17.3 // indirect - golang.org/x/sync v0.11.0 // indirect + golang.org/x/sync v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 34760d18..aea0a114 100644 --- a/go.sum +++ b/go.sum @@ -88,8 +88,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/haproxytech/client-native/v5 v5.1.15 h1:oMqyDlh+vL3yRKiaapc6SESetCIir/Of3F75vtpG1Nk= github.com/haproxytech/client-native/v5 v5.1.15/go.mod h1:6eT7/KOsczPHFE/op1TDwfo0jQAsMffl7PuXkKJ+Mt0= -github.com/haproxytech/client-native/v6 v6.1.1-0.20250227130014-5f594df98579 h1:/bKToN0KZg+ynOL7SIGJjy3Js36fB+uVLPgT7DtFH3o= -github.com/haproxytech/client-native/v6 v6.1.1-0.20250227130014-5f594df98579/go.mod h1:9DfctWwuRuHPPj5T01N+eFguIqWLzukF8msykecSSOk= +github.com/haproxytech/client-native/v6 v6.1.1-0.20250317131355-4fd44b5ebeb7 h1:gyeH3roRLPuiZv1v7wMfGbrJewPQe/bVMSmmEJe/HZ0= +github.com/haproxytech/client-native/v6 v6.1.1-0.20250317131355-4fd44b5ebeb7/go.mod h1:WbfPjQf1zkR7VLuzHK9IPemBahJj2lBjjZ9hhfeO/uE= github.com/haproxytech/go-logger v1.1.0 h1:HgGtYaI1ApkvbQdsm7f9AzQQoxTB7w37criTflh7IQE= github.com/haproxytech/go-logger v1.1.0/go.mod h1:OekUd8HCb7ubxMplzHUPBTHNxZmddOWfOjWclZsqIeM= github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bBK4= @@ -178,15 +178,15 @@ go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/handlers/ssl_cert_storage.go b/handlers/ssl_cert_storage.go index 03801a73..58ed6fb2 100644 --- a/handlers/ssl_cert_storage.go +++ b/handlers/ssl_cert_storage.go @@ -275,11 +275,20 @@ func (h *StorageCreateStorageSSLCertificateHandlerImpl) Handle(params storage.Cr IPAddresses: info.IPs, } + skipReload := false + if params.SkipReload != nil { + skipReload = *params.SkipReload + } + forceReload := false if params.ForceReload != nil { forceReload = *params.ForceReload } + if skipReload { + return storage.NewCreateStorageSSLCertificateCreated().WithPayload(retf) + } + if forceReload { err := h.ReloadAgent.ForceReload() if err != nil { diff --git a/operations/storage/create_storage_s_s_l_certificate_parameters.go b/operations/storage/create_storage_s_s_l_certificate_parameters.go index edb4b7f2..b552602d 100644 --- a/operations/storage/create_storage_s_s_l_certificate_parameters.go +++ b/operations/storage/create_storage_s_s_l_certificate_parameters.go @@ -47,10 +47,13 @@ func NewCreateStorageSSLCertificateParams() CreateStorageSSLCertificateParams { // initialize parameters with default values forceReloadDefault = bool(false) + skipReloadDefault = bool(false) ) return CreateStorageSSLCertificateParams{ ForceReload: &forceReloadDefault, + + SkipReload: &skipReloadDefault, } } @@ -72,6 +75,11 @@ type CreateStorageSSLCertificateParams struct { Default: false */ ForceReload *bool + /*If set, no reload will be initiated after update + In: query + Default: false + */ + SkipReload *bool } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface @@ -108,6 +116,11 @@ func (o *CreateStorageSSLCertificateParams) BindRequest(r *http.Request, route * if err := o.bindForceReload(qForceReload, qhkForceReload, route.Formats); err != nil { res = append(res, err) } + + qSkipReload, qhkSkipReload, _ := qs.GetOK("skip_reload") + if err := o.bindSkipReload(qSkipReload, qhkSkipReload, route.Formats); err != nil { + res = append(res, err) + } if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -144,3 +157,27 @@ func (o *CreateStorageSSLCertificateParams) bindForceReload(rawData []string, ha return nil } + +// bindSkipReload binds and validates parameter SkipReload from query. +func (o *CreateStorageSSLCertificateParams) bindSkipReload(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewCreateStorageSSLCertificateParams() + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("skip_reload", "query", "bool", raw) + } + o.SkipReload = &value + + return nil +} diff --git a/operations/storage/create_storage_s_s_l_certificate_urlbuilder.go b/operations/storage/create_storage_s_s_l_certificate_urlbuilder.go index 88d3a121..63a14ad2 100644 --- a/operations/storage/create_storage_s_s_l_certificate_urlbuilder.go +++ b/operations/storage/create_storage_s_s_l_certificate_urlbuilder.go @@ -31,6 +31,7 @@ import ( // CreateStorageSSLCertificateURL generates an URL for the create storage s s l certificate operation type CreateStorageSSLCertificateURL struct { ForceReload *bool + SkipReload *bool _basePath string // avoid unkeyed usage @@ -74,6 +75,14 @@ func (o *CreateStorageSSLCertificateURL) Build() (*url.URL, error) { qs.Set("force_reload", forceReloadQ) } + var skipReloadQ string + if o.SkipReload != nil { + skipReloadQ = swag.FormatBool(*o.SkipReload) + } + if skipReloadQ != "" { + qs.Set("skip_reload", skipReloadQ) + } + _result.RawQuery = qs.Encode() return &_result, nil