Skip to content

Instantly share code, notes, and snippets.

View mabhi's full-sized avatar

Abhijit Mukherjee mabhi

  • Infracloud Technologies, pvt. ltd
  • Kolkata, India
View GitHub Profile
{
"Policies": [
{
"kind": "Policy",
"apiVersion": "config.kio.kasten.io/v1alpha1",
"metadata": {
"name": "k10-disaster-recovery-policy",
"namespace": "kasten-io",
"uid": "cc635721-6f09-4e9f-a322-8f5cef6e8207",
"resourceVersion": "1752638989213839016",
{
"Policies": [
{
"kind": "Policy",
"apiVersion": "config.kio.kasten.io/v1alpha1",
"metadata": {
"name": "global-policy-1",
"namespace": "kasten-io",
"uid": "e036ac35-5f8d-4d5a-adc1-998921e76bf9",
"resourceVersion": "1752635448795167014",
@mabhi
mabhi / gist:43fc8f71c6eab1f87bf8a16d6376913b
Created January 14, 2025 07:03
KDR policy spec include export
spec:
actions:
- action: backup
backupParameters:
filters:
includeResources:
- group: ""
version: v1
resource: persistentvolumeclaims
name: data-mysql-release-0
@mabhi
mabhi / gist:b191eabed93a0b60c75442d4927cc6ae
Last active July 25, 2024 13:34
Capture Pod logs on job fail during DR E2E test run
restore_test.go:319: Job k10-restore-k10restore failed with message: "Job has reached the specified backoff limit", reason: "BackoffLimitExceeded"
restore_test.go:354: k10-restore-k10restore-nf5zw logs:
{"File":"kasten.io/k10/kio/kube/client.go","Function":"kasten.io/k10/kio/kube.LoadConfig","Line":21,"cluster_name":"24b70a84-079a-40a1-b057-d19627ca1ad5","hostname":"k10-restore-k10restore-nf5zw","level":"debug","msg":"Attempting to use InCluster config","time":"2024-07-25T13:03:27.258Z"}
{"File":"kasten.io/k10/kio/tools/restorectl/restore.go","Function":"kasten.io/k10/kio/tools/restorectl.runRestoreCommand.func1","Line":65,"cluster_name":"24b70a84-079a-40a1-b057-d19627ca1ad5","hostname":"k10-restore-k10restore-nf5zw","level":"info","msg":"Waiting for restore to start","time":"2024-07-25T13:03:27.265Z"}
{"File":"kasten.io/k10/kio/dr/utils.go","Function":"kasten.io/k10/kio/dr.RestoreStatusForProgress","Line":171,"Progress":"Restore started","cluster_name":"24b70a84-079a-40a1-b057
@mabhi
mabhi / gist:3c0460db11035d65d881a18f0aa26789
Created June 6, 2024 07:04
Check log message for a string
/*
Ex. output
{"File":"xyx.xyz/../../../some.go","Function":"xyz.xyz/../../package.FunctionName,"Line":36,"level":"error","msg":"Unsupported base image","time":"2024-06-06T12:29:40.032+0530"}
*/
func checkInvalidImage(c *qt.C, imageName, expected string) {
// Capture stderr via a pipe
stdErrC := make(chan *bytes.Buffer)
pR, pW, err := os.Pipe()
c.Assert(err, qt.IsNil)
go func() {