From b1e0df0f4b69c32f5342f550e074bc8ab129d6ef Mon Sep 17 00:00:00 2001 From: kryojenik Date: Sat, 3 Jun 2023 07:33:31 -0500 Subject: [PATCH] migrate(factorio) migrate factorio to new common (#9331) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Migrate factorio to new common ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** Used helm lint on the chart and passed helm install was sucessful Rendered questions.yaml in an instance of TrueNAS SCALE and it appeared correct. **📃 Notes:** **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [x] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [x] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/incubator/factorio/Chart.yaml | 32 ++--- charts/incubator/factorio/questions.yaml | 118 +++++++++--------- .../incubator/factorio/templates/common.yaml | 2 +- charts/incubator/factorio/values.yaml | 54 ++++---- 4 files changed, 105 insertions(+), 101 deletions(-) diff --git a/charts/incubator/factorio/Chart.yaml b/charts/incubator/factorio/Chart.yaml index 0e7e687bc8e..923fdd25086 100644 --- a/charts/incubator/factorio/Chart.yaml +++ b/charts/incubator/factorio/Chart.yaml @@ -1,28 +1,28 @@ -annotations: - truecharts.org/SCALE-support: "true" - truecharts.org/catagories: | - - GameServers apiVersion: v2 +kubeVersion: ">=1.16.0-0" +name: factorio +version: 4.0.0 appVersion: "stable" -dependencies: - - name: common - repository: https://library-charts.truecharts.org - version: 11.1.2 -deprecated: false description: "This Chart Chart will download the latest stable release of the game, generate the map and you're ready to play." +type: application +deprecated: false home: https://truecharts.org/charts/incubator/factorio icon: https://truecharts.org/img/hotlink-ok/chart-icons/factorio.png keywords: - factorio - GameServers -kubeVersion: ">=1.16.0-0" +sources: + - https://github.com/truecharts/charts/tree/master/charts/incubator/factorio + - https://www.factorio.com/ +dependencies: + - name: common + repository: https://library-charts.truecharts.org + version: 12.10.10 maintainers: - email: info@truecharts.org name: TrueCharts url: https://truecharts.org -name: factorio -sources: - - https://github.com/truecharts/charts/tree/master/charts/incubator/factorio - - https://www.factorio.com/ -type: application -version: 3.0.2 +annotations: + truecharts.org/catagories: | + - GameServers + truecharts.org/SCALE-support: "true" diff --git a/charts/incubator/factorio/questions.yaml b/charts/incubator/factorio/questions.yaml index 79cfc3bf42d..93d2c47cbca 100644 --- a/charts/incubator/factorio/questions.yaml +++ b/charts/incubator/factorio/questions.yaml @@ -4,57 +4,57 @@ questions: # Include{global} # Include{workload} # Include{workloadDeployment} - # Include{replicas1} # Include{podSpec} # Include{containerMain} + - variable: env + group: App Configuration + label: Image Environment + schema: + additional_attrs: true + type: dict + attrs: + - variable: GENERATE_NEW_SAVE + label: Generate new save on startup + description: Generate a new save if one does not exist before starting the server + schema: + type: boolean + default: false + - variable: LOAD_LATEST_SAVE + label: Load latest save game + description: Load latest when true. Otherwise load SAVE_NAME + schema: + type: boolean + default: true + - variable: SAVE_NAME + label: Game save name (change this to use multiple saves) + description: Name to use for the save file + schema: + type: string + default: _autosave1 + - variable: TOKEN + label: Factorio.com Token + description: Import your factorio.com token + schema: + type: string + default: "" + - variable: UPDATE_MODS_ON_START + label: Update server mods BEFORE starting the server + description: If mods should be updated before starting the server + schema: + type: string + default: "" + - variable: USERNAME + label: Factorio.com Username + description: Import your factorio.com username + schema: + type: string + default: "" # Include{containerBasic} # Include{containerAdvanced} - - variable: env - group: App Configuration - label: Image Environment - schema: - additional_attrs: true - type: dict - attrs: - - variable: GENERATE_NEW_SAVE - label: Generate new save on startup - description: Generate a new save if one does not exist before starting the server - schema: - type: boolean - default: false - - variable: LOAD_LATEST_SAVE - label: Load latest save game - description: Load latest when true. Otherwise load SAVE_NAME - schema: - type: boolean - default: true - - variable: SAVE_NAME - label: Game save name (change this to use multiple saves) - description: Name to use for the save file - schema: - type: string - default: _autosave1 - - variable: TOKEN - label: Factorio.com Token - description: Import your factorio.com token - schema: - type: string - default: "" - - variable: UPDATE_MODS_ON_START - label: Update server mods BEFORE starting the server - description: If mods should be updated before starting the server - schema: - type: string - default: "" - - variable: USERNAME - label: Factorio.com Username - description: Import your factorio.com username - schema: - type: string - default: "" # Include{containerConfig} +# Include{podOptions} # Include{serviceRoot} - variable: main label: Main Service @@ -104,8 +104,8 @@ questions: # Include{serviceExpert} # Include{serviceList} # Include{persistenceRoot} - - variable: path - label: path Storage + - variable: config + label: App Config Storage description: Container Path factorio schema: additional_attrs: true @@ -125,20 +125,20 @@ questions: # Include{ingressTraefik} # Include{ingressAdvanced} # Include{ingressList} +# Include{securityContextRoot} -# Include{podSecurityContextRoot} - - variable: runAsUser - label: runAsUser - description: The UserID of the user running the application - schema: - type: int - default: 0 - - variable: runAsGroup - label: runAsGroup - description: The groupID this App of the user running the application - schema: - type: int - default: 0 + - variable: runAsUser + label: runAsUser + description: The UserID of the user running the application + schema: + type: int + default: 0 + - variable: runAsGroup + label: runAsGroup + description: The groupID this App of the user running the application + schema: + type: int + default: 0 # Include{securityContextContainer} # Include{securityContextAdvanced} # Include{securityContextPod} diff --git a/charts/incubator/factorio/templates/common.yaml b/charts/incubator/factorio/templates/common.yaml index cbf66c20818..78d963fb168 100644 --- a/charts/incubator/factorio/templates/common.yaml +++ b/charts/incubator/factorio/templates/common.yaml @@ -1,2 +1,2 @@ {{/* Render the templates */}} -{{ include "tc.common.loader.all" . }} +{{ include "tc.v1.common.loader.all" . }} diff --git a/charts/incubator/factorio/values.yaml b/charts/incubator/factorio/values.yaml index f2cf85c5fba..a6b0e44c8ca 100644 --- a/charts/incubator/factorio/values.yaml +++ b/charts/incubator/factorio/values.yaml @@ -3,36 +3,39 @@ image: repository: tccr.io/truecharts/factorio tag: vstable@sha256:6a8a24374e3582abaebf34c9062627914c020d57d2ad88322e53eedf2c767c53 -podSecurityContext: - runAsGroup: 0 - runAsUser: 0 - -probes: - liveness: - enabled: false - readiness: - enabled: false - startup: - enabled: false - securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false + container: + readOnlyRootFilesystem: false + runAsNonRoot: false + runAsGroup: 0 + runAsUser: 0 -env: - GENERATE_NEW_SAVE: false - LOAD_LATEST_SAVE: true - SAVE_NAME: "_autosave1" - TOKEN: "" - UPDATE_MODS_ON_START: "" - USERNAME: "" +workload: + main: + podSpec: + containers: + main: + probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + env: + GENERATE_NEW_SAVE: false + LOAD_LATEST_SAVE: true + SAVE_NAME: "_autosave1" + TOKEN: "" + UPDATE_MODS_ON_START: "" + USERNAME: "" service: main: ports: main: port: 34197 - protocol: UDP + protocol: udp targetPort: 34197 rcon: enabled: true @@ -40,13 +43,14 @@ service: rcon: enabled: true port: 27015 - protocol: TCP + protocol: tcp targetPort: 27015 persistence: - path: + config: enabled: true mountPath: /factorio portal: - enabled: false + open: + enabled: false