Skip to content

list network with labelselector not working in operator #232

@Abirdcfly

Description

@Abirdcfly

see https://github.com/bestchains/fabric-operator/pull/224/files#diff-aaf25efa7147cfaef6c204ac24887f2e23eab5eefe99850acad74c24b9e743f1R249-R293 for detail.

	n1 := &current.NetworkList{}
	_ = c.List(context.TODO(), n1)
	for i, u := range n1.Items {
		log.Info(fmt.Sprintf("full %d, name:%s, label:%s", i, u.Name, u.Labels))
	}

	selector := labels.SelectorFromSet(map[string]string{"bestchains.network.federation": "federation-sample"})
	n2 := &current.NetworkList{}
	_ = c.List(context.TODO(), n2, &client.ListOptions{LabelSelector: selector})

The phenomenon is that n1 does query a network, and the label contains bestchains.network.federation: federation-sample, but n2 does not query the result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglowLow Priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions