Skip to content

Commit

Permalink
minecraft: restore default value handling (#246)
Browse files Browse the repository at this point in the history
itzg authored Dec 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 62869b5 commit 179068a
Showing 4 changed files with 38 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/minecraft/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: minecraft
version: 4.23.5
version: 4.23.6
appVersion: SeeValues
home: https://minecraft.net/
description: Minecraft server
2 changes: 2 additions & 0 deletions charts/minecraft/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -26,11 +26,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- end -}}

{{- define "minecraft.envMap" }}
{{- if ne (toString (index . 1)) "default" }}
{{- if or (index . 1) (kindIs "float64" (index . 1)) (kindIs "bool" (index . 1)) }}
- name: {{ index . 0 }}
value: {{ index . 1 | quote }}
{{- end }}
{{- end }}
{{- end }}

{{- define "tplRender" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
33 changes: 27 additions & 6 deletions charts/minecraft/values.schema.json
Original file line number Diff line number Diff line change
@@ -30,10 +30,16 @@
"type": "string"
},
"maxPlayers": {
"type": "integer"
"oneOf": [
{"type": "integer"},
{"enum": ["default"]}
]
},
"maxWorldSize": {
"type": "integer"
"oneOf": [
{"type": "integer"},
{"enum": ["default"]}
]
},
"modrinth": {
"type": "object",
@@ -50,7 +56,7 @@
"type": "boolean"
},
"allowedVersionType": {
"enum": ["release", "beta", "alpha"]
"enum": ["release", "beta", "alpha", "default"]
}
}
},
@@ -135,13 +141,28 @@
}
},
"maxBuildHeight": {
"type": "integer"
"oneOf": [
{"type": "integer"},
{"enum": ["default"]}
]
},
"maxTickTime": {
"type": "integer"
"oneOf": [
{"type": "integer"},
{"enum": ["default"]}
]
},
"spawnProtection": {
"type": "integer"
"oneOf": [
{"type": "integer"},
{"enum": ["default"]}
]
},
"viewDistance": {
"oneOf": [
{"type": "integer"},
{"enum": ["default"]}
]
},
"ftbLegacyJavaFixer": {
"anyOf": [{"type": "string", "enum": ["default"]}, {"type": "boolean"}]},
19 changes: 8 additions & 11 deletions charts/minecraft/values.yaml
Original file line number Diff line number Diff line change
@@ -203,9 +203,9 @@ minecraftServer:
# A server icon URL for server listings. Auto-scaled and transcoded.
icon:
# Max connected players.
maxPlayers: 20
maxPlayers: default
# This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain.
maxWorldSize: 10000
maxWorldSize: default
# Allows players to travel to the Nether.
allowNether: default
# Allows server to announce when a player gets an achievement.
@@ -219,19 +219,19 @@ minecraftServer:
# If set to true, players will be set to spectator mode if they die.
hardcore: default
# The maximum height in which building is allowed.
maxBuildHeight: 256
maxBuildHeight: default
# The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message. -1 disables this entirely.
maxTickTime: 60000
maxTickTime: default
# Determines if animals will be able to spawn.
spawnAnimals: default
# Determines if monsters will be spawned.
spawnMonsters: default
# Determines if villagers will be spawned.
spawnNPCs: default
# Sets the area that non-ops can not edit (0 to disable)
spawnProtection: 16
spawnProtection: default
# Max view distance (in chunks).
viewDistance: 10
viewDistance: default
# Define this if you want a specific map generation seed.
levelSeed:
# One of: creative, survival, adventure, spectator
@@ -273,10 +273,7 @@ minecraftServer:
jvmOpts: ""
# Options like -X that need to proceed general JVM options
jvmXXOpts: ""
# By default, the server configuration will be created and set based on the following environment variables, but only the first time the server is started
# If you would like to override the server configuration each time the container starts up, you can set this to true
# see https://github.com/itzg/docker-minecraft-server#server-configuration
overrideServerProperties: false
overrideServerProperties: default
# DEPRECATED: use top-level rconServiceAnnotations instead
serviceAnnotations: {}
serviceType: ClusterIP
@@ -309,7 +306,7 @@ minecraftServer:
# Downloads Modrinth project dependencies marked as optional
optionalDependencies: false
# The version type is used to determine the newest version to use from each project. The allowed values are: release, beta, alpha
allowedVersionType: release
allowedVersionType: default

# Config for AUTO_CURSEFORGE server type
autoCurseForge:

0 comments on commit 179068a

Please sign in to comment.