Skip to content
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

Re-introduce make generate into CI #112

Open
julianKatz opened this issue Apr 30, 2021 · 2 comments
Open

Re-introduce make generate into CI #112

julianKatz opened this issue Apr 30, 2021 · 2 comments

Comments

@julianKatz
Copy link
Contributor

When updating conversion-gen to v0.20.2 in #111, I found a bug. Certain conversion functions were not being included in the generated output.

This bug is being tracked (kubernetes/kubernetes#101567) and is already triaged and assigned.

To get around this bug, I manually changed the conversion file. This will meet our needs in the short term, but is not sustainable. Once the fix is available to us, we should upgrade our conversion-gen and get our automation working correctly again.

@julianKatz
Copy link
Contributor Author

Here is the diff that I made by manually updating the generated conversion files:

diff --git a/constraint/pkg/apis/templates/v1alpha1/zz_generated.conversion.go b/constraint/pkg/apis/templates/v1alpha1/zz_generated.conversion.go
index 7a2a718..b24233e 100644
--- a/constraint/pkg/apis/templates/v1alpha1/zz_generated.conversion.go
+++ b/constraint/pkg/apis/templates/v1alpha1/zz_generated.conversion.go
@@ -434,9 +434,8 @@ func autoConvert_v1alpha1_Validation_To_templates_Validation(in *Validation, out
 	if in.OpenAPIV3Schema != nil {
 		in, out := &in.OpenAPIV3Schema, &out.OpenAPIV3Schema
 		*out = new(apiextensions.JSONSchemaProps)
-		// FIXME: Provide conversion function to convert v1beta1.JSONSchemaProps to apiextensions.JSONSchemaProps
-		compileErrorOnMissingConversion()
+		if err := v1beta1.Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(*in, *out, s); err != nil {
+			return err
+		}
 	} else {
 		out.OpenAPIV3Schema = nil
 	}
diff --git a/constraint/pkg/apis/templates/v1beta1/zz_generated.conversion.go b/constraint/pkg/apis/templates/v1beta1/zz_generated.conversion.go
index 72aaeb5..1df4c21 100644
--- a/constraint/pkg/apis/templates/v1beta1/zz_generated.conversion.go
+++ b/constraint/pkg/apis/templates/v1beta1/zz_generated.conversion.go
@@ -434,9 +434,8 @@ func autoConvert_v1beta1_Validation_To_templates_Validation(in *Validation, out
 	if in.OpenAPIV3Schema != nil {
 		in, out := &in.OpenAPIV3Schema, &out.OpenAPIV3Schema
 		*out = new(apiextensions.JSONSchemaProps)
-		// FIXME: Provide conversion function to convert apiextensionsv1beta1.JSONSchemaProps to apiextensions.JSONSchemaProps
-		compileErrorOnMissingConversion()
+		if err := apiextensionsv1beta1.Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(*in, *out, s); err != nil {
+			return err
+		}
 	} else {
 		out.OpenAPIV3Schema = nil
 	}

@willbeason
Copy link
Member

kubernetes/kubernetes#101567 has been unassigned; it looks like progress isn't currently being made for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants