-
Notifications
You must be signed in to change notification settings - Fork 21
Implement incus image alias nested block #250
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
base: main
Are you sure you want to change the base?
Conversation
d8aaeb1
to
6015eeb
Compare
6015eeb
to
1811a53
Compare
@SpiffyEight77 how's this one going? |
Hi @stgraber ! |
56c6a7f
to
c6aa483
Compare
96adaf6
to
1fba806
Compare
Signed-off-by: Ruihua Wen <[email protected]>
Signed-off-by: Ruihua Wen <[email protected]>
1fba806
to
e8c0967
Compare
Signed-off-by: Ruihua Wen <[email protected]>
e8c0967
to
9eb4e1a
Compare
@maveonair want to review this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SpiffyEight77 very well done! Please have a look at my comments.
@@ -42,6 +42,7 @@ type ImageModel struct { | |||
SourceImage types.Object `tfsdk:"source_image"` | |||
SourceInstance types.Object `tfsdk:"source_instance"` | |||
Aliases types.Set `tfsdk:"aliases"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new syntax, we probably should introduce a breaking change and remove aliases
as we now have the alias
blocks. @stgraber what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, agreed, we don't want the redundancy
@@ -583,6 +670,26 @@ func (r ImageResource) createImageFromSourceFile(ctx context.Context, resp *reso | |||
|
|||
imageAliases = append(imageAliases, ia) | |||
} | |||
|
|||
for _, aliasModel := range aliasModels { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the same code block in both createImageFromSourceImage
and createImageFromSourceInstance
. Could you extract this into a function that can be used in all other places?
Thanks @maveonair and @stgraber for confirming! I'll refactor to remove the aliases later this week. |
Description
This pull request implements the
incus_image_alias
resource.close #221
Example
Terraform Configuration