Skip to content

Conversation

@jaypoulz
Copy link

@jaypoulz jaypoulz commented Jan 19, 2026

User description

Update kube-api-linter from v0.0.0-20251028144537 to v0.0.0-20260114104534. This also bumps k8s.io/gengo/v2 to v2.0.0-20250922181213 as a transitive dependency.

Created with support from Claude Opus 4 (Anthropic)


PR Type

Enhancement


Description

  • Updated kube-api-linter from v0.0.0-20251028144537 to v0.0.0-20260114104534 with significant new analyzers and improvements

  • Added declarative validation marker support with orphaned marker detection, marker type enums, and payload structures for both Kubebuilder and k8s validation styles

  • Implemented new analyzers: defaults (validates default marker usage), preferredmarkers (enforces marker standardization), minlength (checks minimum length requirements), dependenttags (enforces marker dependencies), nonpointerstructs (validates struct field markers), noreferences (enforces reference field naming), and defaultorrequired (prevents conflicting markers)

  • Enhanced field inspection infrastructure with qualified field names, list type handling, and improved callback signatures across all analyzers

  • Refactored multiple analyzers (nodurations, nomaps, nofloats, nobools, integers) to use new TypeChecker pattern for cleaner type validation

  • Improved serialization checks with custom marshalling support, explicit zero value validation, and better error reporting

  • Updated k8s.io/gengo/v2 to v2.0.0-20250922181213 with enhanced comment handling, import ordering, and type alias support

  • Fixed typos and spelling errors throughout documentation and code comments for improved clarity

  • Fixed GoSeperator typo in namer package with backward compatibility alias


Diagram Walkthrough

flowchart LR
  A["kube-api-linter<br/>v0.0.0-20251028144537"] -->|"Update to<br/>v0.0.0-20260114104534"| B["Enhanced Linter"]
  B --> C["New Analyzers"]
  B --> D["Improved Infrastructure"]
  B --> E["Refactored Patterns"]
  C --> C1["defaults"]
  C --> C2["preferredmarkers"]
  C --> C3["minlength"]
  C --> C4["dependenttags"]
  C --> C5["nonpointerstructs"]
  C --> C6["noreferences"]
  D --> D1["Qualified Field Names"]
  D --> D2["Declarative Validation<br/>Markers"]
  D --> D3["List Type Handling"]
  E --> E1["TypeChecker Pattern"]
  E --> E2["Serialization Checks"]
  B --> F["k8s.io/gengo/v2<br/>v2.0.0-20250922181213"]
Loading

File Walkthrough

Relevant files
Enhancement
45 files
analyzer.go
Support declarative validation markers and orphaned marker detection

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/helpers/markers/analyzer.go

  • Renamed UnnamedExpression constant to UnnamedArgument and updated
    related documentation to reflect declarative validation marker
    terminology
  • Added support for declarative validation markers (k8s: prefix)
    alongside existing Kubebuilder-style markers with new MarkerType enum
  • Implemented orphaned marker detection to handle markers separated from
    type/field declarations by blank lines, including helper functions for
    validation
  • Enhanced marker extraction with Payload struct to support both string
    values and nested markers, replacing the previous Expressions map
  • Added regex patterns and helper functions (containsOnlyMarkers,
    looksLikeCommentedCode, hasCodeIndicators) to distinguish markers from
    commented-out code
  • Integrated k8s.io/gengo/v2/codetags package for parsing declarative
    validation markers
+596/-47
serialization_check.go
Enhanced serialization checks with qualified field names and custom
marshalling support

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/serialization/serialization_check.go

  • Added qualifiedFieldName parameter to Check method and related helper
    functions for better error reporting
  • Added logic to detect structs with custom marshalling (Type=string
    marker) and treat them as string types for validation
  • Added hasExplicitZeroMinValidation function to handle
    pointer-to-slice/map with MinItems=0 or MinProperties=0 markers
  • Refactored pointer validation logic into separate
    handlePointerToPointerType and handleNonPointerToPointerType methods
  • Updated all function signatures to pass markersAccess and underlying
    type information for enhanced validation
+115/-43
analyzer.go
New defaults analyzer for validating default marker usage

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaults/analyzer.go

  • New analyzer for checking fields with default markers (+default,
    +kubebuilder:default, +k8s:default)
  • Validates that fields with defaults are marked as optional and not
    required
  • Ensures fields with defaults have omitempty or omitzero in json tags
  • Provides suggested fixes for replacing secondary default markers with
    preferred ones
  • Handles both Kubebuilder and declarative validation marker styles
+397/-0 
zero_value.go
Enhanced zero value validation with qualified names and custom
marshalling

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/zero_value.go

  • Added qualifiedFieldName parameter to IsZeroValueValid and related
    functions for improved error reporting
  • Added GetTypeMarkerValue function to extract Type marker values for
    structs with custom marshalling
  • Added special handling for structs with Type=string marker to validate
    them as strings instead of structs
  • Added IsFieldOptional function to check for optional markers (mirrors
    existing IsFieldRequired)
  • Updated enumFieldAllowsEmpty to use Payload.Value instead of
    Expressions map
  • Added GetMinProperties helper function for extracting minimum
    properties marker values
  • Added IsKubernetesListType function to detect Kubernetes List type
    structs
+69/-24 
analyzer.go
New preferred markers analyzer for marker standardization

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/preferredmarkers/analyzer.go

  • New analyzer for enforcing preferred marker usage over equivalent
    markers
  • Supports configuration-driven mapping of equivalent markers to
    preferred identifiers
  • Generates suggested fixes to replace or remove equivalent markers
  • Handles both Kubebuilder and declarative validation marker
    reconstruction
  • Provides deterministic reporting with sorted marker lists and text
    edits
+315/-0 
analyzer.go
New minlength analyzer for validation marker requirements

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/minlength/analyzer.go

  • New analyzer for checking minimum length requirements on strings,
    arrays, maps, and structs
  • Validates that formatted strings have MinLength markers
  • Validates that arrays have MinItems and maps have MinProperties
    markers
  • Handles special cases like byte slices (treated as strings) and array
    element validation
  • Checks struct fields for required markers or union constraints
    (exactlyOneOf/atLeastOneOf)
+258/-0 
inspector.go
Refactored field inspection with qualified names and list type
handling

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/helpers/inspector/inspector.go

  • Updated InspectFields callback signature to include qualifiedFieldName
    parameter and remove stack parameter
  • Added InspectFieldsIncludingListTypes method for inspecting fields in
    list type structs
  • Refactored field inspection logic into shared inspectFields method
    with skipListTypes parameter
  • Added logic to compute qualified field names including struct name
    prefix
  • Updated shouldProcessField to use IsKubernetesListType utility
    function
+48/-37 
utils.go
Added utility functions for type checking and qualified naming

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/utils.go

  • Added IsStringType function to check if an expression is a string
    type, including aliases
  • Added IsPointer function to check if an expression is a pointer
  • Added GetStructName and GetStructNameFromFile functions to retrieve
    struct names for fields
  • Added GetQualifiedFieldName function to construct qualified field
    names
  • Added GetMinProperties function to extract minimum properties marker
    values
  • Added IsKubernetesListType function to detect Kubernetes List type
    structs with structural validation
  • Added helper functions hasListFields and getFieldTypeName for list
    type detection
  • Updated TypeAwareMarkerCollectionForField to use correct import for
    markers helper
+191/-37
analyzer.go
Updated jsontags analyzer for new field inspection interface

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/jsontags/analyzer.go

  • Updated InspectFields callback to use InspectFieldsIncludingListTypes
    for broader field coverage
  • Updated callback signature to use qualifiedFieldName parameter instead
    of computing field name locally
  • Removed unused stack parameter from callback
  • Simplified field name handling by using pre-computed qualified name
+5/-7     
analyzer.go
New nonpointerstructs analyzer for struct field markers   

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nonpointerstructs/analyzer.go

  • New analyzer file implementing nonpointerstructs linter to enforce
    required/optional markers on non-pointer struct fields
  • Checks that non-pointer structs with required fields are marked as
    required, and those without are marked as optional
  • Provides suggested fixes to add or remove appropriate markers
+208/-0 
analyzer.go
Refactor ssatags analyzer for qualified field names           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/ssatags/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack and FieldName() utility
  • Refactored marker payload access from marker.Expressions[""] to
    marker.Payload.Value
  • Simplified field name handling throughout the analyzer by using the
    provided qualified name
+21/-28 
parse.go
Enhance comment handling and import ordering in parser     

tools/vendor/k8s.io/gengo/v2/parser/parse.go

  • Added imports for maps, reflect, and slices packages
  • Implemented minimize() function to remove blank lines and deprecated
    paragraphs from comments
  • Enhanced addCommentsToType() to handle comment conflicts between type
    aliases and real types with detailed logging
  • Added formatCommentBlock() helper for formatting comment output
  • Updated import iteration to use predictable sorted order via
    slices.Sorted(maps.Keys())
  • Fixed splitLines() to return nil for empty strings instead of slice
    with empty string
+119/-4 
analyzer.go
Add ExactlyOneOf marker support to arrayofstruct analyzer

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/arrayofstruct/analyzer.go

  • Added init() function to register KubebuilderExactlyOneOf marker
  • Updated InspectFields callback to use qualifiedFieldName parameter
    instead of stack
  • Added hasExactlyOneOfMarker() function to check for union markers that
    satisfy required field constraints
  • Simplified field name handling by using qualified name parameter
  • Added basic type check in getStructType() to prevent infinite
    recursion
+37/-23 
analyzer.go
Refactor namingconventions analyzer for qualified field names

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/namingconventions/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack and markersAccess
  • Refactored all reporting functions to accept and use
    qualifiedFieldName instead of calling utils.FieldName()
  • Simplified field name handling throughout the analyzer
+15/-15 
config.go
New defaults analyzer configuration types                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaults/config.go

  • New configuration file defining OmitEmptyPolicy and OmitZeroPolicy
    types with multiple policy options
  • Defines DefaultsConfig struct with configuration for default markers
    and omitempty/omitzero tag handling
  • Provides detailed documentation for each configuration option and
    policy behavior
+93/-0   
analyzer.go
Refactor nodurations analyzer to use TypeChecker pattern 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nodurations/analyzer.go

  • Removed fmt import as it's no longer needed
  • Refactored to use new TypeChecker pattern with isDurationType()
    predicate and checkDuration() callback
  • Simplified field and type checking logic by delegating to the
    TypeChecker utility
  • Removed complex recursive type checking in favor of the generic type
    checker pattern
+19/-62 
analyzer.go
New dependenttags analyzer for marker dependencies             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/dependenttags/analyzer.go

  • New analyzer implementing dependenttags linter to enforce dependencies
    between markers
  • Supports two dependency types: DependencyTypeAll (all dependencies
    required) and DependencyTypeAny (at least one required)
  • Provides detailed error messages indicating which markers are missing
    or required
+123/-0 
util.go
Update serialization utilities for qualified field names 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/serialization/util.go

  • Updated reportShouldAddOmitEmpty() to use qualifiedFieldName parameter
    instead of fieldName
  • Updated reportShouldAddOmitZero() to use qualifiedFieldName parameter
    instead of fieldName
  • Updated reportShouldRemoveOmitZero() to use qualifiedFieldName
    parameter instead of fieldName
+10/-10 
initializer.go
New preferredmarkers initializer with validation                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/preferredmarkers/initializer.go

  • New initializer file for preferredmarkers linter with configuration
    validation
  • Implements validation for preferred markers and equivalent identifiers
    with duplicate checking
  • Registers the linter in the default registry
+132/-0 
analyzer.go
Enhance statussubresource analyzer with List type handling

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/statussubresource/analyzer.go

  • Added import for utils package
  • Added check to skip Kubernetes List types which follow different
    patterns
  • Refactored status subresource checking logic to use early returns
    instead of switch statement
  • Improved code readability and maintainability
+35/-27 
analyzer.go
New noreferences analyzer for reference field naming         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/noreferences/analyzer.go

  • New analyzer wrapping namingconventions linter to enforce field naming
    conventions for references
  • Supports two policies: PolicyPreferAbbreviatedReference (replace with
    Ref/Refs) and PolicyNoReferences (warn about reference words)
  • Dynamically builds naming conventions based on configured policy
+109/-0 
analyzer.go
Refactor uniquemarkers analyzer for marker types and qualified names

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/uniquemarkers/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack
  • Refactored constructIdentifier() to handle both
    MarkerTypeDeclarativeValidation and MarkerTypeKubebuilder marker types
  • Updated marker attribute access from marker.Expressions to
    marker.Arguments
  • Updated error reporting to use qualifiedFieldName parameter
+40/-15 
analyzer.go
Refactor commentstart analyzer for qualified field names 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/commentstart/analyzer.go

  • Removed unused imports for go/types and utils
  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack and markersAccess
  • Simplified field name handling by using the provided qualified name
    parameter
+6/-13   
analyzer.go
Refactor conflictingmarkers analyzer for qualified field names

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/conflictingmarkers/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack
  • Refactored conflict checking to pass qualifiedFieldName through the
    call chain
  • Simplified field name handling by removing manual struct name
    concatenation
+8/-15   
analyzer.go
Refactor nomaps analyzer to use TypeChecker pattern           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nomaps/analyzer.go

  • Removed unused go/types import
  • Refactored to use new TypeChecker pattern with isMap() predicate and
    checkMap() callback
  • Added isStringToStringMap() and isBasicMap() helper functions
  • Simplified map checking logic by delegating to the generic type
    checker pattern
  • Updated to inspect both fields and type specs
+30/-32 
initializer.go
New defaults initializer with configuration validation     

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaults/initializer.go

  • New initializer file for defaults analyzer with configuration
    validation
  • Implements validation for preferred default markers and
    omitempty/omitzero policies
  • Registers the linter in the default registry
+91/-0   
analyzer.go
Refactor forbiddenmarkers analyzer for qualified names and marker
attributes

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/forbiddenmarkers/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack
  • Updated marker attribute access from marker.Expressions to
    marker.Arguments
  • Updated error reporting to use qualifiedFieldName parameter
+7/-7     
analyzer.go
Refactor integers analyzer to use TypeChecker pattern       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/integers/analyzer.go

  • Changed analyzer to use custom inspector.Analyzer instead of standard
    inspect.Analyzer
  • Refactored to use new TypeChecker pattern with utils.IsBasicType
    predicate
  • Updated to inspect both fields and type specs instead of using
    preorder traversal
  • Simplified integer type checking logic
+18/-18 
initializer.go
New dependenttags initializer with validation                       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/dependenttags/initializer.go

  • New initializer file for dependenttags analyzer with configuration
    validation
  • Implements validation for dependency rules, identifiers, and
    dependency types
  • Registers the linter in the default registry
+90/-0   
analyzer.go
Refactor nofloats analyzer to use TypeChecker pattern       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nofloats/analyzer.go

  • Changed analyzer to use custom inspector.Analyzer instead of standard
    inspect.Analyzer
  • Refactored to use new TypeChecker pattern with utils.IsBasicType
    predicate
  • Updated to inspect both fields and type specs instead of using
    preorder traversal
  • Simplified float type checking logic
+18/-18 
analyzer.go
Refactor nobools analyzer to use TypeChecker pattern         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nobools/analyzer.go

  • Changed analyzer to use custom inspector.Analyzer instead of standard
    inspect.Analyzer
  • Refactored to use new TypeChecker pattern with utils.IsBasicType
    predicate
  • Updated to inspect both fields and type specs instead of using
    preorder traversal
  • Simplified boolean type checking logic
+18/-18 
type_check.go
Enhance TypeChecker with predicate-based type checking     

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/type_check.go

  • Updated NewTypeChecker() to accept both isTypeFunc predicate and
    checkFunc callback parameters
  • Modified checkTypeExpr() to check the predicate before recursing into
    type structure
  • Updated checkField() to use GetQualifiedFieldName() instead of
    FieldName()
  • Added support for *ast.IndexExpr in type expression checking
  • Removed early return in checkIdent() for basic types
+13/-10 
analyzer.go
New defaultorrequired analyzer for marker conflicts           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaultorrequired/analyzer.go

  • New analyzer wrapping conflictingmarkers linter to enforce that fields
    with defaults are not marked as required
  • Provides predefined conflict set configuration for default and
    required marker combinations
+71/-0   
initializer.go
Add noreferences linter initializer and validation             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/noreferences/initializer.go

  • New initializer file for the noreferences linter
  • Registers the linter with the default registry
  • Implements configuration validation for Policy enum values
  • Validates PolicyPreferAbbreviatedReference and PolicyNoReferences
    policies
+64/-0   
analyzer.go
Update duplicatemarkers to use qualified field names         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/duplicatemarkers/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter
  • Removed unused stack parameter from callback
  • Changed checkField function to accept and use qualifiedFieldName
    instead of extracting field name
  • Updated error reporting to use qualified field name for better context
+4/-4     
config.go
Add dependenttags linter configuration structures               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/dependenttags/config.go

  • New configuration file defining DependencyType enum with All and Any
    values
  • Defines Config struct with list of dependency rules
  • Defines Rule struct specifying marker identifier and dependent markers
  • Documents configuration structure for marker dependency validation
+45/-0   
config.go
Add preferredmarkers linter configuration structures         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/preferredmarkers/config.go

  • New configuration file for the preferredmarkers linter
  • Defines Config struct with list of preferred markers
  • Defines Marker struct with preferred identifier and equivalent
    identifiers
  • Defines EquivalentIdentifier struct for marker replacement suggestions
+49/-0   
markers.go
Add new kubebuilder and k8s marker constants                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/markers/markers.go

  • Added KubebuilderAtLeastOneOfMarker constant for CEL validation
    enforcing at least one field
  • Added KubebuilderExactlyOneOf constant for CEL validation enforcing
    exactly one field
  • Added K8sDefaultMarker constant for default value specification in k8s
    validation
+9/-0     
config.go
Add noreferences linter configuration structures                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/noreferences/config.go

  • New configuration file defining Policy type for reference handling
  • Defines PolicyPreferAbbreviatedReference and PolicyNoReferences
    constants
  • Defines Config struct with optional Policy field
  • Documents policy behavior for field name validation
+36/-0   
config.go
Add nonpointerstructs linter configuration structures       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nonpointerstructs/config.go

  • New configuration file for the nonpointerstructs linter
  • Defines Config struct with preferred marker settings
  • Documents PreferredRequiredMarker and PreferredOptionalMarker
    configuration options
  • Specifies valid marker values for fixes
+29/-0   
analyzer.go
Update maxlength to use qualified field names                       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/maxlength/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter
  • Removed unused stack and jsonTagInfo parameters from callback
  • Simplified checkField function to accept qualifiedFieldName directly
  • Removed local field name extraction logic
+4/-9     
initializer.go
Add minlength linter initializer                                                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/minlength/initializer.go

  • New initializer file for the minlength linter
  • Registers the linter with the default registry
  • Creates non-configurable analyzer initializer
  • Marks linter as not enabled by default (CRD only)
+35/-0   
initializer.go
Add defaultorrequired analyzer initializer                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaultorrequired/initializer.go

  • New initializer file for the defaultorrequired analyzer
  • Registers the analyzer with the default registry
  • Creates non-configurable analyzer initializer
  • Marks analyzer as enabled by default
+35/-0   
analyzer.go
Update statusoptional callback signature                                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/statusoptional/analyzer.go

  • Updated InspectFields callback signature to remove unused stack
    parameter
  • Changed unused last parameter to underscore placeholder
  • Maintains callback functionality while cleaning up signature
+1/-1     
parse_pre_122.go
Add isTypeAlias function for pre-1.22 support                       

tools/vendor/k8s.io/gengo/v2/parser/parse_pre_122.go

  • Added new isTypeAlias function for pre-1.22 Go versions
  • Function returns false as type aliases are not supported in older Go
    versions
+4/-0     
Documentation
8 files
doc.go
New preferredmarkers linter documentation                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/preferredmarkers/doc.go

  • New documentation file explaining the preferredmarkers linter
    functionality
  • Provides configuration examples for enforcing preferred marker usage
  • Documents behavior when equivalent markers are found and how fixes are
    applied
+96/-0   
doc.go
New minlength analyzer documentation                                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/minlength/doc.go

  • New documentation file explaining the minlength analyzer functionality
  • Documents requirements for minimum length on strings, items on arrays,
    properties on maps, and fields on structs
  • Provides guidance on using kubebuilder validation markers for minimum
    constraints
+49/-0   
doc.go
Add dependenttags analyzer documentation                                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/dependenttags/doc.go

  • New documentation file for the dependenttags analyzer package
  • Describes enforcement of dependencies between markers on fields
  • Includes configuration examples with All and Any dependency types
  • Documents marker validation without automatic fixes
+51/-0   
doc.go
Add nonpointerstructs linter documentation                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nonpointerstructs/doc.go

  • New documentation file for the nonpointerstructs linter
  • Explains validation of non-pointer structs with required fields
  • Documents differences from CRD type validation
  • Provides guidance on pointer vs non-pointer struct field usage
+34/-0   
doc.go
Add noreferences linter documentation                                       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/noreferences/doc.go

  • New documentation file for the noreferences linter
  • Describes enforcement of Ref/Refs naming convention over
    Reference/References
  • Documents two policy modes: PreferAbbreviatedReference and
    NoReferences
  • Includes configuration examples for both policies
+39/-0   
doc.go
Add defaults linter documentation                                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaults/doc.go

  • New documentation file for the defaults linter
  • Explains validation of fields with default markers
  • Documents requirement for optional marker and omitempty/omitzero tags
  • Provides examples of correct and incorrect field configurations
+41/-0   
doc.go
Add defaultorrequired analyzer documentation                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaultorrequired/doc.go

  • New documentation file for the defaultorrequired analyzer
  • Explains validation that required fields cannot have default values
  • Documents conflicting concepts between required and default
  • Provides example of flagged configuration
+32/-0   
doc.go
Fix naming conventions operation name typo                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/namingconventions/doc.go

  • Fixed typo: Replace operation renamed to Replacement
  • Updated documentation to reflect correct operation name
  • Clarified operation descriptions for consistency
+2/-2     
Configuration changes
2 files
doc.go
Register new analyzers in linter registry                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/registration/doc.go

  • Added blank line after copyright header for formatting consistency
  • Added imports for new analyzers: defaultorrequired, defaults,
    dependenttags, minlength, namingconventions, nonpointerstructs,
    noreferences, preferredmarkers
+9/-0     
initializer.go
Disable statusoptional analyzer by default                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/statusoptional/initializer.go

  • Changed default status from true to false
  • Marks statusoptional analyzer as not enabled by default
