Peerless + New Argo
This commit is contained in:
@@ -68,6 +68,13 @@ func NewDataInstance(name string, peerID string) ResourceInstanceITF {
|
||||
}
|
||||
|
||||
func (ri *DataInstance) StoreDraftDefault() {
|
||||
// Enforce peerless invariant: a public-origin instance cannot have peer ownership.
|
||||
if ri.Origin.Ref != "" && (ri.CreatorID != "" || len(ri.Partnerships) > 0) {
|
||||
// Strip partnerships and creator: the structural invariant wins.
|
||||
// Origin.Ref presence is the authoritative signal that this is peerless.
|
||||
ri.CreatorID = ""
|
||||
ri.Partnerships = nil
|
||||
}
|
||||
found := false
|
||||
for _, p := range ri.ResourceInstance.Env {
|
||||
if p.Attr == "source" {
|
||||
|
||||
Reference in New Issue
Block a user