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

Pin the k8s version in the generated resources for node #121

Merged
merged 4 commits into from
Dec 18, 2023

Conversation

mjeffryes
Copy link
Member

Fixes #28

crd2pulumi uses codegen in a kind of funny way to generate resources that act as resources of the kubernetes resource plugin. This means the resource version needs to match a kubernetes plugin version. Generated resources however, default to the version from the package.json, so if the user attempts to give the generated package a version, the engine starts complaining that it can't find a kubernetes plugin with that version.

This change overrides the generated getVersion() helper to point to a recent kubernetes release so that the engine can find the plugin even if the user adds a version to the package.json

@mjeffryes mjeffryes requested a review from a team December 13, 2023 14:43
tests/crds_test.go Outdated Show resolved Hide resolved
@@ -157,3 +158,14 @@ func appendFile(t *testing.T, filename, content string) {

_, err = f.WriteString(content)
}

func runRequireNoError(t *testing.T, cmd *exec.Cmd) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you could also use https://pkg.go.dev/os/exec#Cmd.CombinedOutput to do this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, I was looking for that, but didn't see it!

Copy link
Member

@rquitales rquitales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit, but otherwise LGTM.

@mjeffryes mjeffryes merged commit 53b4b4e into master Dec 18, 2023
2 checks passed
@mjeffryes mjeffryes deleted the mjeffryes/28-pin-k8s-version branch December 18, 2023 21:49
@pulumi-bot
Copy link

This PR has been shipped in release v1.4.0.

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

Successfully merging this pull request may close these issues.

Autogenerated CRD unnecessarily(?) requires kubernetes plugin on pulumi up
3 participants