+1/-1     
Bug fix
2 files
namer.go
Fix GoSeperator typo with backward compatibility                 

tools/vendor/k8s.io/gengo/v2/namer/namer.go

  • Fixed typo: renamed GoSeperator to GoSeparator
  • Kept deprecated GoSeperator alias pointing to GoSeparator for backward
    compatibility
  • Updated internal usage to use corrected GoSeparator constant
+6/-3     
import_tracker.go
Update import_tracker to use GoSeparator                                 

tools/vendor/k8s.io/gengo/v2/generator/import_tracker.go

  • Updated comment reference from GoSeperator to GoSeparator
  • Updated code to use corrected GoSeparator constant
  • Maintains consistency with typo fix in namer package
+2/-2     
Formatting
13 files
initializer.go
Fix spelling errors in initializer comments                           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/initializer/initializer.go

  • Fixed typo in comment: inializer to initializer
  • Fixed typo in comment: intializes to initializes
  • Fixed typo in comment: initializr to initialized
+3/-3     
config.go
Fix grammar in requiredfields configuration                           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/requiredfields/config.go

  • Fixed typo in comment: wont to will not
  • Improved grammar in configuration documentation
+1/-1     
config.go
Fix spelling in optionalfields configuration                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/optionalfields/config.go

  • Fixed typo in comment: acurately to accurately
  • Improved documentation clarity for pointer preference option
+1/-1     
doc.go
Fix spelling in optionalfields documentation                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/optionalfields/doc.go

  • Fixed typo in comment: numebr to number
  • Improved documentation clarity for struct pointer requirements
+1/-1     
doc.go
Fix spelling in conditions documentation                                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/conditions/doc.go

  • Fixed typo in comment: Kuberenetes to Kubernetes
  • Improved documentation accuracy
+1/-1     
doc.go
Fix spelling in integers documentation                                     

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/integers/doc.go

  • Fixed typo in comment: anaylzer to analyzer
  • Improved documentation clarity
+1/-1     
doc.go
Fix spelling in nobools documentation                                       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nobools/doc.go

  • Fixed typo in comment: meaningul to meaningful
  • Improved documentation clarity for enum usage
+1/-1     
base.go
Fix spelling in plugin documentation                                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/plugin/base/base.go

  • Fixed typo in comment: anaylzers to analyzers
  • Improved documentation accuracy for golangci-lint plugin
+1/-1     
initializer.go
Fix spelling in nomaps initializer                                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nomaps/initializer.go

  • Fixed typo in comment: intialized to initialized
  • Improved documentation clarity
+1/-1     
config.go
Fix duplicate word in serialization config                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/serialization/config.go

  • Fixed typo in comment: the the to the
  • Removed duplicate word in documentation
+1/-1     
initializer.go
Fix spelling in uniquemarkers initializer                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/uniquemarkers/initializer.go

  • Fixed typo in comment: intialized to initialized
  • Improved documentation clarity
+1/-1     
initializer.go
Fix spelling in ssatags initializer                                           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/ssatags/initializer.go

  • Fixed typo in comment: intialized to initialized
  • Improved documentation clarity
+1/-1     
initializer.go
Fix spelling in optionalfields initializer                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/optionalfields/initializer.go

  • Fixed typo in comment: intialized to initialized
  • Improved documentation clarity
+1/-1     
Additional files
8 files
go.mod +2/-2     
Makefile +1/-1     
execute.go +37/-2   
parse_122.go +5/-0     
modules.txt +10/-3   
initializer.go +67/-0   
analyzer.go +4/-5     
analyzer.go +6/-11   

Update kube-api-linter from v0.0.0-20251028144537 to v0.0.0-20260114104534.
This also bumps k8s.io/gengo/v2 to v2.0.0-20250922181213 as a transitive
dependency.

Created with support from Claude Opus 4 (Anthropic)
@openshift-ci-robot
Copy link

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 19, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 19, 2026

@jaypoulz: This pull request references OCPEDGE-2084 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Update kube-api-linter from v0.0.0-20251028144537 to v0.0.0-20260114104534. This also bumps k8s.io/gengo/v2 to v2.0.0-20250922181213 as a transitive dependency.

Created with support from Claude Opus 4 (Anthropic)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 19, 2026

Hello @jaypoulz! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

The pull request updates dependency versions in tools/go.mod. The module k8s.io/gengo/v2 is bumped to a newer release, and sigs.k8s.io/kube-api-linter is updated to a more recent version. These are straightforward version updates with no modifications to control flow, error handling, or exported entity signatures. The changes affect only the dependency declarations in the go module file.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the primary change in the PR: bumping the kube-api-linter dependency to the latest version.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly relates to updating kube-api-linter and k8s.io/gengo/v2 dependencies, matching the changeset in tools/go.mod.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 19, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 19, 2026

@jaypoulz: This pull request references OCPEDGE-2084 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

User description

Update kube-api-linter from v0.0.0-20251028144537 to v0.0.0-20260114104534. This also bumps k8s.io/gengo/v2 to v2.0.0-20250922181213 as a transitive dependency.

Created with support from Claude Opus 4 (Anthropic)


PR Type

Enhancement


Description

  • Updated kube-api-linter from v0.0.0-20251028144537 to v0.0.0-20260114104534 with significant new analyzers and improvements

  • Added declarative validation marker support with orphaned marker detection, marker type enums, and payload structures for both Kubebuilder and k8s validation styles

  • Implemented new analyzers: defaults (validates default marker usage), preferredmarkers (enforces marker standardization), minlength (checks minimum length requirements), dependenttags (enforces marker dependencies), nonpointerstructs (validates struct field markers), noreferences (enforces reference field naming), and defaultorrequired (prevents conflicting markers)

  • Enhanced field inspection infrastructure with qualified field names, list type handling, and improved callback signatures across all analyzers

  • Refactored multiple analyzers (nodurations, nomaps, nofloats, nobools, integers) to use new TypeChecker pattern for cleaner type validation

  • Improved serialization checks with custom marshalling support, explicit zero value validation, and better error reporting

  • Updated k8s.io/gengo/v2 to v2.0.0-20250922181213 with enhanced comment handling, import ordering, and type alias support

  • Fixed typos and spelling errors throughout documentation and code comments for improved clarity

  • Fixed GoSeperator typo in namer package with backward compatibility alias


Diagram Walkthrough

flowchart LR
 A["kube-api-linter<br/>v0.0.0-20251028144537"] -->|"Update to<br/>v0.0.0-20260114104534"| B["Enhanced Linter"]
 B --> C["New Analyzers"]
 B --> D["Improved Infrastructure"]
 B --> E["Refactored Patterns"]
 C --> C1["defaults"]
 C --> C2["preferredmarkers"]
 C --> C3["minlength"]
 C --> C4["dependenttags"]
 C --> C5["nonpointerstructs"]
 C --> C6["noreferences"]
 D --> D1["Qualified Field Names"]
 D --> D2["Declarative Validation<br/>Markers"]
 D --> D3["List Type Handling"]
 E --> E1["TypeChecker Pattern"]
 E --> E2["Serialization Checks"]
 B --> F["k8s.io/gengo/v2<br/>v2.0.0-20250922181213"]
Loading

File Walkthrough

Relevant files
Enhancement
45 files
analyzer.go
Support declarative validation markers and orphaned marker detection

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/helpers/markers/analyzer.go

  • Renamed UnnamedExpression constant to UnnamedArgument and updated
    related documentation to reflect declarative validation marker
    terminology
  • Added support for declarative validation markers (k8s: prefix)
    alongside existing Kubebuilder-style markers with new MarkerType enum
  • Implemented orphaned marker detection to handle markers separated from
    type/field declarations by blank lines, including helper functions for
    validation
  • Enhanced marker extraction with Payload struct to support both string
    values and nested markers, replacing the previous Expressions map
  • Added regex patterns and helper functions (containsOnlyMarkers,
    looksLikeCommentedCode, hasCodeIndicators) to distinguish markers from
    commented-out code
  • Integrated k8s.io/gengo/v2/codetags package for parsing declarative
    validation markers
