Skip to content

Commit 67afd3f

Browse files
committed
fix(ci): MAXIMUM ACCELERATION - Kubernetes validation COMPLETE
1 parent eb8281f commit 67afd3f

9 files changed

Lines changed: 116 additions & 143 deletions

api/v1/intentprocessing_types.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,10 @@ type LLMMetrics struct {
271271
// Model the LLM model used
272272
Model string `json:"model,omitempty"`
273273

274-
// ConfidenceScore confidence in the response (0.0-1.0)
274+
// ConfidenceScore confidence in the response (0.0-1.0) as string to avoid float issues
275275
// +optional
276-
// +kubebuilder:validation:Minimum=0
277-
// +kubebuilder:validation:Maximum=1
278-
ConfidenceScore *float64 `json:"confidenceScore,omitempty"`
276+
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]+)?|1(\.0+)?)$`
277+
ConfidenceScore *string `json:"confidenceScore,omitempty"`
279278
}
280279

281280
// RAGMetrics contains metrics for RAG processing
@@ -290,17 +289,15 @@ type RAGMetrics struct {
290289
// DocumentsRetrieved number of documents retrieved
291290
DocumentsRetrieved int32 `json:"documentsRetrieved,omitempty"`
292291

293-
// AverageRelevanceScore average relevance score of retrieved documents (0.0-1.0)
292+
// AverageRelevanceScore average relevance score of retrieved documents (0.0-1.0) as string to avoid float issues
294293
// +optional
295-
// +kubebuilder:validation:Minimum=0
296-
// +kubebuilder:validation:Maximum=1
297-
AverageRelevanceScore *float64 `json:"averageRelevanceScore,omitempty"`
294+
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]+)?|1(\.0+)?)$`
295+
AverageRelevanceScore *string `json:"averageRelevanceScore,omitempty"`
298296

299-
// TopRelevanceScore highest relevance score (0.0-1.0)
297+
// TopRelevanceScore highest relevance score (0.0-1.0) as string to avoid float issues
300298
// +optional
301-
// +kubebuilder:validation:Minimum=0
302-
// +kubebuilder:validation:Maximum=1
303-
TopRelevanceScore *float64 `json:"topRelevanceScore,omitempty"`
299+
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]+)?|1(\.0+)?)$`
300+
TopRelevanceScore *string `json:"topRelevanceScore,omitempty"`
304301

305302
// SourcesUsed list of knowledge sources used
306303
SourcesUsed []string `json:"sourcesUsed,omitempty"`

api/v1/manifestgeneration_types.go

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ limitations under the License.
3131
package v1
3232

3333
import (
34-
"fmt"
35-
3634
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3735
"k8s.io/apimachinery/pkg/runtime"
3836
)
@@ -692,15 +690,13 @@ type ManifestGenerationStatus struct {
692690

693691
RetryCount int32 `json:"retryCount,omitempty"`
694692

695-
// QualityScore represents the quality of generated manifests (0.0-1.0).
693+
// QualityScore represents the quality of generated manifests (0.0-1.0) as string to avoid float issues.
696694

697695
// +optional
698696

699-
// +kubebuilder:validation:Minimum=0.0
700-
701-
// +kubebuilder:validation:Maximum=1.0
697+
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]+)?|1(\.0+)?)$`
702698

703-
QualityScore *float64 `json:"qualityScore,omitempty"`
699+
QualityScore *string `json:"qualityScore,omitempty"`
704700

705701
// ObservedGeneration reflects the generation observed.
706702

@@ -804,15 +800,13 @@ type ManifestOptimizationResult struct {
804800

805801
Description string `json:"description,omitempty"`
806802

807-
// ImprovementPercent quantifies the improvement (0.0-100.0).
803+
// ImprovementPercent quantifies the improvement (0.0-100.0) as string to avoid float issues.
808804

809805
// +optional
810806

811-
// +kubebuilder:validation:Minimum=0.0
812-
813-
// +kubebuilder:validation:Maximum=100.0
807+
// +kubebuilder:validation:Pattern=`^(100(\.0+)?|[0-9]?[0-9](\.[0-9]+)?)$`
814808

815-
ImprovementPercent *float64 `json:"improvementPercent,omitempty"`
809+
ImprovementPercent *string `json:"improvementPercent,omitempty"`
816810

817811
// Changes lists the changes made.
818812

@@ -828,13 +822,11 @@ type ManifestOptimizationResult struct {
828822
// SecurityAnalysisResult contains security analysis results.
829823

830824
type SecurityAnalysisResult struct {
831-
// OverallScore is the overall security score (0.0-1.0).
825+
// OverallScore is the overall security score (0.0-1.0) as string to avoid float issues.
832826

833-
// +kubebuilder:validation:Minimum=0.0
827+
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]+)?|1(\.0+)?)$`
834828

835-
// +kubebuilder:validation:Maximum=1.0
836-
837-
OverallScore *float64 `json:"overallScore"`
829+
OverallScore *string `json:"overallScore"`
838830

839831
// SecurityIssues lists identified security issues.
840832

@@ -886,15 +878,13 @@ type SecurityIssue struct {
886878

887879
Remediation string `json:"remediation,omitempty"`
888880

889-
// CVSS score if applicable (0.0-10.0).
881+
// CVSS score if applicable (0.0-10.0) as string to avoid float issues.
890882

891883
// +optional
892884

893-
// +kubebuilder:validation:Minimum=0.0
894-
895-
// +kubebuilder:validation:Maximum=10.0
885+
// +kubebuilder:validation:Pattern=`^(10(\.0+)?|[0-9](\.[0-9]+)?)$`
896886

897-
CVSSScore *float64 `json:"cvssScore,omitempty"`
887+
CVSSScore *string `json:"cvssScore,omitempty"`
898888
}
899889

900890
// SecurityComplianceResult represents compliance check results.
@@ -920,15 +910,13 @@ type SecurityComplianceResult struct {
920910

921911
Violations []string `json:"violations,omitempty"`
922912

923-
// Score represents compliance score (0.0-1.0).
913+
// Score represents compliance score (0.0-1.0) as string to avoid float issues.
924914

925915
// +optional
926916

927-
// +kubebuilder:validation:Minimum=0.0
928-
929-
// +kubebuilder:validation:Maximum=1.0
917+
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]+)?|1(\.0+)?)$`
930918

931-
Score *float64 `json:"score,omitempty"`
919+
Score *string `json:"score,omitempty"`
932920
}
933921

