- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.6k
 
🐛 (go/v4): Simplify init directory validation to only block PROJECT file #5154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| 
           [APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86 The full list of commands accepted by this bot can be found here. The pull request process is described here 
Needs approval from an approver in each of these files:
 
      
 Approvers can indicate their approval by writing   | 
    
982e9d3    to
    6dcd44b      
    Compare
  
    6dcd44b    to
    6d48443      
    Compare
  
    3449c98    to
    f7fede3      
    Compare
  
    f7fede3    to
    e624b6d      
    Compare
  
    Remove overly restrictive directory validation that was blocking legitimate files like mise.toml and other configuration files. The previous logic attempted to allow only specific file types but had inverted logic that blocked most files unnecessarily. At this stage, we don't have a maintainable way to accurately predict all possible file conflicts. The only file that definitively conflicts with scaffolding is the PROJECT file, which kubebuilder generates. This allows users to run kubebuilder init in directories with legitimate configuration files (mise.toml, .envrc, .tool-versions, etc.) without encountering false validation errors.
e624b6d    to
    decd337      
    Compare
  
    | 
           It looks a lot more permissive that what is in place at the moment. Will kubebuilder override existing files ? I don't thinks it'll an issue for experienced people since we just have to look a the git diff and reset the files we want to keep as is. But it may be a good idea to add this hack to the documentation, what do you think ?  | 
    
| 
           /hold We need think more about.  | 
    
| 
           I have no idea what amount of work it could represent hut why not adding a step before generating the files ? Something like: 
 This way, we get rid of the need for hack documentation while keeping flexibility and automated maintenance of the kubebuilder "reserved" files.  | 
    
Remove overly restrictive directory validation that was blocking legitimate
files like mise.toml and other configuration files. The previous logic
attempted to allow only specific file types but had inverted logic that
blocked most files unnecessarily.
At this stage, we don't have a maintainable way to accurately predict all
possible file conflicts. The only file that definitively conflicts with
scaffolding is the PROJECT file, which kubebuilder generates.
This allows users to run
kubebuilder initin directories with legitimateconfiguration files (mise.toml, .envrc, .tool-versions, etc.) without
encountering false validation errors.
Closes: #5143