-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconcile feature flag extensions #3987
Reconcile feature flag extensions #3987
Conversation
@spadgett Adding SelfSubjectAccessReview feature flag extension would be the next follow-up step, which would allow us to address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/hold |
/hold cancel |
.filter((e) => e.properties.required || e.properties.disallowed) | ||
.reduce( | ||
(requiredFlags, e) => _.uniq([...requiredFlags, ..._.castArray(e.properties.required)]), | ||
(gatingFlags, e) => | ||
_.uniq([ | ||
...gatingFlags, | ||
..._.castArray(e.properties.required), | ||
..._.castArray(e.properties.disallowed), | ||
]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.reduce( (gatingFlags, ext) => ext.properties.required || ext.properties.disallowed ?
_.uniq(....)
: gatingFlags)
maybe only use reduce?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can put the filter
logic inside the reduce
handler.
model: K8sKind; | ||
} | ||
|
||
export interface ActionFeatureFlag extends FeatureFlag { | ||
/** Function used to detect the feature and set flag name/value via Redux action dispatch. */ | ||
detect: (dispatch: Dispatch) => Promise<any>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some plugins might need to support k8sWatch which does not return a promise.
detect: (dispatch: Dispatch) => Promise<any>; | |
detect: (dispatch: Dispatch) => Promise<any> | void; |
@bipuladh @cloudbehl Regarding Bipul's #3987 (comment) - I've discussed it with @rawagner, using On a vanilla k8s cluster or a cluster without OCS capability, CRD for Detection of various platforms (OpenShift, Baremetal, etc.) typically uses However, in case of OCS "independent" flag, driven by a specific k8sWatch(OCSServiceModel, { ns: 'openshift-storage', name: 'ocs-storagecluster' }) I can see two solutions here:
|
b7e566c
to
13cd837
Compare
Rebased and addressed #3987 (comment) |
13cd837
to
84da6fa
Compare
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alecmerdler, bipuladh, rawagner, vojtechszocs The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/hold |
/hold cancel |
This PR aligns
ModelFeatureFlag
andActionFeatureFlag
extensions and their usage.By design, every instance of ^^ represents a plugin's intent to add new Console feature flag.
To validate this invariant, the corresponding extension test (
features.spec.ts
) is updated to check for duplicate flag declarations.@alecmerdler @jeff-phillips-18 I've made two major changes in the OLM plugin:
Flags
enumsince they are already declared in Console
FLAGS
enum.CAN_LIST_PACKAGE_MANIFEST
flag extensionsince it basically overrides the base SSAR check in
public/actions/features.ts
@bipuladh @rawagner
ExtensionRegistry
is modified to support thedisallowed
property. Dashboard related extensions should now support bothdisallowed
andrequired
.Unknown flag check in
public/reducers/features.ts
is updated to take plugin contributed flags into account.cc @spadgett @christianvogt