-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: main
Are you sure you want to change the base?
feat: Multiple postinstall symlinks pointing to the same thing #495
Conversation
Allow for multiple links to point to the same target. Signed-off-by: Peter Engelbert <[email protected]>
Signed-off-by: Peter Engelbert <[email protected]>
@@ -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"` |
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 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.
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.
How do we mark it as deprecated?
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.
@@ -42,6 +42,12 @@ func (t *Target) validate() error { | |||
} | |||
} | |||
|
|||
if t.Image != nil { |
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.
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
What this PR does / why we need it:
Currently, you can't create multiple symlink
newpath
s that point to the sameoldpath
. This is due to the fact that map keys have to be unique.For more information, see #489
This should be merged before #494