This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# CSR Testing Script - All CREATE and UPDATE operations with output logging | |
# This script tests CSR operations on /, /status, and /approval endpoints | |
# Uses kubectl with proper raw API access for updates | |
# Also captures validation mismatch metrics after each operation | |
set -e | |
# Configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running tool: /usr/bin/go test -timeout 30s -run ^(TestDeclarativeValidateForDeclarative|TestValidateUpdateForDeclarative)$ k8s.io/kubernetes/pkg/registry/certificates/certificates | |
E0718 23:44:35.730445 4187615 validate.go:187] "Unexpected difference between hand written validation and declarative validation error results, unmatched error(s) found {Type=\"Invalid value\", Field=\"status.conditions\", Origin=\"zeroOrOneOf\"}. This indicates an issue with declarative validation. Consider disabling the DeclarativeValidationTakeover feature gate to keep data persisted in etcd consistent with prior versions of Kubernetes." | |
E0718 23:44:35.730641 4187615 validate.go:187] "Unexpected difference between hand written validation and declarative validation error results, extra error(s) found {Type=\"Internal error\", Field=\"<nil>\", Origin=\"\"}. This indicates an issue with declarative validation. Consider disabling the DeclarativeValidationTakeover feature gate to keep data persisted in etcd consistent with prior ver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//go:build !ignore_autogenerated | |
// +build !ignore_autogenerated | |
/* | |
Copyright 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"log" | |
"path/filepath" | |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parts := strings.Split(rsName, "-") | |
if len(parts) < 2 { | |
t.Errorf("ReplicaSet name should contain at least one hyphen separator") | |
} | |
deploymentPortion := strings.Join(parts[:len(parts)-1], "-") | |
if len(test.deploymentName) <= 242 { | |
if deploymentPortion != test.deploymentName { | |
t.Errorf("Deployment name portion mismatch: got %q, want %q", deploymentPortion, test.deploymentName) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aprindle@aprindle-ssd ~/validation-gen [my-validation-gen_enable-csr-view]git diff | |
diff --git a/pkg/apis/certificates/validation/validation_test.go b/pkg/apis/certificates/validation/validation_test.go | |
index a54aa9adf46..25fa6a7d367 100644 | |
--- a/pkg/apis/certificates/validation/validation_test.go | |
+++ b/pkg/apis/certificates/validation/validation_test.go | |
@@ -274,7 +274,7 @@ func TestValidateCertificateSigningRequestCreate(t *testing.T) { | |
}, | |
}, | |
errs: field.ErrorList{ | |
- field.Invalid(specPath.Child("expirationSeconds"), int32(-1), "may not specify a duration less than 600 seconds (10 minutes)"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
NewerOlder