Skip to content

Commit

Permalink
Merge pull request #183 from xoanmi/master
Browse files Browse the repository at this point in the history
Add `Deletion` parameter on create replication policy
  • Loading branch information
elenz97 authored Nov 29, 2023
2 parents bf1598d + ec37217 commit 1bd1aeb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apiv2/pkg/clients/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ func (c *RESTClient) GetRegistryByName(ctx context.Context, name string) (*model
}

switch nregistries := len(registries); {
case nregistries > 1:
return nil, &errors.ErrMultipleResults{}
case nregistries == 0:
return nil, &errors.ErrRegistryNotFound{}
case nregistries > 1:
return nil, &errors.ErrMultipleResults{}
case nregistries == 0:
return nil, &errors.ErrRegistryNotFound{}
}
return registries[0], nil
}
Expand Down
1 change: 1 addition & 0 deletions apiv2/pkg/clients/replication/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (c *RESTClient) NewReplicationPolicy(ctx context.Context, destRegistry, src
Name: name,
Override: override,
ReplicateDeletion: replicateDeletion,
Deletion: replicateDeletion,
SrcRegistry: srcRegistry,
Trigger: trigger,
},
Expand Down
1 change: 1 addition & 0 deletions apiv2/pkg/clients/replication/replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var (
destNamespace = ns
replication = &modelv2.ReplicationPolicy{
ReplicateDeletion: replicateDeletion,
Deletion: replicateDeletion,
Description: description,
DestNamespace: destNamespace,
DestRegistry: destRegistry,
Expand Down

0 comments on commit 1bd1aeb

Please sign in to comment.