Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

chore: support deploying to Openshift and add gitlab pipeline #121

Merged
merged 4 commits into from
Jul 1, 2021

Conversation

ciarams87
Copy link
Member

@ciarams87 ciarams87 commented Jun 16, 2021

Proposed changes

Add changes to support deploying to Openshift, including new Makefile targets and a RedHat specific Dockerfile. The openshift-deploy Make target requires yq to be installed (see https://github.com/mikefarah/yq). This PR also addresses CVE-2020-29652 and adds a gitlab pipeline for testing.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch from my own fork

@ciarams87 ciarams87 added the chore Pull requests for routine tasks label Jun 16, 2021
@ciarams87 ciarams87 changed the title Add gitlab pipeline draft: Add gitlab pipeline Jun 16, 2021
@ciarams87 ciarams87 force-pushed the chore/gitlab-pipeline branch from 6319279 to 1137a7f Compare June 16, 2021 23:12
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jun 21, 2021
@ciarams87 ciarams87 force-pushed the chore/gitlab-pipeline branch from a82049f to 98d7f8f Compare June 21, 2021 12:36
@ciarams87 ciarams87 changed the title draft: Add gitlab pipeline chore: support deploying to Openshift and add gitlab pipeline Jun 29, 2021
@@ -117,6 +121,11 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -

openshift-deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
VAL="${RH_RBAC_IMAGE}" yq e '.spec.template.spec.containers[0].image = strenv(VAL)' -i config/default/manager_auth_proxy_patch.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Is yq supposed to be jq? If so are we assuming it's installed by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think yq is to yaml as jq is to json

Copy link
Member Author

@ciarams87 ciarams87 Jun 30, 2021

Choose a reason for hiding this comment

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

Yes, yq is to yaml what jq is to json, exactly. I call out its requirement in the description of this PR: The openshift-deploy Make target requires yq to be installed (see https://github.com/mikefarah/yq). - I'll update the docs when the time comes but we have a separate task for that - also, it is expected that most people will still install the operator through the catalog and this Make target is probably going to be for development only, so I don't think it's unreasonable to add another dependency.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I had the page open before you updated the description, so I didn't see it. Sounds good.


FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
WORKDIR /
COPY --from=builder --chown=65532:65532 /workspace/manager .
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to remove chown? 65532 is not in UBI.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, thanks Luca

@@ -117,6 +121,11 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -

openshift-deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
VAL="${RH_RBAC_IMAGE}" yq e '.spec.template.spec.containers[0].image = strenv(VAL)' -i config/default/manager_auth_proxy_patch.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

I think yq is to yaml as jq is to json

@ciarams87 ciarams87 force-pushed the chore/gitlab-pipeline branch from c08e6f4 to 0b8e75b Compare June 30, 2021 13:18
@ciarams87 ciarams87 merged commit f7924cb into master Jul 1, 2021
@ciarams87 ciarams87 deleted the chore/gitlab-pipeline branch July 1, 2021 08:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
chore Pull requests for routine tasks dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants