Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify cron values when parsing; also verify depends_on relationships, meaning that we can assume later in the code that there are no cyclic dependencies to get us into recursive trouble. Also remove the `priority` field from the configuration as it's of marginal use since we now have `depends_on` which wasn't present in the original `supervisord` configuration from which this is derived.
- Loading branch information
Showing
5 changed files
with
122 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Test that a configuration with cyclic dependencies is an error. | ||
|
||
# Start it up. It should fail immediately with an error. | ||
gopm -c gopmconfig --quit-delay 0 & | ||
wait | ||
stderr 'Error loading configuration error:cyclic dependency involving ("b" and "a")|("a" and "b")' | ||
|
||
-- gopmconfig/config.cue -- | ||
package config | ||
|
||
grpc_server: { | ||
network: "unix" | ||
address: "gopm.socket" | ||
} | ||
programs: { | ||
a: { | ||
command: " " | ||
depends_on: ["b", "c"] | ||
} | ||
b: { | ||
command: " " | ||
depends_on: ["d", "a"] | ||
} | ||
c: { | ||
command: " " | ||
} | ||
d: { | ||
command: " " | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Test that a configuration with dependencies that don't exist is an error | ||
|
||
# Start it up. It should fail immediately with an error. | ||
gopm -c gopmconfig --quit-delay 0 & | ||
wait | ||
stderr 'Error loading configuration error:program "a" has dependency on non-existent program "b"' | ||
|
||
-- gopmconfig/config.cue -- | ||
package config | ||
|
||
grpc_server: { | ||
network: "unix" | ||
address: "gopm.socket" | ||
} | ||
programs: { | ||
a: { | ||
command: " " | ||
depends_on: ["b"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters