Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion k8s/instance/list
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/bin/bash

K8S_NAMESPACE="nullplatform"
K8S_NAMESPACE=$(echo "$CONTEXT" | jq -r --arg default "$K8S_NAMESPACE" '
.providers["container-orchestration"].cluster.namespace // $default
' 2>/dev/null || echo "nullplatform")

LABEL_SELECTOR="nullplatform=true"

if [[ -n "$APPLICATION_ID" && "$APPLICATION_ID" != "null" ]]; then
LABEL_SELECTOR="$LABEL_SELECTOR,application_id=$APPLICATION_ID"
fi

if [[ -n "$SCOPE_ID" && "$SCOPE_ID" != "null" ]]; then
LABEL_SELECTOR="$LABEL_SELECTOR,scope_id=$SCOPE_ID"
fi

if [[ -n "$DEPLOYMENT_ID" && "$DEPLOYMENT_ID" != "null" ]]; then
LABEL_SELECTOR="$LABEL_SELECTOR,deployment_id=$DEPLOYMENT_ID"
fi
Expand Down
2 changes: 2 additions & 0 deletions k8s/instance/workflows/list.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include:
- "$SERVICE_PATH/values.yaml"
steps:
- name: build context
type: script
Expand Down
2 changes: 2 additions & 0 deletions k8s/log/workflows/log.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include:
- "$SERVICE_PATH/values.yaml"
steps:
- name: build context
type: script
Expand Down
2 changes: 1 addition & 1 deletion service/instance/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi
WORKFLOW_PATH="$SERVICE_PATH/instance/workflows/list.yaml"
OVERRIDES_WORKFLOW_PATH="$OVERRIDES_WORKFLOW_PATH/instance/workflows/list.yaml"

CMD="np service workflow exec --no-output --workflow $WORKFLOW_PATH"
CMD="np service workflow exec --no-output --build-context --workflow $WORKFLOW_PATH"

if [[ -f "$OVERRIDES_WORKFLOW_PATH" ]]; then
CMD="$CMD --overrides $OVERRIDES_WORKFLOW_PATH"
Expand Down
2 changes: 1 addition & 1 deletion service/log/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
WORKFLOW_PATH="$SERVICE_PATH/log/workflows/log.yaml"
OVERRIDES_WORKFLOW_PATH="$OVERRIDES_PATH/log/workflows/log.yaml"

CMD="np service workflow exec --no-output --workflow $WORKFLOW_PATH"
CMD="np service workflow exec --no-output --build-context --workflow $WORKFLOW_PATH"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esta opcion para que se usa?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Para poder tener contexto de los providres, en este caso estamos siempre defaulteando al namespace de 'nullplatform' lo cual es incorrecto, ya que el namespace donde estan los pods se define a traves de providres. Podriamos isno, quiza, buscar por labels sin importar el namespace pero bueno, habria que verlo


if [[ -f "$OVERRIDES_WORKFLOW_PATH" ]]; then
CMD="$CMD --overrides $OVERRIDES_WORKFLOW_PATH"
Expand Down