Describe the bug
The Provisioner struct in the environment provisioner package has three methods Class(), Type(), and Description() that call themselves unconditionally, causing infinite recursion and a stack overflow crash whenever they're invoked.
To Reproduce
- Go to
internal/provisioners/envprov/envprov.go
- Look at the
Provisioner receiver methods around lines 147–162
- Call any of
Class(), Type(), or Description() on a *Provisioner value
- The program crashes with a stack overflow
Expected behavior
These methods should return a meaningful string value (or an empty string), not recurse into themselves. The sibling type envVarResourceTracker implements them correctly by returning stored fields like e.resClass.
Screenshots
func (p *Provisioner) Class() string {
return p.Class() // calls itself infinitely
}
func (p *Provisioner) Type() string {
return p.Type() // calls itself infinitely
}
func (p *Provisioner) Description() string {
return p.Description() // calls itself infinitely
}
Desktop (please complete the following information):
- OS: All platforms
- Version: latest main branch
Additional context
These methods are currently not hit in normal CLI flows, which is why the bug has survived undetected. However, any future code that logs, debugs, or inspects a Provisioner value by calling these methods will immediately crash the binary. A simple fix would be to return a static string like "" or "*" from each method.
Describe the bug
The
Provisionerstruct in the environment provisioner package has three methodsClass(),Type(), andDescription()that call themselves unconditionally, causing infinite recursion and a stack overflow crash whenever they're invoked.To Reproduce
internal/provisioners/envprov/envprov.goProvisionerreceiver methods around lines 147–162Class(),Type(), orDescription()on a*ProvisionervalueExpected behavior
These methods should return a meaningful string value (or an empty string), not recurse into themselves. The sibling type
envVarResourceTrackerimplements them correctly by returning stored fields likee.resClass.Screenshots
Desktop (please complete the following information):
Additional context
These methods are currently not hit in normal CLI flows, which is why the bug has survived undetected. However, any future code that logs, debugs, or inspects a Provisioner value by calling these methods will immediately crash the binary. A simple fix would be to return a static string like
""or"*"from each method.