Skip to content
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

MGDAPI - 4544 Postgres Create #576

Merged

Conversation

Fiona-Waters
Copy link
Collaborator

Overview

MGDAPI-4544
Adding functionality to create a Postgres instance in GCP.

Verification

  • Provision a GCP cluster

    • From the master branch of the Delorean repo create a file in the root of the repo called gcp_service_account.json. Request GCP credentials and add these to this file.
    • Run make -f make/ocm.mk ocm/cluster.json BYOC=true CLOUD_PROVIDER=gcp
    • Edit the cluster.json file to update the name (and remove the expiration timestamp if necessary) You can also reduce the number of nodes to 3.
    • Run make ocm/cluster/create
  • Create a Postgres Instance

    • In CRO checkout this PR
    • Log in to your cluster and run make cluster/prepare
    • Create a Postgres CR PROVIDER=gcp make cluster/seed/postgres
    • Run CRO make run
    • On the command line view the current list of instances gcloud sql instances list gcloud sql instances list
    • Alternatively you can view your instance on the GCP console.
  • Delete the Postgres CR and GCP Postgres instance.
    oc delete postgres example-postgres -n cloud-resource-operator

@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Merging #576 (ccc7c2d) into mgdapi-3425-gcp (203a8ab) will increase coverage by 0.41%.
The diff coverage is 76.31%.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##           mgdapi-3425-gcp     #576      +/-   ##
===================================================
+ Coverage            70.47%   70.89%   +0.41%     
===================================================
  Files                   46       46              
  Lines                 6012     6157     +145     
===================================================
+ Hits                  4237     4365     +128     
- Misses                1405     1414       +9     
- Partials               370      378       +8     
Impacted Files Coverage Δ
pkg/providers/gcp/provider_postgres.go 72.38% <76.31%> (+13.55%) ⬆️

… more test cases to unit tests.

>
Co-authored-by Laura Fitzgerald lfitzger@redhat.com
Co-authored-by Fiona Waters fwaters@redhat.com
pkg/providers/gcp/gcpiface/gcp_client_interface.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres.go Outdated Show resolved Hide resolved
pkg/providers/gcp/provider_postgres_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cecobask cecobask left a comment

Choose a reason for hiding this comment

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

Successfully created a Postgres instance using the provided instructions.
I'm satisfied with the work done and I could connect to the Postgres instance using Cloud SQL Auth proxy and data from the Postgres secret:
image
image

/lgtm

@MStokluska
Copy link
Member

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cecobask, MStokluska

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 15f86a1 into integr8ly:mgdapi-3425-gcp Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants