Skip to content

Instantly share code, notes, and snippets.

PATH=$(pwd)/_output/bin:$PATH kubetest2 kind \
--test=ginkgo \
-- \
--focus-regex="should rotate a projected service account token for a pod in the Terminating state" \
--use-binaries-from-path
I0612 03:40:48.780082 2400467 app.go:61] The files in RunDir shall not be part of Artifacts
I0612 03:40:48.780218 2400467 app.go:62] pass rundir-in-artifacts flag True for RunDir to be part of Artifacts
I0612 03:40:48.780271 2400467 app.go:64] RunDir for this run: "/usr/local/google/home/ydubovskoi/projects/oss-k8s/_rundir/32ee78fc-ac2b-4a7a-9ed2-bf313687b15a"
I0612 03:40:48.784042 2400467 app.go:136] ID for this run: "32ee78fc-ac2b-4a7a-9ed2-bf313687b15a"
I0612 03:40:48.832221 2400513 ginkgo.go:131] Using kubeconfig at /usr/local/google/home/ydubovskoi/.kube/config
apiVersion: v1
kind: Pod
metadata:
name: sa-token-test-pod
namespace: default
spec:
terminationGracePeriodSeconds: 3600
containers:
- name: test-container
image: curlimages/curl:8.4.0
use anyhow::Result;
use redis::Commands;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::fmt::Formatter;
use std::str::FromStr;
const COORDINATE_PRECISION: usize = 4;
const CACHE_TTL: usize = 2628000;
"""
Backoff policy for agile retrying with increasing delay
"""
import asyncio
import logging
from typing import Awaitable, Callable
logger = logging.getLogger(__name__)
@drjackild
drjackild / pattern_matching.py
Created February 27, 2021 14:24
The usage of new pattern matching in Python
class Response:
def __init__(self, content: dict, status: int):
self.content = content
self.status = status
def make_request(content: dict, status: int) -> Response:
return Response(content, status)
"""
Just a custom function, which allow you to use ARRAY_AGG aggregation function in TortoiseORM
"""
from typing import TYPE_CHECKING, Any, Optional, Type, cast, Iterable, Tuple
from pypika import Table
from pypika.functions import Function as PypikaFunction
from tortoise.exceptions import ConfigurationError
from tortoise.fields.relational import BackwardFKRelation, ForeignKeyFieldInstance, RelationalField
use bson;
use bson::{decode_document, encode_document};
use serde::{Deserialize, Serialize};
use std::fs::File;
use std::io::prelude::*;
use std::io::{BufReader, BufWriter};
#[derive(Serialize, Deserialize, Debug)]
struct Move {
x: i32,
cargo install whalespotter
Updating crates.io index
Installing whalespotter v0.1.4
Compiling cfg-if v0.1.10
Compiling autocfg v1.0.0
Compiling libc v0.2.68
Compiling lazy_static v1.4.0
Compiling scopeguard v1.1.0
Compiling proc-macro2 v1.0.9
Compiling log v0.4.8
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s [%(levelname)s] %(name)s: %(message)s')
# Load Excel files in a folder and load content to simple class
# Using first row as a header
from typing import Tuple, Generator
from types import SimpleNamespace
import os
from openpyxl import load_workbook
INPUT_BASE_FOLDER = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'TheKnotResults_250cities')