-
Notifications
You must be signed in to change notification settings - Fork 54
upgrade operator-sdk to v0.9.0 #88
upgrade operator-sdk to v0.9.0 #88
Conversation
@allamand CircleCI is still using v0.7.0 of operator-sdk, but I updated |
I think I need to rebuild image for circleCI with new version |
Is that something that I can do? |
It may be something like make docker-dev-ci or similar but you won’t have right to push it on the orange open source docker hub
But you should try it on your own repo to go further
Sébastien
Le 5 août 2019 à 21:33, John Sanda <notifications@github.com<mailto:notifications@github.com>> a écrit :
I think I need to rebuild image for circleCI with new version
Is that something that I can do?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#88>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ACEKVYZ5HJWO4JNZRIB7UTTQDB6BPANCNFSM4IJNXGWA>.
…_________________________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
|
I did the following before committing/pushing,
Unit tests passed. @allamand are you suggesting I do something else? |
I think to reproduce on local what is doing on circleCI you must use Make docker-build But first you need to build new image with new operator dsl version with Make build-ci-image |
@allamand I think I finally got it sorted out. Here is a summary of what I did to get past the initial errors based on your instructions:
I got past the initial errors after these changes, and unit tests are passing. I know that some of my changes, particularly those to the CircleCI config, may be temporary; however, would similar steps have to be performed when other dependences change? Can we please resume the CI build so that e2e tests are run? |
@jsanda in my first mind, I was thinking to use of go module with new version of sdk to avoid problem with vendor directory. Do you think it's better doing this in this PR or in another ? |
@jsanda there is an error while executing test:
Did you manage execute them locally (using |
@allamand I am fine with using the go module. Does that mean we introduce support for go modules in this PR? I will need to check to see how to do this. Not sure if it is as simple as something like With respect to the error, I did not run the |
not sure of the complexity to introduce go module if it's not too much we can try to include here, othewise will do it in another |
@allamand I spent a couple hours trying to get things working with module. I did not have much success. I kept running into different compilation errors. To be honest, I don't have a strong preference as to whether or not we try to introduce modules as part of this PR or as part of another. I would like to see the move to modules and I would like to see operator-sdk upgraded :) I am happy to help with the migration to modules but may need some help. Maybe we can sync up on slack? |
FYI, I opened an issue on the operator-sdk project asking for some help with migrating to modules since I haven't found any docs. |
@jsanda did you try starting it from scratch and see ? |
@cscetbon I did go through upgrading the example application in the operator-sdk docs. Initially I ran into the same problem. It turned out that I was missing a step. Running I still had problems here though even after running |
I just pushed a commit that finally gets Running The Dockerfile generated by v0.9.0 of operator-sdk is a good bit different from what we have. I may need some help with updating it. |
I made more progress with my last commit |
With commit I also still need to revert the image used in the CircleCI config. I changed it to use on from my GCR repo to get past some errors previously. |
@allamand I got unit tests passing. I have had the CirlcCI configured to use the image |
) | ||
|
||
replace ( | ||
k8s.io/api => k8s.io/api v0.0.0-20190222213804-5cb15d344471 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that one needed when you could just change it in the requires ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried doing that, but the replace
directive keeps getting added back. To be honest, I am not sure why as of yet. I have more focused on just getting things working and have not taken much time to investigate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsanda when everything is ready let's try to take a new stab at it ;)
@@ -216,9 +226,12 @@ func helperCreateCassandraCluster(t *testing.T, cassandraClusterFileName string) | |||
assert.Equal(cc.Status.Phase, api.ClusterPhaseRunning) | |||
|
|||
for _, dcRackName := range dcRackNames { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't really need a variable, just delete dcRackNames
and use cc.GetDCRackNames()
here.
APIVersion: "v1", | ||
}, | ||
} | ||
//Raw: &metav1.ListOptions{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why we don't need that code anymore ? And if it's not needed, let's remove it definitely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why we don't need that code anymore ?
It was fixed in kubernetes-sigs/controller-runtime#213. I am removing the commented out code.
@jsanda I just trigger tests to see how they doing |
I just pushed a couple commits to address comments and to fix the e2e tests. I changed @allamand can you restart tests again please? |
@allamand Can you run the e2e tests? I did some testing locally to make sure the docker build worked and one of the e2e tests. I need to test CircleCI now. |
@jsanda I just did |
@cscetbon Thanks. I just pushed another change to set |
@jsanda /tests |
With this commit I can finally get `operator-sdk generate k8s` to run successfully. I also removed dep references from Makefile. Building the docker image still needs some work.
The docker build was failing for me locally with the previous value.
1ed07fb
to
de1550c
Compare
@Orange-cscetbon done! |
t.Fatalf("reconcile: (%v)", err) | ||
//We recall Reconcile to update Next rack | ||
res, err = rcc.Reconcile(req) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do it in one line with if _, err = rcc.Reconcile(req); err != nil {
I also removed res
as it's not used
@cscetbon can you start the e2e tests again please? |
Thanks! Now we're just waiting on an |
docker push orangeopensource/casskop-build:v0.9.0
|
@allamand I have update the CircleCI configuration to use |
BUILD_IMAGE := orangeopensource/casskop-build | ||
#BUILD_IMAGE ?= orangeopensource/casskop-build | ||
# This is just for debugging on CircleCI | ||
BUILD_IMAGE ?= gcr.io/cassandra-k8s/casskop-build | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsanda Can you change also image in Makefile ?
@jsanda can you change in Makefile the WORKDIR
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @jsanda :)
I'll add in another PR caching for modules to accelerate the pipeline
* upgrade operator-sdk to v0.9.0 * removed old, commented out code * update OPERATOR_SDK_VERSION var * remove deps target as it no longer exists in v0.9.0 of operator-sdk * Need to run docker-get-deps before docker-build I am not sure if docker-get-deps should be a hard dependency for docker-build but definitely need to update deps right now prior to docker-build since we are upgrading a dependency. * try updated casskop-build image * remove docker-get-deps dependency * update image used by CircleCI * need to force update of vendor directory to update operator-sdk for compiling * previous CircleCI failure complained about missing file in vendir dir. * create a working go.mod file With this commit I can finally get `operator-sdk generate k8s` to run successfully. I also removed dep references from Makefile. Building the docker image still needs some work. * update Dockerfiles and CircleCI config * explicitly enable modules for docker build * move working dir out of $GOPATH/src to activate modules * move more working dirs outside of $GOPATH/src * fix failing tests * change WORKDIR so that go modules are enabled * updates from PR review, and running go mod tidy * try to get workdir values consistent * revert WORKDIR The docker build was failing for me locally with the previous value. * set GO111MODULE=on environment variable for docker targets * found another place modules need to be enabled and some code cleanup * use v0.9.0 orange image * revert BUILD_IMAGE * change WORKDIR
This PR is for #75.
I want to make a note of a breaking change.
metrics.CreateMetricsService(ctx, metricsPort)
was removed and replaced withmetrics.CreateMetricsService(ctx, cfg, servicePorts)
. See operator-framework/operator-sdk#1560 for details.