-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to set vars when scheduling and continuing actions (#142)
* Add ability to set vars when creating and continuing action * Fix odo support * Fix bug when deleting subject that is already deleted * Add kopf log configuration * Do not delete canceled actions
- Loading branch information
Showing
13 changed files
with
84 additions
and
58 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,35 @@ | ||
schemaVersion: 2.0.0 | ||
metadata: | ||
name: anarchy | ||
version: 1.0.0 | ||
components: | ||
- name: s2i-builder | ||
container: | ||
env: | ||
- name: ODO_S2I_SCRIPTS_URL | ||
value: /usr/libexec/s2i | ||
- name: ODO_S2I_SCRIPTS_PROTOCOL | ||
value: image:// | ||
- name: ODO_S2I_SRC_BIN_PATH | ||
value: /tmp | ||
- name: ODO_S2I_DEPLOYMENT_DIR | ||
value: "" | ||
- name: ODO_S2I_WORKING_DIR | ||
value: /opt/app-root/src | ||
- name: ODO_S2I_BUILDER_IMG | ||
value: ubi8/python-38 | ||
- name: ODO_SRC_BACKUP_DIR | ||
value: /opt/app-root/src-backup | ||
- name: ODO_S2I_CONVERTED_DEVFILE | ||
value: "true" | ||
# Anarchy vars | ||
- name: CLEANUP_INTERVAL | ||
value: "10" | ||
image: quay.io/redhat-cop/python-kopf-s2i:v1.35 | ||
mountSources: true | ||
sourceMapping: /tmp/projects | ||
commands: | ||
- id: s2i-assemble | ||
exec: | ||
commandLine: /opt/odo/bin/s2i-setup && /opt/odo/bin/assemble-and-restart | ||
- exec: | ||
commandLine: >- | ||
rm -rf /tmp/src && cp /tmp/projects -r /tmp/src && /tmp/src/.s2i/bin/assemble | ||
component: s2i-builder | ||
group: | ||
isDefault: true | ||
kind: build | ||
- id: s2i-run | ||
exec: | ||
commandLine: /opt/odo/bin/run | ||
hotReloadCapable: false | ||
workingDir: ${PROJECT_SOURCE} | ||
id: s2i-assemble | ||
- exec: | ||
commandLine: /opt/app-root/src/.s2i/bin/run | ||
component: s2i-builder | ||
group: | ||
isDefault: true | ||
kind: run | ||
hotReloadCapable: false | ||
workingDir: ${PROJECT_SOURCE} | ||
id: s2i-run | ||
components: | ||
- container: | ||
env: | ||
- name: ANARCHY_RUNNING_ALL_IN_ONE | ||
value: "true" | ||
- name: CLEANUP_INTERVAL | ||
value: "10" | ||
image: quay.io/redhat-cop/python-kopf-s2i:v1.35 | ||
mountSources: true | ||
sourceMapping: /tmp/projects | ||
name: s2i-builder | ||
metadata: | ||
name: anarchy | ||
version: 1.0.0 | ||
schemaVersion: 2.0.0 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import logging | ||
|
||
def suppress_handler_succeeded_messages(record: logging.LogRecord) -> bool: | ||
txt = record.getMessage() | ||
if txt.startswith("Handler ") and txt.endswith(" succeeded."): | ||
return False | ||
return True | ||
|
||
def configure_kopf_logging(): | ||
objlogger = logging.getLogger('kopf.objects') | ||
objlogger.addFilter(suppress_handler_succeeded_messages) |
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
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