+596/-47
serialization_check.go
Enhanced serialization checks with qualified field names and custom
marshalling support

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/serialization/serialization_check.go

  • Added qualifiedFieldName parameter to Check method and related helper
    functions for better error reporting
  • Added logic to detect structs with custom marshalling (Type=string
    marker) and treat them as string types for validation
  • Added hasExplicitZeroMinValidation function to handle
    pointer-to-slice/map with MinItems=0 or MinProperties=0 markers
  • Refactored pointer validation logic into separate
    handlePointerToPointerType and handleNonPointerToPointerType methods
  • Updated all function signatures to pass markersAccess and underlying
    type information for enhanced validation
+115/-43
analyzer.go
New defaults analyzer for validating default marker usage

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaults/analyzer.go

  • New analyzer for checking fields with default markers (+default,
    +kubebuilder:default, +k8s:default)
  • Validates that fields with defaults are marked as optional and not
    required
  • Ensures fields with defaults have omitempty or omitzero in json tags
  • Provides suggested fixes for replacing secondary default markers with
    preferred ones
  • Handles both Kubebuilder and declarative validation marker styles
+397/-0 
zero_value.go
Enhanced zero value validation with qualified names and custom
marshalling

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/zero_value.go

  • Added qualifiedFieldName parameter to IsZeroValueValid and related
    functions for improved error reporting
  • Added GetTypeMarkerValue function to extract Type marker values for
    structs with custom marshalling
  • Added special handling for structs with Type=string marker to validate
    them as strings instead of structs
  • Added IsFieldOptional function to check for optional markers (mirrors
    existing IsFieldRequired)
  • Updated enumFieldAllowsEmpty to use Payload.Value instead of
    Expressions map
  • Added GetMinProperties helper function for extracting minimum
    properties marker values
  • Added IsKubernetesListType function to detect Kubernetes List type
    structs
+69/-24 
analyzer.go
New preferred markers analyzer for marker standardization

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/preferredmarkers/analyzer.go

  • New analyzer for enforcing preferred marker usage over equivalent
    markers
  • Supports configuration-driven mapping of equivalent markers to
    preferred identifiers
  • Generates suggested fixes to replace or remove equivalent markers
  • Handles both Kubebuilder and declarative validation marker
    reconstruction
  • Provides deterministic reporting with sorted marker lists and text
    edits
+315/-0 
analyzer.go
New minlength analyzer for validation marker requirements

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/minlength/analyzer.go

  • New analyzer for checking minimum length requirements on strings,
    arrays, maps, and structs
  • Validates that formatted strings have MinLength markers
  • Validates that arrays have MinItems and maps have MinProperties
    markers
  • Handles special cases like byte slices (treated as strings) and array
    element validation
  • Checks struct fields for required markers or union constraints
    (exactlyOneOf/atLeastOneOf)
+258/-0 
inspector.go
Refactored field inspection with qualified names and list type
handling

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/helpers/inspector/inspector.go

  • Updated InspectFields callback signature to include qualifiedFieldName
    parameter and remove stack parameter
  • Added InspectFieldsIncludingListTypes method for inspecting fields in
    list type structs
  • Refactored field inspection logic into shared inspectFields method
    with skipListTypes parameter
  • Added logic to compute qualified field names including struct name
    prefix
  • Updated shouldProcessField to use IsKubernetesListType utility
    function
+48/-37 
utils.go
Added utility functions for type checking and qualified naming

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/utils.go

  • Added IsStringType function to check if an expression is a string
    type, including aliases
  • Added IsPointer function to check if an expression is a pointer
  • Added GetStructName and GetStructNameFromFile functions to retrieve
    struct names for fields
  • Added GetQualifiedFieldName function to construct qualified field
    names
  • Added GetMinProperties function to extract minimum properties marker
    values
  • Added IsKubernetesListType function to detect Kubernetes List type
    structs with structural validation
  • Added helper functions hasListFields and getFieldTypeName for list
    type detection
  • Updated TypeAwareMarkerCollectionForField to use correct import for
    markers helper
+191/-37
analyzer.go
Updated jsontags analyzer for new field inspection interface

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/jsontags/analyzer.go

  • Updated InspectFields callback to use InspectFieldsIncludingListTypes
    for broader field coverage
  • Updated callback signature to use qualifiedFieldName parameter instead
    of computing field name locally
  • Removed unused stack parameter from callback
  • Simplified field name handling by using pre-computed qualified name
+5/-7     
analyzer.go
New nonpointerstructs analyzer for struct field markers   

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nonpointerstructs/analyzer.go

  • New analyzer file implementing nonpointerstructs linter to enforce
    required/optional markers on non-pointer struct fields
  • Checks that non-pointer structs with required fields are marked as
    required, and those without are marked as optional
  • Provides suggested fixes to add or remove appropriate markers
+208/-0 
analyzer.go
Refactor ssatags analyzer for qualified field names           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/ssatags/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack and FieldName() utility
  • Refactored marker payload access from marker.Expressions[""] to
    marker.Payload.Value
  • Simplified field name handling throughout the analyzer by using the
    provided qualified name
+21/-28 
parse.go
Enhance comment handling and import ordering in parser     

tools/vendor/k8s.io/gengo/v2/parser/parse.go

  • Added imports for maps, reflect, and slices packages
  • Implemented minimize() function to remove blank lines and deprecated
    paragraphs from comments
  • Enhanced addCommentsToType() to handle comment conflicts between type
    aliases and real types with detailed logging
  • Added formatCommentBlock() helper for formatting comment output
  • Updated import iteration to use predictable sorted order via
    slices.Sorted(maps.Keys())
  • Fixed splitLines() to return nil for empty strings instead of slice
    with empty string
+119/-4 
analyzer.go
Add ExactlyOneOf marker support to arrayofstruct analyzer

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/arrayofstruct/analyzer.go

  • Added init() function to register KubebuilderExactlyOneOf marker
  • Updated InspectFields callback to use qualifiedFieldName parameter
    instead of stack
  • Added hasExactlyOneOfMarker() function to check for union markers that
    satisfy required field constraints
  • Simplified field name handling by using qualified name parameter
  • Added basic type check in getStructType() to prevent infinite
    recursion
+37/-23 
analyzer.go
Refactor namingconventions analyzer for qualified field names

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/namingconventions/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack and markersAccess
  • Refactored all reporting functions to accept and use
    qualifiedFieldName instead of calling utils.FieldName()
  • Simplified field name handling throughout the analyzer
+15/-15 
config.go
New defaults analyzer configuration types                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaults/config.go

  • New configuration file defining OmitEmptyPolicy and OmitZeroPolicy
    types with multiple policy options
  • Defines DefaultsConfig struct with configuration for default markers
    and omitempty/omitzero tag handling
  • Provides detailed documentation for each configuration option and
    policy behavior
+93/-0   
analyzer.go
Refactor nodurations analyzer to use TypeChecker pattern 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nodurations/analyzer.go

  • Removed fmt import as it's no longer needed
  • Refactored to use new TypeChecker pattern with isDurationType()
    predicate and checkDuration() callback
  • Simplified field and type checking logic by delegating to the
    TypeChecker utility
  • Removed complex recursive type checking in favor of the generic type
    checker pattern
+19/-62 
analyzer.go
New dependenttags analyzer for marker dependencies             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/dependenttags/analyzer.go

  • New analyzer implementing dependenttags linter to enforce dependencies
    between markers
  • Supports two dependency types: DependencyTypeAll (all dependencies
    required) and DependencyTypeAny (at least one required)
  • Provides detailed error messages indicating which markers are missing
    or required
+123/-0 
util.go
Update serialization utilities for qualified field names 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/serialization/util.go

  • Updated reportShouldAddOmitEmpty() to use qualifiedFieldName parameter
    instead of fieldName
  • Updated reportShouldAddOmitZero() to use qualifiedFieldName parameter
    instead of fieldName
  • Updated reportShouldRemoveOmitZero() to use qualifiedFieldName
    parameter instead of fieldName
+10/-10 
initializer.go
New preferredmarkers initializer with validation                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/preferredmarkers/initializer.go

  • New initializer file for preferredmarkers linter with configuration
    validation
  • Implements validation for preferred markers and equivalent identifiers
    with duplicate checking
  • Registers the linter in the default registry
+132/-0 
analyzer.go
Enhance statussubresource analyzer with List type handling

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/statussubresource/analyzer.go

  • Added import for utils package
  • Added check to skip Kubernetes List types which follow different
    patterns
  • Refactored status subresource checking logic to use early returns
    instead of switch statement
  • Improved code readability and maintainability
+35/-27 
analyzer.go
New noreferences analyzer for reference field naming         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/noreferences/analyzer.go

  • New analyzer wrapping namingconventions linter to enforce field naming
    conventions for references
  • Supports two policies: PolicyPreferAbbreviatedReference (replace with
    Ref/Refs) and PolicyNoReferences (warn about reference words)
  • Dynamically builds naming conventions based on configured policy
+109/-0 
analyzer.go
Refactor uniquemarkers analyzer for marker types and qualified names

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/uniquemarkers/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack
  • Refactored constructIdentifier() to handle both
    MarkerTypeDeclarativeValidation and MarkerTypeKubebuilder marker types
  • Updated marker attribute access from marker.Expressions to
    marker.Arguments
  • Updated error reporting to use qualifiedFieldName parameter
+40/-15 
analyzer.go
Refactor commentstart analyzer for qualified field names 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/commentstart/analyzer.go

  • Removed unused imports for go/types and utils
  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack and markersAccess
  • Simplified field name handling by using the provided qualified name
    parameter
+6/-13   
analyzer.go
Refactor conflictingmarkers analyzer for qualified field names

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/conflictingmarkers/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack
  • Refactored conflict checking to pass qualifiedFieldName through the
    call chain
  • Simplified field name handling by removing manual struct name
    concatenation
+8/-15   
analyzer.go
Refactor nomaps analyzer to use TypeChecker pattern           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nomaps/analyzer.go

  • Removed unused go/types import
  • Refactored to use new TypeChecker pattern with isMap() predicate and
    checkMap() callback
  • Added isStringToStringMap() and isBasicMap() helper functions
  • Simplified map checking logic by delegating to the generic type
    checker pattern
  • Updated to inspect both fields and type specs
+30/-32 
initializer.go
New defaults initializer with configuration validation     

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaults/initializer.go

  • New initializer file for defaults analyzer with configuration
    validation
  • Implements validation for preferred default markers and
    omitempty/omitzero policies
  • Registers the linter in the default registry
+91/-0   
analyzer.go
Refactor forbiddenmarkers analyzer for qualified names and marker
attributes

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/forbiddenmarkers/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter instead of stack
  • Updated marker attribute access from marker.Expressions to
    marker.Arguments
  • Updated error reporting to use qualifiedFieldName parameter
+7/-7     
analyzer.go
Refactor integers analyzer to use TypeChecker pattern       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/integers/analyzer.go

  • Changed analyzer to use custom inspector.Analyzer instead of standard
    inspect.Analyzer
  • Refactored to use new TypeChecker pattern with utils.IsBasicType
    predicate
  • Updated to inspect both fields and type specs instead of using
    preorder traversal
  • Simplified integer type checking logic
+18/-18 
initializer.go
New dependenttags initializer with validation                       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/dependenttags/initializer.go

  • New initializer file for dependenttags analyzer with configuration
    validation
  • Implements validation for dependency rules, identifiers, and
    dependency types
  • Registers the linter in the default registry
+90/-0   
analyzer.go
Refactor nofloats analyzer to use TypeChecker pattern       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nofloats/analyzer.go

  • Changed analyzer to use custom inspector.Analyzer instead of standard
    inspect.Analyzer
  • Refactored to use new TypeChecker pattern with utils.IsBasicType
    predicate
  • Updated to inspect both fields and type specs instead of using
    preorder traversal
  • Simplified float type checking logic
+18/-18 
analyzer.go
Refactor nobools analyzer to use TypeChecker pattern         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nobools/analyzer.go

  • Changed analyzer to use custom inspector.Analyzer instead of standard
    inspect.Analyzer
  • Refactored to use new TypeChecker pattern with utils.IsBasicType
    predicate
  • Updated to inspect both fields and type specs instead of using
    preorder traversal
  • Simplified boolean type checking logic
+18/-18 
type_check.go
Enhance TypeChecker with predicate-based type checking     

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/type_check.go

  • Updated NewTypeChecker() to accept both isTypeFunc predicate and
    checkFunc callback parameters
  • Modified checkTypeExpr() to check the predicate before recursing into
    type structure
  • Updated checkField() to use GetQualifiedFieldName() instead of
    FieldName()
  • Added support for *ast.IndexExpr in type expression checking
  • Removed early return in checkIdent() for basic types
+13/-10 
analyzer.go
New defaultorrequired analyzer for marker conflicts           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaultorrequired/analyzer.go

  • New analyzer wrapping conflictingmarkers linter to enforce that fields
    with defaults are not marked as required
  • Provides predefined conflict set configuration for default and
    required marker combinations
+71/-0   
initializer.go
Add noreferences linter initializer and validation             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/noreferences/initializer.go

  • New initializer file for the noreferences linter
  • Registers the linter with the default registry
  • Implements configuration validation for Policy enum values
  • Validates PolicyPreferAbbreviatedReference and PolicyNoReferences
    policies
+64/-0   
analyzer.go
Update duplicatemarkers to use qualified field names         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/duplicatemarkers/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter
  • Removed unused stack parameter from callback
  • Changed checkField function to accept and use qualifiedFieldName
    instead of extracting field name
  • Updated error reporting to use qualified field name for better context
+4/-4     
config.go
Add dependenttags linter configuration structures               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/dependenttags/config.go

  • New configuration file defining DependencyType enum with All and Any
    values
  • Defines Config struct with list of dependency rules
  • Defines Rule struct specifying marker identifier and dependent markers
  • Documents configuration structure for marker dependency validation
+45/-0   
config.go
Add preferredmarkers linter configuration structures         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/preferredmarkers/config.go

  • New configuration file for the preferredmarkers linter
  • Defines Config struct with list of preferred markers
  • Defines Marker struct with preferred identifier and equivalent
    identifiers
  • Defines EquivalentIdentifier struct for marker replacement suggestions
+49/-0   
markers.go
Add new kubebuilder and k8s marker constants                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/markers/markers.go

  • Added KubebuilderAtLeastOneOfMarker constant for CEL validation
    enforcing at least one field
  • Added KubebuilderExactlyOneOf constant for CEL validation enforcing
    exactly one field
  • Added K8sDefaultMarker constant for default value specification in k8s
    validation
+9/-0     
config.go
Add noreferences linter configuration structures                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/noreferences/config.go

  • New configuration file defining Policy type for reference handling
  • Defines PolicyPreferAbbreviatedReference and PolicyNoReferences
    constants
  • Defines Config struct with optional Policy field
  • Documents policy behavior for field name validation
+36/-0   
config.go
Add nonpointerstructs linter configuration structures       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nonpointerstructs/config.go

  • New configuration file for the nonpointerstructs linter
  • Defines Config struct with preferred marker settings
  • Documents PreferredRequiredMarker and PreferredOptionalMarker
    configuration options
  • Specifies valid marker values for fixes
+29/-0   
analyzer.go
Update maxlength to use qualified field names                       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/maxlength/analyzer.go

  • Updated InspectFields callback signature to use qualifiedFieldName
    parameter
  • Removed unused stack and jsonTagInfo parameters from callback
  • Simplified checkField function to accept qualifiedFieldName directly
  • Removed local field name extraction logic
+4/-9     
initializer.go
Add minlength linter initializer                                                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/minlength/initializer.go

  • New initializer file for the minlength linter
  • Registers the linter with the default registry
  • Creates non-configurable analyzer initializer
  • Marks linter as not enabled by default (CRD only)
+35/-0   
initializer.go
Add defaultorrequired analyzer initializer                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaultorrequired/initializer.go

  • New initializer file for the defaultorrequired analyzer
  • Registers the analyzer with the default registry
  • Creates non-configurable analyzer initializer
  • Marks analyzer as enabled by default
+35/-0   
analyzer.go
Update statusoptional callback signature                                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/statusoptional/analyzer.go

  • Updated InspectFields callback signature to remove unused stack
    parameter
  • Changed unused last parameter to underscore placeholder
  • Maintains callback functionality while cleaning up signature
+1/-1     
parse_pre_122.go
Add isTypeAlias function for pre-1.22 support                       

tools/vendor/k8s.io/gengo/v2/parser/parse_pre_122.go

  • Added new isTypeAlias function for pre-1.22 Go versions
  • Function returns false as type aliases are not supported in older Go
    versions
+4/-0     
Documentation
8 files
doc.go
New preferredmarkers linter documentation                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/preferredmarkers/doc.go

  • New documentation file explaining the preferredmarkers linter
    functionality
  • Provides configuration examples for enforcing preferred marker usage
  • Documents behavior when equivalent markers are found and how fixes are
    applied
+96/-0   
doc.go
New minlength analyzer documentation                                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/minlength/doc.go

  • New documentation file explaining the minlength analyzer functionality
  • Documents requirements for minimum length on strings, items on arrays,
    properties on maps, and fields on structs
  • Provides guidance on using kubebuilder validation markers for minimum
    constraints
+49/-0   
doc.go
Add dependenttags analyzer documentation                                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/dependenttags/doc.go

  • New documentation file for the dependenttags analyzer package
  • Describes enforcement of dependencies between markers on fields
  • Includes configuration examples with All and Any dependency types
  • Documents marker validation without automatic fixes
+51/-0   
doc.go
Add nonpointerstructs linter documentation                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nonpointerstructs/doc.go

  • New documentation file for the nonpointerstructs linter
  • Explains validation of non-pointer structs with required fields
  • Documents differences from CRD type validation
  • Provides guidance on pointer vs non-pointer struct field usage
+34/-0   
doc.go
Add noreferences linter documentation                                       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/noreferences/doc.go

  • New documentation file for the noreferences linter
  • Describes enforcement of Ref/Refs naming convention over
    Reference/References
  • Documents two policy modes: PreferAbbreviatedReference and
    NoReferences
  • Includes configuration examples for both policies
+39/-0   
doc.go
Add defaults linter documentation                                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaults/doc.go

  • New documentation file for the defaults linter
  • Explains validation of fields with default markers
  • Documents requirement for optional marker and omitempty/omitzero tags
  • Provides examples of correct and incorrect field configurations
+41/-0   
doc.go
Add defaultorrequired analyzer documentation                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaultorrequired/doc.go

  • New documentation file for the defaultorrequired analyzer
  • Explains validation that required fields cannot have default values
  • Documents conflicting concepts between required and default
  • Provides example of flagged configuration
+32/-0   
doc.go
Fix naming conventions operation name typo                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/namingconventions/doc.go

  • Fixed typo: Replace operation renamed to Replacement
  • Updated documentation to reflect correct operation name
  • Clarified operation descriptions for consistency
+2/-2     
Configuration changes
2 files
doc.go
Register new analyzers in linter registry                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/registration/doc.go

  • Added blank line after copyright header for formatting consistency
  • Added imports for new analyzers: defaultorrequired, defaults,
    dependenttags, minlength, namingconventions, nonpointerstructs,
    noreferences, preferredmarkers
+9/-0     
initializer.go
Disable statusoptional analyzer by default                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/statusoptional/initializer.go

  • Changed default status from true to false
  • Marks statusoptional analyzer as not enabled by default
+1/-1     
Bug fix
2 files
namer.go
Fix GoSeperator typo with backward compatibility                 

tools/vendor/k8s.io/gengo/v2/namer/namer.go

  • Fixed typo: renamed GoSeperator to GoSeparator
  • Kept deprecated GoSeperator alias pointing to GoSeparator for backward
    compatibility
  • Updated internal usage to use corrected GoSeparator constant
+6/-3     
import_tracker.go
Update import_tracker to use GoSeparator                                 

tools/vendor/k8s.io/gengo/v2/generator/import_tracker.go

  • Updated comment reference from GoSeperator to GoSeparator
  • Updated code to use corrected GoSeparator constant
  • Maintains consistency with typo fix in namer package
+2/-2     
Formatting
13 files
initializer.go
Fix spelling errors in initializer comments                           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/initializer/initializer.go

  • Fixed typo in comment: inializer to initializer
  • Fixed typo in comment: intializes to initializes
  • Fixed typo in comment: initializr to initialized
+3/-3     
config.go
Fix grammar in requiredfields configuration                           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/requiredfields/config.go

  • Fixed typo in comment: wont to will not
  • Improved grammar in configuration documentation
+1/-1     
config.go
Fix spelling in optionalfields configuration                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/optionalfields/config.go

  • Fixed typo in comment: acurately to accurately
  • Improved documentation clarity for pointer preference option
+1/-1     
doc.go
Fix spelling in optionalfields documentation                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/optionalfields/doc.go

  • Fixed typo in comment: numebr to number
  • Improved documentation clarity for struct pointer requirements
+1/-1     
doc.go
Fix spelling in conditions documentation                                 

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/conditions/doc.go

  • Fixed typo in comment: Kuberenetes to Kubernetes
  • Improved documentation accuracy
+1/-1     
doc.go
Fix spelling in integers documentation                                     

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/integers/doc.go

  • Fixed typo in comment: anaylzer to analyzer
  • Improved documentation clarity
+1/-1     
doc.go
Fix spelling in nobools documentation                                       

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nobools/doc.go

  • Fixed typo in comment: meaningul to meaningful
  • Improved documentation clarity for enum usage
+1/-1     
base.go
Fix spelling in plugin documentation                                         

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/plugin/base/base.go

  • Fixed typo in comment: anaylzers to analyzers
  • Improved documentation accuracy for golangci-lint plugin
+1/-1     
initializer.go
Fix spelling in nomaps initializer                                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nomaps/initializer.go

  • Fixed typo in comment: intialized to initialized
  • Improved documentation clarity
+1/-1     
config.go
Fix duplicate word in serialization config                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/serialization/config.go

  • Fixed typo in comment: the the to the
  • Removed duplicate word in documentation
+1/-1     
initializer.go
Fix spelling in uniquemarkers initializer                               

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/uniquemarkers/initializer.go

  • Fixed typo in comment: intialized to initialized
  • Improved documentation clarity
+1/-1     
initializer.go
Fix spelling in ssatags initializer                                           

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/ssatags/initializer.go

  • Fixed typo in comment: intialized to initialized
  • Improved documentation clarity
+1/-1     
initializer.go
Fix spelling in optionalfields initializer                             

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/optionalfields/initializer.go

  • Fixed typo in comment: intialized to initialized
  • Improved documentation clarity
+1/-1     
Additional files
8 files
go.mod +2/-2     
Makefile +1/-1     
execute.go +37/-2   
parse_122.go +5/-0     
modules.txt +10/-3   
initializer.go +67/-0   
analyzer.go +4/-5     
analyzer.go +6/-11   

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@qodo-code-review
Copy link

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Swallowed parse errors: Declarative validation marker parsing errors from codetags.Parse are silently ignored
(returning no marker) without reporting context, which may hinder debugging and lead to
missed validations.

Referred Code
func extractDeclarativeValidationMarker(marker string, comment *ast.Comment) *Marker {
	tag, err := codetags.Parse(marker)
	if err != nil {
		return nil
	}

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 19, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@qodo-code-review
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Prevent infinite recursion on cycles

Add cycle detection to the asNonPointerStruct recursive function by tracking
visited types to prevent potential stack overflows.

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/nonpointerstructs/analyzer.go [99-113]

 func asNonPointerStruct(pass *analysis.Pass, field ast.Expr) (*ast.StructType, bool) {
+	return asNonPointerStructRecursive(pass, field, make(map[*ast.Ident]bool))
+}
+
+func asNonPointerStructRecursive(pass *analysis.Pass, field ast.Expr, visited map[*ast.Ident]bool) (*ast.StructType, bool) {
 	switch typ := field.(type) {
 	case *ast.StructType:
 		return typ, true
 	case *ast.Ident:
+		if visited[typ] {
+			return nil, false // Cycle detected
+		}
+		visited[typ] = true
+
 		typeSpec, ok := utils.LookupTypeSpec(pass, typ)
 		if !ok {
 			return nil, false
 		}
 
-		return asNonPointerStruct(pass, typeSpec.Type)
+		return asNonPointerStructRecursive(pass, typeSpec.Type, visited)
 	default:
 		return nil, false
 	}
 }
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a potential infinite recursion bug in the new asNonPointerStruct function and proposes a standard solution to prevent a stack overflow.

Medium
Fix hardcoded indentation in suggestions

Dynamically determine indentation for suggested fixes instead of using a
hardcoded tab character. This can be done by inspecting the column position of
the relevant field.

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/defaults/analyzer.go [157-189]

 func (a *analyzer) checkK8sDefault(pass *analysis.Pass, field *ast.Field, fieldMarkers markershelper.MarkerSet, qualifiedFieldName string, hasOtherDefault bool) {
 	if !fieldMarkers.Has(markers.K8sDefaultMarker) {
 		return
 	}
 
 	// If the field already has +default or +kubebuilder:default, +k8s:default is acceptable alongside them
 	// (e.g., in K/K where both are needed during transition period)
 	if hasOtherDefault {
 		return
 	}
 
 	// If only +k8s:default is present, suggest adding the preferred default marker
 	k8sDefaultMarkers := fieldMarkers.Get(markers.K8sDefaultMarker)
 	for _, marker := range k8sDefaultMarkers {
 		payloadValue := marker.Payload.Value
+		pos := pass.Fset.Position(field.Pos())
+		indentation := strings.Repeat(" ", pos.Column-1)
+
 		pass.Report(analysis.Diagnostic{
 			Pos:     field.Pos(),
 			Message: fmt.Sprintf("field %s has +%s but should also have +%s marker", qualifiedFieldName, markers.K8sDefaultMarker, a.preferredDefaultMarker),
 			SuggestedFixes: []analysis.SuggestedFix{
 				{
 					Message: fmt.Sprintf("add +%s=%s", a.preferredDefaultMarker, payloadValue),
 					TextEdits: []analysis.TextEdit{
 						{
 							Pos:     marker.Pos,
 							End:     marker.Pos,
-							NewText: fmt.Appendf(nil, "// +%s=%s\n\t", a.preferredDefaultMarker, payloadValue),
+							NewText: []byte(fmt.Sprintf("// +%s=%s\n%s", a.preferredDefaultMarker, payloadValue, indentation)),
 						},
 					},
 				},
 			},
 		})
 	}
 }
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies that hardcoding a tab character for indentation in a suggested fix can lead to incorrect formatting. The proposed solution of dynamically determining the indentation from the source code is a robust improvement that enhances the quality and usability of the linter's auto-fix feature.

Low
Prevent panic on unnamed fields

In GetQualifiedFieldName, add a check for an empty field name to handle embedded
fields gracefully. If the field name is empty, return an empty string to avoid
generating a malformed qualified name.

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/utils/utils.go [242-248]

 // GetQualifiedFieldName returns the qualified field name.
 func GetQualifiedFieldName(pass *analysis.Pass, field *ast.Field) string {
 	fieldName := FieldName(field)
+	if fieldName == "" {
+		// This can happen for embedded fields, which don't have a name.
+		return ""
+	}
 	structName := GetStructName(pass, field)
 
 	return fmt.Sprintf("%s.%s", structName, fieldName)
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 4

__

Why: The suggestion's premise of a panic is incorrect, as fmt.Sprintf does not panic with empty strings. However, it correctly identifies that embedded fields would lead to a malformed qualified name (e.g., StructName.). The proposed fix gracefully handles this edge case by returning an empty string, which improves the function's robustness.

Low
General
Improve external command error handling

*Improve error handling in gofmtWrapper to avoid redundant messages by checking
for exec.ExitError and omitting the duplicate error details from the formatted
string.

tools/vendor/k8s.io/gengo/v2/generator/execute.go [139-160]

 func gofmtWrapper(src []byte) ([]byte, error) {
 	const gofmt = "gofmt"
 
 	if _, err := exec.LookPath(gofmt); err != nil {
 		klog.Errorf("WARNING: skipping output simplification: %v", err)
 		return src, nil
 	}
 
 	cmd := exec.Command(gofmt, "-s")
 	cmd.Stdin = bytes.NewReader(src)
 	stdout := &bytes.Buffer{}
 	cmd.Stdout = stdout
 	stderr := &bytes.Buffer{}
 	cmd.Stderr = stderr
 	if err := cmd.Run(); err != nil {
+		if _, isExitErr := err.(*exec.ExitError); isExitErr && stderr.Len() > 0 {
+			return nil, fmt.Errorf("%s failed: %s", gofmt, strings.TrimSpace(stderr.String()))
+		}
 		if stderr.Len() > 0 {
 			return nil, fmt.Errorf("%s failed: %v: %s", gofmt, err, strings.TrimSpace(stderr.String()))
 		}
 		return nil, fmt.Errorf("%s failed: %v", gofmt, err)
 	}
 	return stdout.Bytes(), nil
 }
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a potential for redundant error messages and proposes a valid improvement to the error handling logic, making the output cleaner.

Low
log panics during field inspection

Log recovered panics within processFieldWithRecovery, including the
qualifiedFieldName, to improve debuggability.

tools/vendor/sigs.k8s.io/kube-api-linter/pkg/analysis/helpers/inspector/inspector.go [162-167]

 defer func() {
     if r := recover(); r != nil {
-        // swallow panics
+        log.Printf("panic inspecting field %s: %v", qualifiedFieldName, r)
     }
 }()

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 5

__

Why: The suggestion correctly points out that swallowing panics silently makes debugging difficult and proposes adding logging, which is a good practice for maintainability.

Low
  • More

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 19, 2026

@jaypoulz: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. Review effort 4/5 size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants