Skip to content

csi: add ${CLUSTER_ID} to placeholders#909

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
bertinatto:clusterid
Oct 6, 2020
Merged

csi: add ${CLUSTER_ID} to placeholders#909
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
bertinatto:clusterid

Conversation

@bertinatto
Copy link
Copy Markdown
Member

@bertinatto bertinatto commented Sep 30, 2020

Some CSI Drivers need to be given a cluster ID so that they can tag volumes and snapshots they create.

This is done so that the installer can filter those resources out and delete them on cluster deletion.

CC @openshift/storage

@jsafrane
Copy link
Copy Markdown
Contributor

jsafrane commented Oct 1, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 1, 2020
@bertinatto
Copy link
Copy Markdown
Member Author

/assign @deads2k @sttts

operatorClient.Informer(),
deployInformer.Informer(),
}
if c.configInformers != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should this ever be nil? Feels like unneeded complexity.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some CSI drivers (operands) don't have the option to pass in a cluster ID, so their operators will let this to be nil

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the docstring above tries to explain that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call it optionalConfigInformer. The current pattern is a recipe to null pointer exceptions the next time somebody modifies this code and is not aware of this invariant.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to optionalConfigInformer

if err != nil {
return err
}
if infra.Status.PlatformStatus != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is correct? InfraName depends on another field? This at least needs a comment here. Looks like a bug now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, we've seen this on baremetal. Added a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not answer my question when reading this code. Why does PlatformStatus != nil influence why we care about cluster id?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I fat-fingered this.

Now that I look at it, this check doesn't make sense. I can just use .Status.InfrastructureName directly.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2020
@bertinatto bertinatto force-pushed the clusterid branch 2 times, most recently from abd7534 to 025fe33 Compare October 6, 2020 10:56
file string,
kubeClient kubernetes.Interface,
namespacedInformerFactory informers.SharedInformerFactory,
configInformers configinformers.SharedInformerFactory,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is optional too?

Some CSI Drivers need to be given a cluster ID
so that they can tag volumes and snapshots they create.
This is done so that the installer can filter those
resources out and delete them on cluster deletion.
@sttts
Copy link
Copy Markdown
Contributor

sttts commented Oct 6, 2020

/approve
lgtm.

@jsafrane please take a final look.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 6, 2020
@jsafrane
Copy link
Copy Markdown
Contributor

jsafrane commented Oct 6, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2020
@openshift-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bertinatto, jsafrane, sttts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants