mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 03:56:36 +00:00
Fix(webhook): only check the uniqueness of component names under the same namespace (#2222)
This commit is contained in:
@@ -224,7 +224,11 @@ func (p *Parser) parseTrait(ctx context.Context, name string, properties map[str
|
||||
func (p *Parser) ValidateComponentNames(ctx context.Context, af *Appfile) (int, error) {
|
||||
existCompNames := make(map[string]string)
|
||||
existApps := v1beta1.ApplicationList{}
|
||||
if err := p.client.List(ctx, &existApps); err != nil {
|
||||
|
||||
listOpts := []client.ListOption{
|
||||
client.InNamespace(af.Namespace),
|
||||
}
|
||||
if err := p.client.List(ctx, &existApps, listOpts...); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
for _, existApp := range existApps.Items {
|
||||
|
||||
Reference in New Issue
Block a user