Skip to content

Instantly share code, notes, and snippets.

View aaron-prindle's full-sized avatar
💭
📦

Aaron Prindle aaron-prindle

💭
📦
  • Google
  • San Francisco
View GitHub Profile
@aaron-prindle
aaron-prindle / rc_declarative_validation.yaml
Created March 14, 2025 17:16
rc_declarative_validation.yaml
# Test Case: valid replicas (1), feature gate enabled
# Expected: Success
apiVersion: v1
kind: ReplicationController
metadata:
name: rc-validation-1
namespace: default
spec:
replicas: 1
selector:
@aaron-prindle
aaron-prindle / gist:987095fed89996ac8a93496ce7c21b78
Created March 14, 2025 17:04
test/integration/apiserver/declarative_validation_metrics_test.go test passing @ k/k HEAD
/*
Copyright 2025 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@aaron-prindle
aaron-prindle / gist:0ef66e4c625d92d6158f8d83bafb3208
Created March 10, 2025 21:40
declarative_validation_metrics_test.go
/*
Copyright 2025 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@aaron-prindle
aaron-prindle / gist:1148eafa1b782bccbf09d79e60b75513
Created March 10, 2025 05:03
gatherDeclarativeValidationMismatches with `1:many` matching more similar to matcher.Test (modified from 1:1 initially)
// gatherDeclarativeValidationMismatches compares imperative and declarative validation errors
// using logic that more closely mirrors the approach in ErrorMatcher.Test().
//
// Specifically:
// - Imperative errors are treated as "want" errors.
// - Declarative errors are treated as "got" errors.
// - Each "want" error will match all "got" errors that satisfy matcher.Matches(...) and
// remove them from the unmatched list.
// - 0 matches is treated as an "unmatched imperative" problem.
// - More than 1 match is treated as a "multiple matched" problem (instead of picking
@aaron-prindle
aaron-prindle / gist:1bc0ef2822baa00e363ea378c531b41c
Created March 7, 2025 17:14
gatherDeclarativeValidationMismatches map "bucketing" implementation for perf optimization
/*
Copyright 2025 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@aaron-prindle
aaron-prindle / main.py
Created February 18, 2025 19:14
skaffold-issues-server/backend/main.py
import logging
import glob
import os
import textwrap
import re
import numpy as np
import pandas as pd
from flask import Flask, request, jsonify
from flask_cors import CORS
from vertexai.preview.language_models import TextEmbeddingModel, TextGenerationModel, CodeGenerationModel
@aaron-prindle
aaron-prindle / gist:bf06660a18587651427c7bb68ba01cc2
Created February 5, 2025 19:52
ReplicationController.Replicas invalid.yaml file re-prompted for no `detail` field
# Base valid ReplicationController object (must be the SAME as in valid.yaml)
apiVersion: v1
kind: ReplicationController
metadata:
name: valid-rc
spec:
replicas: 1
selector:
app: my-app
template:
@aaron-prindle
aaron-prindle / gist:c1909649867068495dc07033cd1ba6d5
Created February 5, 2025 19:47
ReplicationController.Replicas invalid.yaml
# Base valid ReplicationController object (must be the SAME as in valid.yaml)
apiVersion: v1
kind: ReplicationController
metadata:
name: valid-rc
spec:
replicas: 1
selector:
app: my-app
template:
@aaron-prindle
aaron-prindle / gist:305ddd14a0bc9304061457d6f2e88b3b
Last active February 6, 2025 01:40
valid.yaml for ReplicationController.Replicas
# Base valid ReplicationController object
apiVersion: v1
kind: ReplicationController
metadata:
name: valid-rc
spec:
replicas: 1 # Valid: default value
selector:
app: my-app
template:
/*
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software