Unverified Commit 189f017b authored by Sebastian Malton's avatar Sebastian Malton Committed by GitHub
Browse files

Set ownerReference to manually triggered cron jobs (#3229)

Signed-off-by: default avatarSebastian Malton <sebastian@malton.name>
parent 2708ca63
Showing with 13 additions and 2 deletions
+13 -2
......@@ -31,6 +31,7 @@ import { Notifications } from "../notifications";
import { cssNames } from "../../utils";
import { Input } from "../input";
import { systemName, maxLength } from "../input/input_validators";
import type { IKubeObjectMetadata } from "../../api/kube-object";
interface Props extends Partial<DialogProps> {
}
......@@ -91,9 +92,19 @@ export class CronJobTriggerDialog extends Component<Props> {
await jobApi.create({
name: this.jobName,
namespace: cronjob.getNs()
namespace: cronjob.getNs(),
}, {
spec: cronjobDefinition.spec.jobTemplate.spec
spec: cronjobDefinition.spec.jobTemplate.spec,
metadata: {
ownerReferences: [{
apiVersion: cronjob.apiVersion,
blockOwnerDeletion: true,
controller: true,
kind: cronjob.kind,
name: cronjob.metadata.name,
uid: cronjob.metadata.uid,
}],
} as IKubeObjectMetadata
});
close();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment