INNER CODE UNIT · Go

validateQuantityFlags

k8up-io/k8up · cmd/operator/main.go:162

func validateQuantityFlags(ctx *cli.Context) error {
	quantityFlags := []string{
		"global-cpu-request",
		"global-cpu-limit",
		"global-memory-request",
		"global-memory-limit",
	}

	for _, f := range quantityFlags {
		if !ctx.IsSet(f) {
			continue
		}

		v := ctx.String(f)
		_, err := resource.ParseQuantity(v)
		if err != nil {
			return fmt.Errorf("the value '%s' of flag '%s' is not a valid Kubernetes quantity: %w", v, f, err)
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…