chore(deps): update dependency defenseunicorns/pepr to v0.29.0
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
defenseunicorns/pepr | minor |
v0.28.8 -> v0.29.0
|
|
defenseunicorns/pepr | ironbank-github | minor |
v0.28.8 -> v0.29.0
|
Release Notes
defenseunicorns/pepr (defenseunicorns/pepr)
v0.29.0
features
- chore: create helper functions for pepr by @schaeferka in https://github.com/defenseunicorns/pepr/pull/688
getOwnerRefFrom - get fields needed to create an owner ref
// Create a deployment that is "owned" by the WebApp instance 👍
function deployment(instance: WebApp) {
const { name, namespace } = instance.metadata!;
const { replicas } = instance.spec!;
return {
apiVersion: "apps/v1",
kind: "Deployment",
metadata: {
ownerReferences: getOwnerRefFrom(instance), // 👈 Instance owns deploymeny
name,
namespace,
labels: {
"pepr.dev/operator": name,
},
},
containers - Get all of the containers from a pod
When(a.Pod)
.IsCreatedOrUpdated()
.Validate(po => {
const podContainers = containers(po); // containers, initContainer, ephemeralContainers 👈
for (const container of podContainers) {
if (
container.securityContext?.allowPrivilegeEscalation ||
container.securityContext?.privileged
) {
return po.Deny("Privilege escalation is not allowed");
}
}
return po.Approve();
});
writeEvent - write an event
async function updateStatus(instance: WebApp, status: Status) {
await writeEvent(instance, {phase: status}, "Normal", "CreatedOrUpdate", instance.metadata.name, instance.metadata.name);
await K8s(WebApp).PatchStatus({
metadata: {
name: instance.metadata!.name,
namespace: instance.metadata!.namespace,
},
status,
});
}
kubectl describe wa webapp-light-en -n webapps
##### output
Name: webapp-light-en
Namespace: webapps
API Version: pepr.io/v1alpha1
Kind: WebApp
Metadata: ...
Spec:
Language: en
Replicas: 1
Theme: light
Status:
Observed Generation: 1
Phase: Ready
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal InstanceCreatedOrUpdated 36s webapp-light-en Pending 👈
Normal InstanceCreatedOrUpdated 36s webapp-light-en Ready 👈
Take a look at the sdk functions.
Good job @schaeferka
What's Changed
- chore: onschedule runs always in dev mode by @cmwylie19 in https://github.com/defenseunicorns/pepr/pull/725
- chore: update docs on the operator by @cmwylie19 in https://github.com/defenseunicorns/pepr/pull/726
- chore: bump chainguard/node-lts from
cc860c4
to8c5f0eb
by @dependabot in https://github.com/defenseunicorns/pepr/pull/721 - chore: bump @types/node from 18.19.29 to 18.19.30 in the development-dependencies group by @dependabot in https://github.com/defenseunicorns/pepr/pull/720
Full Changelog: https://github.com/defenseunicorns/pepr/compare/v0.28.8...v0.29.0
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.