This file contains 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 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 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 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
// 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 |
This file contains 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 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
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 |
This file contains 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
# 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: |
This file contains 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
# 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: |
This file contains 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
# Base valid ReplicationController object | |
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: valid-rc | |
spec: | |
replicas: 1 # Valid: default value | |
selector: | |
app: my-app | |
template: |
This file contains 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 |
NewerOlder