Skip to content

Commit

Permalink
set RELEASE_COOKIE instead of RELEASE_SECRET on runner pod
Browse files Browse the repository at this point in the history
  • Loading branch information
mruoss committed Oct 9, 2024
1 parent 17a7b74 commit 3a33f4b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 43 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

<!--------------------- Don't add new entries after this line --------------------->

## [0.5.6] - 2024-10-09

### Fixed

- Set `RELEASE_COOKIE` instead of `RELEASE_SECRET`

## [0.5.5] - 2024-10-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion lib/flame_k8s_backend/runner_pod_template.ex
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ defmodule FLAMEK8sBackend.RunnerPodTemplate do
)
]
|> put_new_env("PHX_SERVER", "false")
|> put_new_env("RELEASE_SECRET", Node.get_cookie())
|> put_new_env("RELEASE_COOKIE", Node.get_cookie())
|> put_new_env("RELEASE_DISTRIBUTION", "name")
|> put_new_env("RELEASE_NODE", "flame_runner@$(POD_IP)")
end)
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule FlameK8sBackend.MixProject do
use Mix.Project
@source_url "https://github.com/mruoss/flame_k8s_backend"
@version "0.5.5"
@version "0.5.6"

def project do
[
Expand Down
87 changes: 46 additions & 41 deletions test/integration/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ metadata:
namespace: integration
name: pod-mgr
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["create", "get", "list", "delete", "patch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["create", "get", "list", "delete", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: integration-pod-mgr
namespace: integration
subjects:
- kind: ServiceAccount
name: integration
namespace: integration
- kind: ServiceAccount
name: integration
namespace: integration
roleRef:
kind: Role
name: pod-mgr
Expand All @@ -40,42 +40,47 @@ metadata:
name: integration
namespace: integration
labels:
app: flame_test
app: flame_test
spec:
serviceAccountName: integration
containers:
- name: integration
image: flamek8sbackend:integration
command: ["sh", "-c"]
args: ["iex --name flame_test@$(POD_IP) --cookie nosecret -S mix run -e FlameK8sBackend.IntegrationTestRunner.run_flame"]
resources:
requests:
cpu: 300m
memory: 300Mi
limits:
cpu: 300m
memory: 300Mi
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: RELEASE_DISTRIBUTION
value: name
- name: RELEASE_NODE
value: flame_test@$(POD_IP)
ports:
- containerPort: 80
name: integration
- name: integration
image: flamek8sbackend:integration
command: ["sh", "-c"]
args:
[
"iex --name flame_test@$(POD_IP) --cookie $(RELEASE_COOKIE) -S mix run -e FlameK8sBackend.IntegrationTestRunner.run_flame",
]
resources:
requests:
cpu: 300m
memory: 300Mi
limits:
cpu: 300m
memory: 300Mi
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: RELEASE_DISTRIBUTION
value: name
- name: RELEASE_NODE
value: flame_test@$(POD_IP)
- name: RELEASE_COOKIE
value: nosecret
ports:
- containerPort: 80
name: integration
restartPolicy: Always

0 comments on commit 3a33f4b

Please sign in to comment.