Skip to content

Conversation

@Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Jan 17, 2020

This PR allows to use RWO PVC backend for OpenStack if Swift service is not available.

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 17, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 17, 2020

/test e2e-openstack

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 20, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 20, 2020

/test e2e-openstack

1 similar comment
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 20, 2020

/test e2e-openstack

@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 20, 2020

/retest

Copy link
Contributor

@dmage dmage left a comment

Choose a reason for hiding this comment

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

Is it possible to write a test this change?

claim, err := c.clients.Core.PersistentVolumeClaims(defaults.ImageRegistryOperatorNamespace).Get(claimName, metav1.GetOptions{})
if err == nil {
if !pvc.PVCIsCreatedByOperator(claim) {
err = fmt.Errorf("could not create this PVC, it already exists and is not owned by the operator")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, removed it

PVCOwnerAnnotation = "imageregistry.openshift.io"

// PVCImageRegistryName is the defailt name of the claim provisioned for PVC backend
PVCImageRegistryName = defaults.ImageRegistryName + "-storage"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move this constant to defaults. And in that package it's better to have something like PVCImageRegistryName = "image-registry-storage" to make it greppable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense! done

pvcOwnerAnnotation = "imageregistry.openshift.io"
PVCOwnerAnnotation = "imageregistry.openshift.io"

// PVCImageRegistryName is the defailt name of the claim provisioned for PVC backend
Copy link
Contributor

Choose a reason for hiding this comment

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

-defailt
+default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done :)

This patch adds a function that checks if Swift service is enabled.
To do so it reuses the existing getSwiftClient function, that has this
check.
This commit allows to use RWO PVC backend for OpenStack if Swift is
not available.
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 21, 2020

@dmage I added a unit test to check that the ErrEndpointNotFound error is returned if there is no Swift service. It's hard to check more, because we need to upgrade our CI for this, and create e2e-openstack-operator job.
Meanwhile I use #433 to explicitly disable Swift and verify this change on RWO PVC

@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 21, 2020

/test e2e-openstack

@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 21, 2020

/retest

@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 21, 2020

/test e2e-aws-upgrade

1 similar comment
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 21, 2020

/test e2e-aws-upgrade

@dmage
Copy link
Contributor

dmage commented Jan 21, 2020

/lgtm
/hold

Holding until we solve problems with upgrades

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dmage, Fedosin

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 21, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 21, 2020

/test e2e-aws-upgrade

1 similar comment
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 21, 2020

/test e2e-aws-upgrade

@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 21, 2020

e2e-aws-upgrade is green!

@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 21, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2020
@openshift-merge-robot openshift-merge-robot merged commit 228e5e3 into openshift:master Jan 21, 2020
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants