Skip to content

Fix Field Naming Convention in Kruize API Types #82

@shreyabiradar07

Description

@shreyabiradar07

Description

The KruizeSpec struct in api/v1alpha1/kruize_types.go contains fields using snake_case naming. Go structs should use camelCase for exported fields, while JSON tags can remain in snake_case for API compatibility.

Current State (Inconsistent)

type KruizeSpec struct {
    Cluster_type      string `json:"cluster_type"`    // ❌ snake_case
    Autotune_image    string `json:"autotune_image"`    // ❌ snake_case
    Autotune_ui_image string `json:"autotune_ui_image"` // ❌ snake_case
    PersistentVolume  *PersistentVolumeSpec `json:"persistentVolume,omitempty"` // ✅ camelCase
}

Expected State (Consistent)

type KruizeSpec struct {
    ClusterType      string `json:"cluster_type"`     // ✅ camelCase
    AutotuneImage    string `json:"autotune_image"`    // ✅ camelCase
    AutotuneUIImage  string `json:"autotune_ui_image"` // ✅ camelCase
    PersistentVolume *PersistentVolumeSpec `json:"persistentVolume,omitempty"` // ✅ camelCase
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions