Closed liornoy closed 1 year ago
To test this commit locally you can apply 2 different metallb subs:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: metallb-operator-sub1
namespace: default
spec:
name: metallb-operator
channel: alpha
source: metallb-operator
sourceNamespace: mymetallb
And:
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: metallb-operator-sub2
namespace: default
spec:
name: metallb-operator
channel: alpha
source: metallb-operator
sourceNamespace: mymetallb
And invoke: collection-scripts/gather_metallb
and expect to get: ERROR: found more than one metallb-operator subscription. Exiting.
LGTM
@soltysh can you please review; my only nit with this is that we seem to have code duplicated in ~4-5 files (it may be time to put it in a shared utility, to possibly make this simpler to maintain).
/test e2e-aws
@liornoy: all tests passed!
Full PR test history. Your PR dashboard.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: liornoy, soltysh
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Users that mistakenly misconfigure and create two instances (or more) of the subscription resource causes some gather scripts to fail.
For example, with 2 different sriov subscriptions, the SRIOV_NS will equal "openshift-sriov-network-operatoropenshift-sriov-network-operator" which is invalid.
Here we add "{{\n}}" and with that, check whether we found more than one subscription, and if so, exit with an error.
This fix is applied to all of the gather scripts that use this method: ingress_node_firewall, metallb, network_observability, nmstate and sriov