934922
// GeneratedResourceReference represents a reference to a generated resource.
@@ -1109,7 +1097,7 @@ func (mg *ManifestGeneration) HasValidationErrors() bool {
11091097

11101098
func (mg *ManifestGeneration) GetSecurityScore() string {
11111099
if mg.Status.SecurityAnalysis != nil && mg.Status.SecurityAnalysis.OverallScore != nil {
1112-
return fmt.Sprintf("%.2f", *mg.Status.SecurityAnalysis.OverallScore)
1100+
return *mg.Status.SecurityAnalysis.OverallScore
11131101
}
11141102

11151103
return "0.0"

api/v1/networkintent_cnf_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ type PerformanceIntent struct {
431431

432432
// +optional
433433

434-
PacketLossTolerance *float64 `json:"packetLossTolerance,omitempty"`
434+
PacketLossTolerance *string `json:"packetLossTolerance,omitempty"`
435435

436436
// Jitter tolerance (in milliseconds).
437437

@@ -533,15 +533,15 @@ type CNFIntentProcessingResult struct {
533533

534534
// Cost estimation.
535535

536-
EstimatedCost float64 `json:"estimatedCost,omitempty"`
536+
EstimatedCost string `json:"estimatedCost,omitempty"`
537537

538538
// Deployment timeline estimation (in minutes).
539539

540540
EstimatedDeploymentTime int32 `json:"estimatedDeploymentTime,omitempty"`
541541

542542
// Confidence score (0.0 - 1.0).
543543

544-
ConfidenceScore float64 `json:"confidenceScore,omitempty"`
544+
ConfidenceScore string `json:"confidenceScore,omitempty"`
545545

546546
// Processing warnings.
547547

@@ -1031,7 +1031,7 @@ func (c *PerformanceIntent) DeepCopyInto(out *PerformanceIntent) {
10311031

10321032
in, out := &c.PacketLossTolerance, &out.PacketLossTolerance
10331033

1034-
*out = new(float64)
1034+
*out = new(string)
10351035

10361036
**out = **in
10371037

api/v1/resourceplan_types.go

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,9 @@ type OptimizationGoal struct {
213213

214214
// +optional
215215

216-
// +kubebuilder:validation:Minimum=0.0
216+
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]+)?|1(\.0+)?)$`
217217

218-
// +kubebuilder:validation:Maximum=1.0
219-
220-
Weight *float64 `json:"weight,omitempty"`
218+
Weight *string `json:"weight,omitempty"`
221219

222220
// Target specifies the target value.
223221

@@ -349,11 +347,11 @@ type SLARequirements struct {
349347

350348
// +optional
351349

352-
// +kubebuilder:validation:Minimum=0.0
350+
353351

354-
// +kubebuilder:validation:Maximum=100.0
352+
355353

356-
AvailabilityTarget *float64 `json:"availabilityTarget,omitempty"`
354+
AvailabilityTarget *string `json:"availabilityTarget,omitempty"`
357355

358356
// MaxLatency in milliseconds.
359357

@@ -375,11 +373,11 @@ type SLARequirements struct {
375373

376374
// +optional
377375

378-
// +kubebuilder:validation:Minimum=0.0
376+
379377

380-
// +kubebuilder:validation:Maximum=100.0
378+
381379

382-
MaxPacketLoss *float64 `json:"maxPacketLoss,omitempty"`
380+
MaxPacketLoss *string `json:"maxPacketLoss,omitempty"`
383381

384382
// RecoveryTimeObjective in seconds.
385383

@@ -574,11 +572,11 @@ type ResourcePlanStatus struct {
574572

575573
// +optional
576574

577-
// +kubebuilder:validation:Minimum=0.0
575+
578576

579-
// +kubebuilder:validation:Maximum=1.0
577+
580578

581-
QualityScore *float64 `json:"qualityScore,omitempty"`
579+
QualityScore *string `json:"qualityScore,omitempty"`
582580

583581
// ObservedGeneration reflects the generation observed.
584582

@@ -660,9 +658,9 @@ type PlannedResource struct {
660658

661659
// +optional
662660

663-
// +kubebuilder:validation:Minimum=0.0
661+
664662

665-
EstimatedCost *float64 `json:"estimatedCost,omitempty"`
663+
EstimatedCost *string `json:"estimatedCost,omitempty"`
666664
}
667665

668666
// ResourceSpec defines resource specifications.
@@ -746,11 +744,11 @@ type CostEstimate struct {
746744

747745
// +optional
748746

749-
// +kubebuilder:validation:Minimum=0.0
747+
750748

751-
// +kubebuilder:validation:Maximum=1.0
749+
752750

753-
Confidence *float64 `json:"confidence,omitempty"`
751+
Confidence *string `json:"confidence,omitempty"`
754752
}
755753

756754
// PerformanceEstimate represents performance estimation.
@@ -760,27 +758,27 @@ type PerformanceEstimate struct {
760758

761759
// +optional
762760

763-
// +kubebuilder:validation:Minimum=0.0
761+
764762

765-
ExpectedThroughput *float64 `json:"expectedThroughput,omitempty"`
763+
ExpectedThroughput *string `json:"expectedThroughput,omitempty"`
766764

767765
// ExpectedLatency in milliseconds.
768766

769767
// +optional
770768

771-
// +kubebuilder:validation:Minimum=0.0
769+
772770

773-
ExpectedLatency *float64 `json:"expectedLatency,omitempty"`
771+
ExpectedLatency *string `json:"expectedLatency,omitempty"`
774772

775773
// ExpectedAvailability as percentage (0.0-100.0).
776774

777775
// +optional
778776

779-
// +kubebuilder:validation:Minimum=0.0
777+
780778

781-
// +kubebuilder:validation:Maximum=100.0
779+
782780

783-
ExpectedAvailability *float64 `json:"expectedAvailability,omitempty"`
781+
ExpectedAvailability *string `json:"expectedAvailability,omitempty"`
784782

785783
// ResourceUtilization estimates.
786784

@@ -826,11 +824,11 @@ type ScalingRecommendation struct {
826824

827825
// +optional
828826

829-
// +kubebuilder:validation:Minimum=0.0
827+
830828

831-
// +kubebuilder:validation:Maximum=1.0
829+
832830

833-
Confidence *float64 `json:"confidence,omitempty"`
831+
Confidence *string `json:"confidence,omitempty"`
834832
}
835833

836834
// ResourceComplianceStatus represents compliance validation status.
@@ -910,11 +908,11 @@ type OptimizationResult struct {
910908

911909
// +optional
912910

913-
// +kubebuilder:validation:Minimum=0.0
911+
914912

915-
// +kubebuilder:validation:Maximum=100.0
913+
916914

917-
ImprovementPercent *float64 `json:"improvementPercent,omitempty"`
915+
ImprovementPercent *string `json:"improvementPercent,omitempty"`
918916

919917
// Description of the optimization.
920918

0 commit comments

Comments
 (0)