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

feat: Multiple postinstall symlinks pointing to the same thing #495

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pmengelbert
Copy link
Contributor

What this PR does / why we need it:
Currently, you can't create multiple symlink newpaths that point to the same oldpath. This is due to the fact that map keys have to be unique.

For more information, see #489

This should be merged before #494

Allow for multiple links to point to the same target.

Signed-off-by: Peter Engelbert <[email protected]>
@pmengelbert pmengelbert requested a review from a team as a code owner January 9, 2025 22:40
@@ -130,7 +130,8 @@ type PostInstall struct {
// SymlinkTarget specifies the properties of a symlink
type SymlinkTarget struct {
// Path is the path where the symlink should be placed
Path string `yaml:"path" json:"path" jsonschema:"required"`
Path string `yaml:"path" json:"path" jsonschema:"oneof_required=path"`
Copy link
Member

@cpuguy83 cpuguy83 Jan 10, 2025

Choose a reason for hiding this comment

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

We should mark this is deprecated and have people use paths instead.
We can also make it so when we load the spec we migrate Path to Paths then there's only one field to deal with.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do we mark it as deprecated?

@@ -42,6 +42,12 @@ func (t *Target) validate() error {
}
}

if t.Image != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a validate to t.Image, which itself could return nil if *Image is nil (note: this is what I did in #492

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.

2 participants