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

Issue 97: Update operator SDK dependency to 0.2.0 (full refactor) #98

Merged
merged 18 commits into from
Dec 5, 2018

Conversation

adrianmo
Copy link
Contributor

@adrianmo adrianmo commented Nov 22, 2018

Change log description

The Operator SDK project is moving fast and they have recently moved to a new 0.2.0 minor version that brings new features and completely refactors the operator framework. If we don't want to be left behind, we need to keep updating our operator SDK dependency, specially now that the project is still in an early stage and evolves fast.

Changes:

  • Update the operator SDK dependency from 0.0.5 to 0.2.0. Applied the official migration guide step by step to migrate the existing operator project to be compliant with the latest SDK.
  • Set up the operator testing framework as explained in the official documentation. There's no test case implementation yet, but the framework is ready to accept test cases.
  • Create new test-e2e make command that runs the end-to-end tests
  • Update Travis configuration to set up and deploy MiniKube as the testing Kubernetes backend.
  • The vast majority of the files updated in this PR belong to the vendor directory. Ignore those when reviewing the changes.

Purpose of the change

How to test the change

Checkout the repository (master branch is fine, no need to checkout this branch).

Edit the operator image used in the deploy/operator.yaml file to use the adrianmo/pravega-operator:issue-97-3 image, which contains the changes in this PR.

Follow the regular README file to install the operator and deploy the operator.

When you deploy the operator, check the logs to make sure you are using an operator based on the 0.2.0 SDK.

$ kubectl logs -f pravega-operator-574bbf8888-v6bht      
INFO[0000] pravega-operator Version: 0.1.2-15           
INFO[0000] Git SHA: 7897372                             
INFO[0000] Go Version: go1.11                           
INFO[0000] Go OS/Arch: linux/amd64                      
INFO[0000] operator-sdk Version: v0.2.0 <-----

When you deploy a Pravega cluster, make sure it creates all resources as usual.

$ kubectl get all -l pravega_cluster=pravega
NAME                                             READY     STATUS    RESTARTS   AGE                                                                            
pod/pravega-bookie-0                             1/1       Running   0          28m                                                                            
pod/pravega-bookie-1                             1/1       Running   0          28m                                                                            
pod/pravega-bookie-2                             1/1       Running   0          28m                                                                            
pod/pravega-pravega-controller-c9875fc6d-l7prt   1/1       Running   0          28m                                                                            
pod/pravega-segmentstore-0                       1/1       Running   1          28m                                                                            
pod/pravega-segmentstore-1                       1/1       Running   1          28m                                                                            
pod/pravega-segmentstore-2                       1/1       Running   1          28m                                                                            

NAME                                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)              AGE                                                        
service/pravega-bookie-headless      ClusterIP   None            <none>        3181/TCP             28m                                                        
service/pravega-pravega-controller   ClusterIP   10.71.254.167   <none>        10080/TCP,9090/TCP   28m                                                        

NAME                                               DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE                                                            
deployment.extensions/pravega-pravega-controller   1         1         1            1           28m                                                            

NAME                                                         DESIRED   CURRENT   READY     AGE                                                                 
replicaset.extensions/pravega-pravega-controller-c9875fc6d   1         1         1         28m                                                                 

NAME                                         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE                                                                  
deployment.apps/pravega-pravega-controller   1         1         1            1           28m                                                                  

NAME                                                   DESIRED   CURRENT   READY     AGE                                                                       
replicaset.apps/pravega-pravega-controller-c9875fc6d   1         1         1         28m                                                                       

NAME                                    DESIRED   CURRENT   AGE
statefulset.apps/pravega-bookie         3         3         28m
statefulset.apps/pravega-segmentstore   3         3         28m

@adrianmo adrianmo self-assigned this Nov 22, 2018
@adrianmo adrianmo changed the title Issue 97: Refactor to sync with operator-sdk v0.1.x Issue 97: Update operator SDK dependency to 0.1.1 (full refactor) Nov 22, 2018
fpj
fpj previously requested changes Nov 23, 2018
Copy link

@fpj fpj left a comment

Choose a reason for hiding this comment

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

I'd like to know whether we can do it in two steps:

  • Update the operator SDK without any changes to existing files in the repository or creating new files.
  • Change existing files and create new ones as needed.

Otherwise it is virtually impossible to review this PR.

@adrianmo
Copy link
Contributor Author

@fpj no, we can't do that. Updating the SDK dependency forces us to refactor our operator code.

I know it's very hard to review this PR... I would suggest to ignore changes in the vendor directory as it's only dependency updates.

@adrianmo
Copy link
Contributor Author

@adrianmo adrianmo changed the base branch from master to operator-sdk-0.1.1 November 29, 2018 10:16
@adrianmo
Copy link
Contributor Author

@fpj I have changed the target branch of this PR to get rid of all the changes coming from 6000+ files under the vendor directory. The new target branch operator-sdk-0.1.1 is a temporary branch that already contains those files. Currently, this PR only contains the refactoring changes to update the operator to the newest SDK.

Once this PR is merged, I'll submit a new PR to merge operator-sdk-0.1.1 into master, which will not require any further reviews.

@fpj fpj dismissed their stale review November 29, 2018 11:16

PR has been rebased, needs another review from scratch.

Ignore YAML files in the project root directory

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Update vendor directory

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Refactor operator to be in sync with the operator-sdk framework v0.1.1

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Fix ability to run operator locally

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Fix rebase issues

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
* operator-sdk-0.1.1:
  Update vendor dependencies
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
@adrianmo
Copy link
Contributor Author

Ready for review.

@adrianmo adrianmo changed the title Issue 97: Update operator SDK dependency to 0.1.1 (full refactor) [WiP] Issue 97: Update operator SDK dependency to 0.1.1 (full refactor) Dec 1, 2018
@adrianmo
Copy link
Contributor Author

adrianmo commented Dec 1, 2018

This PR is already outdated as a new release of the Operator SDK has come out: https://github.com/operator-framework/operator-sdk/releases/tag/v0.2.0

I'll investigate what the changes are and update our operator again.

@adrianmo adrianmo added the status/blocked Issue or PR is blocked on another item; add reference in a comment label Dec 1, 2018
@adrianmo adrianmo changed the title [WiP] Issue 97: Update operator SDK dependency to 0.1.1 (full refactor) Issue 97: Update operator SDK dependency to 0.1.1 (full refactor) Dec 1, 2018
@adrianmo adrianmo added status/work-in-progress PR work is in progress; do not merge and removed status/blocked Issue or PR is blocked on another item; add reference in a comment labels Dec 1, 2018
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
* operator-sdk-0.1.1:
  Update Gopkg files
  Update vendor dir
@adrianmo adrianmo changed the title Issue 97: Update operator SDK dependency to 0.1.1 (full refactor) Issue 97: Update operator SDK dependency to 0.2.0 (full refactor) Dec 3, 2018
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
Install minikube on Travis

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Use local bootstrap instead of systemd

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Use Kubernetes 1.9

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Use MiniKube v0.28.2

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Update Minikube config

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Update Minikube config

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Update Minikube config

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Update Minikube config

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Update Minikube config

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Update Minikube config

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>

Update travis config

Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
@adrianmo
Copy link
Contributor Author

adrianmo commented Dec 3, 2018

PR is ready for reviewing.

/cc @fpj @shrids @Tristan1900

@adrianmo adrianmo added status/ready The issue is ready to be worked on; or the PR is ready to review and removed status/work-in-progress PR work is in progress; do not merge labels Dec 3, 2018
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
@Tristan1900
Copy link
Member

I test this branch manually and through testing framework. It works well.

build/Dockerfile Show resolved Hide resolved
pkg/apis/pravega/v1alpha1/register.go Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
vendor/cloud.google.com/go/bigtable/cmd/cbt/cbtdoc.go Outdated Show resolved Hide resolved
vendor/github.com/mattbaird/jsonpatch/LICENSE Outdated Show resolved Hide resolved
vendor/golang.org/x/tools/refactor/eg/eg.go Outdated Show resolved Hide resolved
vendor/golang.org/x/tools/third_party/typescript/LICENSE Outdated Show resolved Hide resolved
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
* operator-sdk-0.1.1:
  Update project dependencies
Signed-off-by: Adrian Moreno <adrian@morenomartinez.com>
@adrianmo
Copy link
Contributor Author

adrianmo commented Dec 5, 2018

@fpj thanks for the review. I've addressed all your comments and fixed the conflicting vendor files.

@fpj fpj merged commit c7a776c into operator-sdk-0.1.1 Dec 5, 2018
@adrianmo adrianmo deleted the issue-97-update-operator-sdk branch January 25, 2019 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/ready The issue is ready to be worked on; or the PR is ready to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants