Skip to content

Commit 4e2e8e2

Browse files
SJrXSteve Ramage
andauthored
fix: ensure AllowedCPUs validation continues to work in v258 (Resolves #366)
Co-authored-by: Steve Ramage <[email protected]>
1 parent a2e713b commit 4e2e8e2

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

ci/release.Jenkinsfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ def buildPodDefinition(workerPodImage, ciUtilsEnabled, kanikoEnabled) {
3030
yaml = """
3131
kind: Pod
3232
spec:
33+
affinity:
34+
nodeAffinity:
35+
preferredDuringSchedulingIgnoredDuringExecution:
36+
- weight: 1
37+
preference:
38+
matchExpressions:
39+
- key: perf
40+
operator: In
41+
values:
42+
- fast
3343
hostAliases:
3444
# Custom set env var
3545
- ip: "${env.JENKINS_IP_ADDRESS}"

src/main/kotlin/net/sjrx/intellij/plugins/systemdunitfiles/semanticdata/optionvalues/AllowedCpuSetOptionValue.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import com.intellij.openapi.project.Project
44
import net.sjrx.intellij.plugins.systemdunitfiles.semanticdata.Validator
55
import java.util.regex.Pattern
66

7-
class AllowedCpuSetOptionValue() : OptionValueInformation {
7+
class AllowedCpuSetOptionValue(val name : String) : OptionValueInformation {
88
override fun getAutoCompleteOptions(project: Project): Set<String> {
99
return emptySet()
1010
}
@@ -47,12 +47,20 @@ class AllowedCpuSetOptionValue() : OptionValueInformation {
4747
}
4848

4949
override val validatorName: String
50-
get() = VALIDATOR_NAME
50+
get() = name
5151

5252
companion object {
53-
const val VALIDATOR_NAME = "config_parse_allowed_cpuset"
53+
// Old validator name (before June 28th 2025)
54+
const val OLD_VALIDATOR_NAME = "config_parse_allowed_cpuset"
55+
56+
// New validator name (after June 28th 2025)
57+
const val NEW_VALIDATOR_NAME = "config_parse_unit_cpu_set"
5458

5559
private val CPU_ELEMENT_REGEX= Pattern.compile("^[0-9]+(-[0-9]+)?$")
56-
val validators = mapOf(Validator(VALIDATOR_NAME) to AllowedCpuSetOptionValue())
60+
val validators = mapOf(
61+
Validator(OLD_VALIDATOR_NAME) to AllowedCpuSetOptionValue(OLD_VALIDATOR_NAME),
62+
Validator(NEW_VALIDATOR_NAME) to AllowedCpuSetOptionValue(NEW_VALIDATOR_NAME),
63+
)
64+
5765
}
5866
}

systemd-build/Systemd-Builder.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:24.04
22

3-
ENV DEBIAN_FRONTEND noninteractive
3+
ENV DEBIAN_FRONTEND=noninteractive
44

55
RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
66

@@ -16,7 +16,7 @@ RUN mkdir -p /mount/
1616

1717
# Force cache to be invalidated after this point
1818
ARG BUILDDATE
19-
ENV BUILDDATE ${BUILDDATE:-notset}
19+
ENV BUILDDATE=${BUILDDATE:-notset}
2020

2121
RUN git pull
2222

systemd-build/Ubuntu-Units.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:22.04
22

3-
ENV DEBIAN_FRONTEND noninteractive
3+
ENV DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update && apt-get -y install apt-file && apt-file update
66

0 commit comments

Comments
 (0)