diff --git a/documentation/supported-versions.md b/documentation/supported-versions.md index 1a9a67b..b4776d4 100644 --- a/documentation/supported-versions.md +++ b/documentation/supported-versions.md @@ -215,7 +215,7 @@ const ( GatewayClassConditionStatusAccepted GatewayClassConditionType = "Accepted" ``` ------------------- -# Life cycke Gateway API +# Life cycle Gateway API https://gateway-api.sigs.k8s.io/concepts/versioning/ diff --git a/example/http-route/blue-green/README.md b/example/http-route/blue-green/README.md index 2909d56..122918b 100644 --- a/example/http-route/blue-green/README.md +++ b/example/http-route/blue-green/README.md @@ -53,4 +53,4 @@ $ sh test.sh 10 green ``` -Note that due to randomness, 9/1 ration might slightly differ +Note that due to randomness, 9/1 ratio might slightly differ diff --git a/hug/configuration/configuration.go b/hug/configuration/configuration.go index 3055c9d..07649d1 100644 --- a/hug/configuration/configuration.go +++ b/hug/configuration/configuration.go @@ -263,7 +263,7 @@ func (c *HUGConfig) Init(external External) error { c.CertsDir = filepath.Join(c.HaproxyDirs.CfgDir, config.DefaultCertsDirName) c.CertListDir = filepath.Join(c.HaproxyDirs.CfgDir, config.DefaultCertFilesDirName) c.MapsDir = filepath.Join(c.HaproxyDirs.CfgDir, config.DefaultMapsDirName) - c.PatternDir = filepath.Join(c.HaproxyDirs.CfgDir, config.DefaultPattenrDirName) + c.PatternDir = filepath.Join(c.HaproxyDirs.CfgDir, config.DefaultPatternDirName) c.ErrFileDir = filepath.Join(c.HaproxyDirs.CfgDir, config.DefaultErrFilesDirName) for _, d := range []string{ c.CertsDir, diff --git a/hug/haproxy/api/backend.go b/hug/haproxy/api/backend.go index ab7102b..4808b2c 100644 --- a/hug/haproxy/api/backend.go +++ b/hug/haproxy/api/backend.go @@ -169,10 +169,10 @@ func (c *clientNative) BackendEdit(backend models.Backend) error { return err } - // Check if only Servers were udpated + // Check if only Servers were updated onlyServersUpdated := false if cmp.Equal(previousBackend, backend, cmpopts.IgnoreFields(models.Backend{}, "Servers")) { - c.logger.LogAttrs(context.Background(), slog.LevelInfo, "Only Servers are udpated", + c.logger.LogAttrs(context.Background(), slog.LevelInfo, "Only Servers are updated", slog.String("backend", backend.Name), ) onlyServersUpdated = true @@ -212,7 +212,7 @@ func (c *clientNative) BackendEdit(backend models.Backend) error { ) } } else { - // We did not try runtime udpate (server create, for now is NOT done through runtime, it needs a realod) + // We did not try runtime update (server create, for now is NOT done through runtime, it needs a reload) reload.Instance().SetReload("[onlyServersUpdated] [reload needed] - backend %s", backend.Name) } } else { diff --git a/hug/haproxy/main.go b/hug/haproxy/main.go index 0478adf..245d2a5 100644 --- a/hug/haproxy/main.go +++ b/hug/haproxy/main.go @@ -246,8 +246,8 @@ func (h *AppManagerImpl) processUpdate(updated structured.Structured) error { var errors utils.Errors // Frontends - for _, udpatedFE := range updated.Frontends { - if udpatedFE == nil { + for _, updatedFE := range updated.Frontends { + if updatedFE == nil { // Should not happend h.logger.LogAttrs(context.Background(), slog.LevelError, "nil frontend") continue @@ -255,7 +255,7 @@ func (h *AppManagerImpl) processUpdate(updated structured.Structured) error { // TODO: need to check if only the Metadata has changed // If so, no need to reload - err := h.client.FrontendEdit(*udpatedFE) + err := h.client.FrontendEdit(*updatedFE) if err != nil { h.logger.LogAttrs(context.Background(), slog.LevelError, "failed to edit frontend", logging.LogAttrError(err), @@ -266,8 +266,8 @@ func (h *AppManagerImpl) processUpdate(updated structured.Structured) error { } // Backends - for _, udpatedBE := range updated.Backends { - if udpatedBE == nil { + for _, updatedBE := range updated.Backends { + if updatedBE == nil { // Should not happend h.logger.LogAttrs(context.Background(), slog.LevelError, "nil backend") continue @@ -275,7 +275,7 @@ func (h *AppManagerImpl) processUpdate(updated structured.Structured) error { // TODO: need to check if only the Metadata has changed // If so, no need to reload - err := h.client.BackendEdit(*udpatedBE) + err := h.client.BackendEdit(*updatedBE) if err != nil { h.logger.LogAttrs(context.Background(), slog.LevelError, "failed to edit backend", logging.LogAttrError(err), diff --git a/k8s/gate/config/defaults.go b/k8s/gate/config/defaults.go index d5b7f68..d2be9f4 100644 --- a/k8s/gate/config/defaults.go +++ b/k8s/gate/config/defaults.go @@ -34,7 +34,7 @@ const ( DefaultCertFilesDirName = "certlists" DefaultMapsDirName = "maps" DefaultErrFilesDirName = "errorfiles" - DefaultPattenrDirName = "patterns" + DefaultPatternDirName = "patterns" ) func (cfg *Configuration) ApplyDefaults() { @@ -91,6 +91,6 @@ func (cfg *Configuration) ApplyDefaults() { cfg.HaproxyParams.HaproxyDirs.ErrFileDir = DefaultErrFilesDirName } if cfg.HaproxyParams.HaproxyDirs.PatternDir == "" { - cfg.HaproxyParams.HaproxyDirs.PatternDir = DefaultPattenrDirName + cfg.HaproxyParams.HaproxyDirs.PatternDir = DefaultPatternDirName } } diff --git a/k8s/gate/haproxy/backends.go b/k8s/gate/haproxy/backends.go index 0067913..ecae418 100644 --- a/k8s/gate/haproxy/backends.go +++ b/k8s/gate/haproxy/backends.go @@ -351,7 +351,7 @@ func (b *HaproxyConfMgrImpl) mergeWithBackendCRs(backendRef gatewayv1.HTTPBacken continue } // We only accept v3.Backend or MergeType - // Note that MergType is not a real CRD, it's only a way to configure how the merge behaves. + // Note that MergeType is not a real CRD, it's only a way to configure how the merge behaves. // There is no: // - Group: gate.v3.haproxy.org // - Kind: MergeType CRDs diff --git a/k8s/gate/haproxy/certificates.go b/k8s/gate/haproxy/certificates.go index 56a0f0f..2c2410b 100644 --- a/k8s/gate/haproxy/certificates.go +++ b/k8s/gate/haproxy/certificates.go @@ -40,7 +40,7 @@ func (b *HaproxyConfMgrImpl) processCertificates() error { func (b *HaproxyConfMgrImpl) runtimeCertificatesPrechecks() { crtListUpdates := b.controllerStore.CrtListUpdates // Crt-list can not be created or deleted through runtime - // So, if there are nay created or deleted crt-lists, we need to reload. + // So, if there are any created or deleted crt-lists, we need to reload. // No further runtime update needed. if len(crtListUpdates.Created) > 0 { buffc := strings.Builder{} diff --git a/k8s/gate/haproxy/configuration.go b/k8s/gate/haproxy/configuration.go index 7e48292..41ada36 100644 --- a/k8s/gate/haproxy/configuration.go +++ b/k8s/gate/haproxy/configuration.go @@ -200,7 +200,7 @@ func (c *Configuration) upsertBackendWithServers(logger *slog.Logger, beName str c.structured.Backends[be.Name] = be // 2.2- If some servers were deleted, set the server to Maintenance through runtime - // TODO: we also need to check in HUG when we udpate the configuration that if BE differ only by deleted servers... + // TODO: we also need to check in HUG when we update the configuration that if BE differ only by deleted servers... runtimeServerStateData := make([]RuntimeServerStateData, 0) for serverName := range deletedServerNames { runtimeServerStateData = append(runtimeServerStateData, RuntimeServerStateData{ diff --git a/k8s/gate/store/cluster-updates.go b/k8s/gate/store/cluster-updates.go index 73bb8ce..970c4a2 100644 --- a/k8s/gate/store/cluster-updates.go +++ b/k8s/gate/store/cluster-updates.go @@ -41,12 +41,12 @@ type Update[T client.Object] struct { NewObject T Status Status // Indirect is set to true when the update is not direct from a K8s object but - // from a linked K8s object udpate + // from a linked K8s object update // For example a GatewayClass referencing a HugGate and the HugGate is updated Indirect bool } -// ClusterUpdated contains the udpates that happened to cluster objects during a sync cycle +// ClusterUpdated contains the updates that happened to cluster objects during a sync cycle type ClusterUpdates struct { GatewayClasses map[types.NamespacedName]Update[*gatewayv1.GatewayClass] Gateways map[types.NamespacedName]Update[*gatewayv1.Gateway] diff --git a/test/integration/base/inttest.go b/test/integration/base/inttest.go index cddedd3..881d405 100644 --- a/test/integration/base/inttest.go +++ b/test/integration/base/inttest.go @@ -172,7 +172,7 @@ func (test *IntTest) StartTestEnv(t *testing.T) { //revive:disable:function-leng g.Expect(err).ToNot(gomega.HaveOccurred()) modifiedCfg = strings.ReplaceAll(modifiedCfg, "/var/run/haproxy/health.sock", path.Join(dir, "health.sock")) } - err = writeInitalHaproxyCfg(hugConfig.HaproxyDirs.MainCfgFile, modifiedCfg) + err = writeInitialHaproxyCfg(hugConfig.HaproxyDirs.MainCfgFile, modifiedCfg) g.Expect(err).ToNot(gomega.HaveOccurred()) // Setup Gate lib configuration from HUG binary configuration @@ -352,8 +352,8 @@ func WriteKubeconfig(cfg *rest.Config) (string, error) { return kubeconfigPath, nil } -// writeInitalHaproxyCfg writes a string to a file at the specified path. -func writeInitalHaproxyCfg(dstFile, content string) error { +// writeInitialHaproxyCfg writes a string to a file at the specified path. +func writeInitialHaproxyCfg(dstFile, content string) error { // Use os.WriteFile which is a convenience function // to write a byte slice to a file. It handles opening, writing, and closing. // We convert the string to a byte slice. diff --git a/test/integration/utils/utils.go b/test/integration/utils/utils.go index d54d901..a31b98a 100644 --- a/test/integration/utils/utils.go +++ b/test/integration/utils/utils.go @@ -32,7 +32,7 @@ func GetIntTestNamespace() (string, error) { } dir = filepath.Base(dir) dir = strings.Map(func(r rune) rune { - if r < 'a' || r > 'z' && r != '-' { + if (r < 'a' || r > 'z') && r != '-' { return '-' } return r