check the olm --version#23714
Conversation
| e2e.Logf("olm version is:%s", string(gitCommitID)) | ||
|
|
||
| g.By("get all commits from the operator-lifecycle-manager repo") | ||
| commitIDs, err := exec.Command("curl", "-k", "https://github.com/operator-framework/operator-lifecycle-manager/commits/master").CombinedOutput() |
There was a problem hiding this comment.
Can we find a better way to query github to find out if a commit sha exists?
This will fail if the ocp build happens to include a version of OLM that is not on the "first page" of results here.
There was a problem hiding this comment.
@ecordell Yes, this isn't a good solution. Do you have any suggestions? Thanks!
There was a problem hiding this comment.
One idea is you can directly query whether the sha returned from olm exists -
https://github.com/operator-framework/operator-lifecycle-manager/commit/f690ccdf1170c1488ee36f375555512119d1b130
You can also look into using a github client library like https://github.com/google/go-github
| g.By("get olm version from the catalog-operator pod") | ||
| oc.SetNamespace("openshift-operator-lifecycle-manager") | ||
| commands := []string{"exec", catalogPodName, "--", "olm", "--version"} | ||
| olmVersion, err := oc.AsAdmin().Run(commands...).Args().OutputToFile("version.json") |
There was a problem hiding this comment.
nit: why version.json? The contents aren't json, right?
There was a problem hiding this comment.
Yes, I just want to save it to a file. Maybe I should use the YAML, thanks!
| g.By("get all commits from the operator-lifecycle-manager repo") | ||
| commitIDs, err := exec.Command("curl", "-k", "https://github.com/operator-framework/operator-lifecycle-manager/commits/master").CombinedOutput() | ||
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
| o.Expect(string(commitIDs)).To(o.ContainSubstring(string(gitCommitID))) |
There was a problem hiding this comment.
olm outputs the full commit sha, not the short. Can we assert on the length to ensure it's the full commit id?
There was a problem hiding this comment.
Thanks! It would be better. Do you have any ideas?
There was a problem hiding this comment.
we can check for the length, it should be 40-character long
len(gitCommitID) == 40
``
There was a problem hiding this comment.
Ok, thanks! Done.
| g.It("olm version should contain the source commit id", func() { | ||
| catalogPodName, err := oc.AsAdmin().Run("get").Args("-n", "openshift-operator-lifecycle-manager", "pods", "-l", "app=catalog-operator", "-o=jsonpath={.items[0].metadata.name}").Output() | ||
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
| e2e.Logf("catalog-operator pod name:%s", catalogPodName) |
There was a problem hiding this comment.
I believe we should check version of the olm operator as well. Does the package-server output version as well?
Also, we want to verify that all three components report the same version and commit sha? ( I am assuming that we are cutting a build for all three components at the same point in time )
There was a problem hiding this comment.
I believe we should check version of the olm operator as well.
I think we should.
Does the package-server output version as well?
No, it does not.
Also, we want to verify that all three components report the same version and commit sha?
I think we should.
( I am assuming that we are cutting a build for all three components at the same point in time )
We are.
There was a problem hiding this comment.
Thanks! I will add the olm operator checking.
|
/retest |
1 similar comment
|
/retest |
|
@ecordell @njhale @bparees I'm not sure why always failed to verify. It does pass in my local env. Could you help have a look? Thanks! mac:origin jianzhang$ ./hack/verify-gofmt.sh
[INFO] hack/verify-gofmt.sh exited with code 0 after 00h 00m 01s
mac:origin jianzhang$ ./hack/verify-govet.sh
[INFO] hack/verify-govet.sh exited with code 0 after 00h 05m 51s
mac:origin jianzhang$ make build
hack/build-go.sh
++ Building go targets for darwin/amd64: vendor/github.com/openshift/oc/cmd/oc vendor/k8s.io/kubernetes/cmd/hyperkube
# github.com/openshift/origin/vendor/k8s.io/kubernetes/cmd/hyperkube
ld: warning: building for macOS, but linking in object file (/var/folders/2c/4whhm34n7892mf9l2j02cf480000gn/T/go-link-024057095/go.o) built for
[INFO] hack/build-go.sh exited with code 0 after 00h 03m 39s
mac:origin jianzhang$ git branch
downstream-olm
master
* ocp-20981
ocp-22070
|
|
Take a look at the prow image build job logs:
It looks like you added a new import, |
|
@njhale Do you know how to solve this error? mac:origin jianzhang$ make update-deps
hack/update-deps.sh
...
[INFO] --> Fetching updates for k8s.io/kubernetes
[ERROR] Update failed for k8s.io/kubernetes: Unable to retrieve checked out version: exit status 128 |
|
@njhale It works and I remove this folder mac:openshift-tests jianzhang$ go build
../../test/extended/util/ldap.go:15:2: code in directory /Users/jianzhang/goproject/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/wait expects import "k8s.io/apimachinery/pkg/util/wait"
mac:openshift-tests jianzhang$ pwd
/Users/jianzhang/goproject/src/github.com/openshift/origin/cmd/openshift-tests |
|
I'm not sure why the package: |
beba3ce to
e4be46d
Compare
|
@njhale After mac:openshift-tests jianzhang$ go build
# github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory
../../vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go:134:37: undefined: grpc.WithContextDialerI guess the version of the mac:origin jianzhang$ go version
go version go1.13.1 darwin/amd64
```console
mac:origin jianzhang$ cat glide.lock
...
- name: google.golang.org/grpc
version: 168a6198bcb0ef175f7dacec0b8691fc141dc9b8
subpackages:
- balancer
- balancer/base
- balancer/roundrobin
- codes
- connectivity
- credentials |
|
And then, I tried to update this mac:origin jianzhang$ glide --debug get google.golang.org/grpc#v1.24.0
[DEBUG] No mirrors.yaml file exists
[INFO] Preparing to install 1 package.
[INFO] Attempting to get package google.golang.org/grpc
...
[DEBUG] Unlocking https-github.com-openshift-apiserver-library-go
[DEBUG] Unlocking https-github.com-openshift-kubernetes.git
[WARN] Download failed.
[ERROR] Update failed for google.golang.org/grpc: Unable to update repository: exit status 1
[DEBUG] Output was: There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> v1.24.0[DEBUG] Unlocking https-google.golang.org-grpc
[ERROR] Failed to checkout packages: Unable to update repository: exit status 1
[DEBUG] Output was: There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> v1.24.0mac:origin jianzhang$ |
|
I have fixed the above issue by removing the glide cache: mac:openshift-tests jianzhang$ rm -rf ~/.glide/cache/src/https-google.golang.org-grpc/But, I got other errors: mac:openshift-tests jianzhang$ go build
# github.com/openshift/origin/vendor/k8s.io/kubernetes/test/e2e
../../vendor/k8s.io/kubernetes/test/e2e/patch_from_e2e_testfile.go:17:2: undefined: framework.HandleFlags
../../vendor/k8s.io/kubernetes/test/e2e/patch_from_e2e_testfile.go:18:37: not enough arguments in call to viperconfig.ViperizeFlags
have (string, string)
want (string, string, *flag.FlagSet)@njhale What are the right steps to update the dependence libs? I just have one new import |
e4be46d to
8851e17
Compare
| "fmt" | ||
|
|
||
| "context" | ||
| "github.com/google/go-github/github" |
There was a problem hiding this comment.
@bparees I import a new package here, do you know how to just update its vendor? I used the make update-deps command before, but it updated all vendor versions. It causes many package dependency issues.
There was a problem hiding this comment.
not possible as far as i know.
updating vendor versions of things should not break things, if it does then our deps are not properly pinned.
|
@bparees I just update the vendors by running |
|
i've rebuilt your PR here: steps i followed:
it appears to compile locally. I suggest your get the olm team to just lgtm my PR. |
|
@bparees I truly appreciate your help. I asked the OLM team to help to review it. |
mac:openshift-tests jianzhang$ oc get clusterversion
NAME VERSION AVAILABLE PROGRESSING SINCE STATUS
version 4.3.0-0.nightly-2019-11-29-051144 True False 130m Cluster version is 4.3.0-0.nightly-2019-11-29-051144
mac:openshift-tests jianzhang$ ./openshift-tests run all --dry-run | grep "\[Feature:Platform\] OLM should" | ./openshift-tests run --junit-dir=./ -f -
Dec 2 16:51:09.940: INFO: >>> kubeConfig: /Users/jianzhang/43-kubeconfig
Dec 2 16:51:09.943: INFO: >>> kubeConfig: /Users/jianzhang/43-kubeconfig
started: (0/1/7) "[Feature:Platform] OLM should olm version should contain the source commit id [Suite:openshift/conformance/parallel]"
started: (0/2/7) "[Feature:Platform] OLM should be installed with clusterserviceversions at version v1alpha1 [Suite:openshift/conformance/parallel]"
started: (0/3/7) "[Feature:Platform] OLM should be installed with catalogsources at version v1alpha1 [Suite:openshift/conformance/parallel]"
started: (0/4/7) "[Feature:Platform] OLM should be installed with packagemanifests at version v1 [Suite:openshift/conformance/parallel]"
started: (0/5/7) "[Feature:Platform] OLM should be installed with operatorgroups at version v1 [Suite:openshift/conformance/parallel]"
started: (0/6/7) "[Feature:Platform] OLM should be installed with subscriptions at version v1alpha1 [Suite:openshift/conformance/parallel]"
started: (0/7/7) "[Feature:Platform] OLM should be installed with installplans at version v1alpha1 [Suite:openshift/conformance/parallel]"
passed: (26.3s) 2019-12-02T08:51:44 "[Feature:Platform] OLM should be installed with operatorgroups at version v1 [Suite:openshift/conformance/parallel]"
passed: (26.3s) 2019-12-02T08:51:44 "[Feature:Platform] OLM should be installed with catalogsources at version v1alpha1 [Suite:openshift/conformance/parallel]"
passed: (26.3s) 2019-12-02T08:51:44 "[Feature:Platform] OLM should be installed with installplans at version v1alpha1 [Suite:openshift/conformance/parallel]"
passed: (26.3s) 2019-12-02T08:51:44 "[Feature:Platform] OLM should be installed with packagemanifests at version v1 [Suite:openshift/conformance/parallel]"
passed: (26.7s) 2019-12-02T08:51:44 "[Feature:Platform] OLM should be installed with clusterserviceversions at version v1alpha1 [Suite:openshift/conformance/parallel]"
passed: (27s) 2019-12-02T08:51:45 "[Feature:Platform] OLM should be installed with subscriptions at version v1alpha1 [Suite:openshift/conformance/parallel]"
passed: (43.3s) 2019-12-02T08:52:01 "[Feature:Platform] OLM should olm version should contain the source commit id [Suite:openshift/conformance/parallel]"
Writing JUnit report to junit_e2e_20191202-085201.xml
7 pass, 0 skip (43.3s) |
88fd1e1 to
6d270d0
Compare
|
Run the |
|
/retest |
1 similar comment
|
/retest |
7862ae8 to
6d270d0
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jianzhangbjz The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
6d270d0 to
587d941
Compare
587d941 to
75f5b77
Compare
|
Logs in my local env: mac:openshift-tests jianzhang$ ./openshift-tests run all --dry-run |grep "\[Serial\] olm version"|./openshift-tests run --junit-dir ./ -f -
I0110 12:21:54.796157 96616 test_context.go:419] Tolerating taints "node-role.kubernetes.io/master" when considering if nodes are ready
I0110 12:21:55.391508 96618 test_context.go:419] Tolerating taints "node-role.kubernetes.io/master" when considering if nodes are ready
started: (0/1/1) "[Feature:Platform] OLM should [Serial] olm version should contain the source commit id [Suite:openshift/conformance/serial]"
I0110 12:22:04.863345 96622 test_context.go:419] Tolerating taints "node-role.kubernetes.io/master" when considering if nodes are ready
Jan 10 12:22:04.893: INFO: Waiting up to 30m0s for all (but 100) nodes to be schedulable
Jan 10 12:22:06.223: INFO: Waiting up to 10m0s for all pods (need at least 0) in namespace 'kube-system' to be running and ready
Jan 10 12:22:07.197: INFO: 0 / 0 pods in namespace 'kube-system' are running and ready (0 seconds elapsed)
Jan 10 12:22:07.197: INFO: expected 0 pod replicas in namespace 'kube-system', 0 are Running and Ready.
Jan 10 12:22:07.197: INFO: Waiting up to 5m0s for all daemonsets in namespace 'kube-system' to start
Jan 10 12:22:07.501: INFO: e2e test version: v0.0.0-master+$Format:%h$
Jan 10 12:22:07.808: INFO: kube-apiserver version: v1.16.2
Jan 10 12:22:08.217: INFO: Cluster IP family: ipv4
[BeforeEach] [Top Level]
/Users/jianzhang/goproject/src/github.com/openshift/origin/test/extended/util/test.go:60
[BeforeEach] [Feature:Platform] OLM should
/Users/jianzhang/goproject/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/test/e2e/framework/framework.go:154
STEP: Creating a kubernetes client
[It] [Serial] olm version should contain the source commit id [Suite:openshift/conformance/serial]
/Users/jianzhang/goproject/src/github.com/openshift/origin/test/extended/operators/olm.go:114
Jan 10 12:22:08.244: INFO: Running 'oc --namespace= --config=/Users/jianzhang/scheng-kubeconfig get -n openshift-operator-lifecycle-manager pods -l app=catalog-operator -o=jsonpath={.items[0].metadata.name}'
Jan 10 12:22:10.321: INFO: get pod name:catalog-operator-6f887bc6fb-qtsln
STEP: get olm version from the catalog-operator pod
Jan 10 12:22:10.321: INFO: Running 'oc --namespace=openshift-operator-lifecycle-manager --config=/Users/jianzhang/scheng-kubeconfig exec catalog-operator-6f887bc6fb-qtsln -- olm --version'
Jan 10 12:22:14.544: INFO: olm source git commit ID:c74333dbe61d92e1a75b09f74c0dc2c99b05405a
STEP: checking this commitID in the operator-lifecycle-manager repo
Jan 10 12:22:16.551: INFO: Running 'oc --namespace=openshift-operator-lifecycle-manager --config=/Users/jianzhang/scheng-kubeconfig get -n openshift-operator-lifecycle-manager pods -l app=olm-operator -o=jsonpath={.items[0].metadata.name}'
Jan 10 12:22:18.173: INFO: get pod name:olm-operator-74dd7957bc-tsjkj
STEP: get olm version from the olm-operator pod
Jan 10 12:22:18.173: INFO: Running 'oc --namespace=openshift-operator-lifecycle-manager --config=/Users/jianzhang/scheng-kubeconfig exec olm-operator-74dd7957bc-tsjkj -- olm --version'
Jan 10 12:22:22.445: INFO: olm source git commit ID:c74333dbe61d92e1a75b09f74c0dc2c99b05405a
Jan 10 12:22:22.445: INFO: Running 'oc --namespace=openshift-operator-lifecycle-manager --config=/Users/jianzhang/scheng-kubeconfig get -n openshift-operator-lifecycle-manager pods -l app=packageserver -o=jsonpath={.items[0].metadata.name}'
Jan 10 12:22:24.302: INFO: get pod name:packageserver-5489f67c95-xfghr
STEP: get olm version from the packageserver pod
Jan 10 12:22:24.302: INFO: Running 'oc --namespace=openshift-operator-lifecycle-manager --config=/Users/jianzhang/scheng-kubeconfig exec packageserver-5489f67c95-xfghr -- olm --version'
Jan 10 12:22:28.275: INFO: olm source git commit ID:c74333dbe61d92e1a75b09f74c0dc2c99b05405a
[AfterEach] [Feature:Platform] OLM should
/Users/jianzhang/goproject/src/github.com/openshift/origin/test/extended/util/client.go:120
[AfterEach] [Feature:Platform] OLM should
/Users/jianzhang/goproject/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/test/e2e/framework/framework.go:155
Jan 10 12:22:28.278: INFO: Waiting up to 7m0s for all (but 100) nodes to be ready
Jan 10 12:22:29.203: INFO: Running AfterSuite actions on all nodes
Jan 10 12:22:29.203: INFO: Running AfterSuite actions on node 1
passed: (33.7s) 2020-01-10T04:22:29 "[Feature:Platform] OLM should [Serial] olm version should contain the source commit id [Suite:openshift/conformance/serial]"
Timeline:
Jan 10 04:22:10.471 - 15s W ns/openshift-template-service-broker pod/apiserver-1-tn7dp node/scheng-upg-dcdp6-rhel-1 pod has been pending longer than a minute
Jan 10 04:22:10.471 - 15s W ns/openshift-ansible-service-broker pod/asb-1-qjjcp node/scheng-upg-dcdp6-rhel-0 pod has been pending longer than a minute
Writing JUnit report to junit_e2e_20200110-042229.xml
1 pass, 0 skip (33.8s) |
|
@jianzhangbjz: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
Close it since #24009 has been merged. |
Automatic test case ocp-20981, which the olm --version should contain the source commit ID.