Add ipv4 to the late-initialize ignored fields#52
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the configuration to ignore the IPv4 field during late initialization, preventing user-provided IPv4 values from being persisted in the instance’s configuration. It also adjusts debugging instructions in the developer documentation.
- Updated developer documentation with new commands to set up and debug the provider.
- Modified the late initializer in config/instance/config.go by adding "ipv4" to the ignored fields.
- Updated the late initializer in apis/instance/v1alpha1/zz_instance_terraformed.go to include a name filter for "IPv4".
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/developer.md | Revised debug commands for local deployment and provider debugging. |
| config/instance/config.go | Added "ipv4" to the list of late initializer ignored fields. |
| apis/instance/v1alpha1/zz_instance_terraformed.go | Added name filter "IPv4" to support late initialization and ignore field values. |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
apis/instance/v1alpha1/zz_instance_terraformed.go:123
- The case used for 'IPv4' in the name filter is inconsistent with the 'ipv4' string in the ignored fields list in config.go. Consider unifying the case to prevent potential mismatches.
opts = append(opts, resource.WithNameFilter("IPv4"))
sammysclub
approved these changes
Apr 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
The linode API is now surfacing ALL ips on the linode, including ones that are added out of band. The instance's
forProviderconfiguration shouldn't save the IPs, they are automatically assigned by linode. Adding it to theignoredFieldsof late-initalizer fixes this problem. Also go back to upstream terraform libraryI have:
make reviewable testto ensure this PR is ready for review.How has this code been tested
1.
make local-deploy2. Create a linode secret & provider config
atProvider.ipv4shows 2 ips andforProviderdoesn't have any[contribution process]: https://git.io/fj2m9