-
Notifications
You must be signed in to change notification settings - Fork 237
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
Go client and CRD definition of SQLUser are inconsistent #598
Comments
Hi @radoslav-tomov, sorry to hear you're having trouble with this. I'm having some issues figuring out exactly what problem you're running into here. Would you mind providing the (redacted if necessary) yamls for both your SQLUser CR and your SecretKey CR? Also, in what context are you using the |
@mbzomowski The problem appears when you try to create SQLUser with a password, which is stored in a secret via the go-client. Check the Password field in the SQLUser, it boils down to the type UserPassword struct {
/* Value of the field. Cannot be used if 'valueFrom' is specified. */
// +optional
Value *string `json:"value,omitempty"`
/* Source for the field's value. Cannot be used if 'value' is specified. */
// +optional
ValueFrom *UserValueFrom `json:"valueFrom,omitempty"`
}
type UserValueFrom struct {
/* Reference to a value with the given key in the given Secret in the resource's namespace. */
// +optional
SecretKeyRef *v1alpha1.ResourceRef `json:"secretKeyRef,omitempty"`
} |
Hi @radoslav-tomov, this is a bug that is an oversight on our part. Our Go-Client code generation assumes that fields with the suffix |
Echoing that this issue is useful to us as well at NCR, any ETA on a fix? |
Hi @aw185176 thanks for providing another data point. Unfortunately our team hasn't gotten around to it yet, I couldn't provide a good ETA at this point. It has been tracked in our backlog and we will update this thread when we have more update. Sorry for the inconvenience! Could you please let us know the impact of this issue? Is it currently a blocker for you? This will help us to better prioritize our tasks. |
This issue prevent us from using automatically generated cue definitions to validate our configuration. |
It looks like the Here's all the references to
I haven't tried this, but I think a work-around for this would be to use the kube unstructured API instead, but you lose out on type safety using the Go SDK, which is problematic.
I don't know exactly how the generator for this code works, but if it's picking up the If that's not enough, you could rename the fields |
Also, if the Spot-checking that assumption...
So there's no code at all in this codebase that uses a Go SDK resource type containing a I think that's a pretty good indicator that all the go resource types which contain That's 26 resource types (from the |
@zealws Thanks for the research! Yes it is coming from the incorrect assumption here: We apologize that we may not be able to address the issue immediately due to current capacity limitations. However, if you're interested in contributing to fix the issue, we would be happy to provide some guidance on how to generate and validate the Go client. Please let us know if you'd like to get involved, and we'll share some pointers to help you get started! |
Bug Description
SQLUser CRD definiton states:
Notice, that the
secretKeyRef
actually is a object withkey
andname
.The Go struct generated for the SQLUser boils down to
and the
ResourceRef
So when I try to create a
SQLUser
resource and attempt to reference the password fromSecret
I get an error.Additional Diagnostic Information
Kubernetes Cluster Version
Config Connector Version
k8s-config-connector v1.71.0
Config Connector Mode
cluster
Log Output
Steps to Reproduce
Steps to reproduce the issue
The text was updated successfully, but these errors were encountered: