improve disk change detection
This commit is contained in:
@@ -97,7 +97,8 @@ func (h *Handler) VmModifyEvent(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Check if a disk was added (or maybe removed?)
|
||||
if strings.Contains(change["type"], "config.hardware.device") &&
|
||||
strings.Contains(event.CloudEvent.Data.FullFormattedMessage, ".vmdk") {
|
||||
(strings.Contains(event.CloudEvent.Data.FullFormattedMessage, ".vmdk") ||
|
||||
strings.Contains(event.CloudEvent.Data.FullFormattedMessage, "capacityInKB")) {
|
||||
|
||||
// TODO - query current disk size from Inventory table and only create an update if the size is now changed
|
||||
if testConfig.DeviceChange != nil {
|
||||
|
@@ -24,6 +24,7 @@ func NewLoggingMiddleware(logger *slog.Logger, handler http.Handler) *LoggingMid
|
||||
func (l *LoggingMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
start := time.Now()
|
||||
l.handler.ServeHTTP(w, r)
|
||||
|
||||
l.logger.Debug(
|
||||
"Request recieved",
|
||||
slog.String("method", r.Method),
|
||||
|
@@ -3,7 +3,6 @@ package server
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -99,7 +98,7 @@ func SetTls(disableTls bool) Option {
|
||||
// SetCertificate sets the path to the certificate used for TLS, in PEM format
|
||||
func SetCertificate(tlsCertFilename string) Option {
|
||||
return func(s *Server) {
|
||||
fmt.Printf("Setting tlsCertFilename to '%s'\n", tlsCertFilename)
|
||||
//fmt.Printf("Setting tlsCertFilename to '%s'\n", tlsCertFilename)
|
||||
s.tlsCertFilename = tlsCertFilename
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user