Unverified Commit c2a5645c authored by Minseong Choi's avatar Minseong Choi 💬
Browse files

fix: keep internal section numbers out of runtime messages

Four messages that reach an operator or an API client cited sections
of a specification nobody outside the project can read:

- the unimplemented archive store error from config load
- the running-server cap refusal, from both the user wake and the
  internal wake
- the missing memory ceiling guard, in the API and in felis apply

The references are gone and the wording is otherwise unchanged. Each
message still says what went wrong and, where there is one, what to
do about it. The test for the archive store message checks for the
tarLocal remediation, which is still there.
parent 9ee8c48f
Loading
Loading
Loading
Loading
+1 −1
Changes for cmd/felis/apply.go: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ func buildMinecraftServerFromApplyRequest(req applyRequest, namespace string) (*
	}
	memLim, ok := limits[corev1.ResourceMemory]
	if !ok || memLim.IsZero() {
		return nil, fmt.Errorf("internal error: refusing to create a server without a memory ceiling (§22)")
		return nil, fmt.Errorf("internal error: refusing to create a server without a memory ceiling")
	}

	// ---- storage ----
+1 −1
Changes for internal/api/handlers_internal.go: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ func (a *API) handleInternalWake(w http.ResponseWriter, r *http.Request) {
	}
	if !ok {
		writeError(w, r, newError(http.StatusServiceUnavailable, "at_capacity",
			"the cluster is at its running-server cap (spec §9.1); retry once a server stops"))
			"the cluster is at its running-server cap; retry once a server stops"))
		return
	}

+2 −2
Changes for internal/api/handlers_user.go: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ func (a *API) handleWake(w http.ResponseWriter, r *http.Request) {
	}
	if !ok {
		writeError(w, r, newError(http.StatusServiceUnavailable, "at_capacity",
			"the cluster is at its running-server cap (spec §9.1); retry once a server stops"))
			"the cluster is at its running-server cap; retry once a server stops"))
		return
	}

@@ -526,7 +526,7 @@ func resolveResources(memory string, rr *resourceRequest) (string, corev1.Resour
	memLim, ok := limits[corev1.ResourceMemory]
	if !ok || memLim.IsZero() {
		return "", corev1.ResourceRequirements{}, newError(http.StatusInternalServerError, "internal",
			"refusing to create a server without a memory ceiling (§22)")
			"refusing to create a server without a memory ceiling")
	}

	return deriveJavaHeap(memLim), corev1.ResourceRequirements{Limits: limits, Requests: requests}, nil
+1 −1
Changes for internal/config/config.go: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ func (c *Config) Validate() error {
		return fmt.Errorf("config: [archive] store %q is not one of tarLocal|tarS3|volumeSnapshot|longhorn", c.Archive.Store)
	}
	if _, ok := implementedArchiveStores[c.Archive.Store]; !ok {
		return fmt.Errorf("config: [archive] store %q is recognized by §19 but not implemented in this build — only tarLocal is supported; set store = \"tarLocal\"", c.Archive.Store)
		return fmt.Errorf("config: [archive] store %q is not implemented in this build — only tarLocal is supported; set store = \"tarLocal\"", c.Archive.Store)
	}
	switch c.K8s.EgressMode {
	case "loadbalancer", "nodeport":