Skip to content

Commit

Permalink
Upgrade go dependencies (#235)
Browse files Browse the repository at this point in the history
* Upgrade packages to latest

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* Upgrade client_golang package

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* Upgrade cli-runtime

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* Upgrade kyaml

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* Upgrade testify & controllerruntime

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* Upgrade helm

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* Just upgrade k8s.io/api to v0.24.3

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* Update controller runtime

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* Update gomega

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* update api

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* update channel

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* e2e BeforeSuite time out due to incompatible kind cluster version

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* upgrade action setup-go edition to v3

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* upgrade channel pkg to the latest

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* add debug info

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* Ensure managed cluster Available

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* check addon manifestwork status

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* fix app addon manifestwork name

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* list manifestworks

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* check manifestwork status

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* check error

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>

* verify app addon status in other script

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* describe pod

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* remove LeaderElectionResourceLock

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* specify LeaderElectionNamespace

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

* clean up code

Signed-off-by: Xiangjing Li <xiangli@redhat.com>

Co-authored-by: Xiangjing Li <xiangli@redhat.com>
  • Loading branch information
lennysgarage and xiangjingli authored Jul 29, 2022
1 parent c620b78 commit 065c92b
Show file tree
Hide file tree
Showing 11 changed files with 535 additions and 804 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run FOSSA Scan
uses: fossas/fossa-action@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go-postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 1
path: go/src/github.com/open-cluster-management/multicloud-operators-subscription
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: install imagebuilder
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/go-presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 1
path: go/src/github.com/open-cluster-management/multicloud-operators-subscription
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: lint
Expand All @@ -37,12 +37,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 1
path: go/src/github.com/open-cluster-management/multicloud-operators-subscription
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: build
Expand All @@ -53,12 +53,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 1
path: go/src/github.com/open-cluster-management/multicloud-operators-subscription
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: install imagebuilder
Expand All @@ -71,12 +71,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 1
path: go/src/github.com/open-cluster-management/multicloud-operators-subscription
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: test
Expand All @@ -87,12 +87,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 1
path: go/src/github.com/open-cluster-management/multicloud-operators-subscription
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: install imagebuilder
Expand All @@ -102,12 +102,12 @@ jobs:
- name: setup kind
uses: engineerd/setup-kind@v0.5.0
with:
version: v0.11.1
version: v0.14.0
name: cluster1
- name: setup kind
uses: engineerd/setup-kind@v0.5.0
with:
version: v0.11.1
version: v0.14.0
name: hub
- name: Load image on the nodes of the cluster
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/multicloud-operators-subscription
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: install imagebuilder
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ build-e2e:

test-e2e: build-e2e deploy-ocm deploy-hub
./e2e.test -test.v -ginkgo.v
deploy/ocm/verify_app_addon.sh

test-e2e-kc:
build/e2e-kc.sh
Expand Down
10 changes: 5 additions & 5 deletions cmd/appsubsummary/exec/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ func RunManager() {

// Create a new Cmd to provide shared dependencies and start components
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Port: operatorMetricsPort,
LeaderElection: enableLeaderElection,
LeaderElectionID: "multicloud-operators-appsubsummary-leader.open-cluster-management.io",
LeaderElectionResourceLock: "configmaps",
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Port: operatorMetricsPort,
LeaderElection: enableLeaderElection,
LeaderElectionID: "multicloud-operators-appsubsummary-leader.open-cluster-management.io",
LeaderElectionNamespace: "kube-system",
})
if err != nil {
klog.Error(err, "")
Expand Down
10 changes: 5 additions & 5 deletions cmd/manager/exec/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ func RunManager() {

// Create a new Cmd to provide shared dependencies and start components
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Port: operatorMetricsPort,
LeaderElection: enableLeaderElection,
LeaderElectionID: leaderElectionID,
LeaderElectionResourceLock: "configmaps",
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
Port: operatorMetricsPort,
LeaderElection: enableLeaderElection,
LeaderElectionID: leaderElectionID,
LeaderElectionNamespace: "kube-system",
})

if err != nil {
Expand Down
56 changes: 56 additions & 0 deletions deploy/ocm/verify_app_addon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

set -o nounset
set -o pipefail

waitForRes() {
FOUND=1
MINUTE=0
resKinds=$1
resName=$2
resNamespace=$3
ignore=$4
running="\([0-9]\+\)\/\1"
printf "\n#####\nWait for ${resNamespace}/${resName} to reach running state (3min).\n"
while [ ${FOUND} -eq 1 ]; do
# Wait up to 3min, should only take about 20-30s
if [ $MINUTE -gt 180 ]; then
echo "Timeout waiting for the ${resNamespace}\/${resName}."
echo "List of current resources:"
oc get ${resKinds} -n ${resNamespace} ${resName}
echo "You should see ${resNamespace}/${resName} ${resKinds}"
if [ "${resKinds}" == "pods" ]; then
APP_ADDON_POD=$($KUBECTL get pods -n ${resNamespace} |grep ${resName} |awk -F' ' '{print $1}')

echo "##### Output the pod log\n"
$KUBECTL logs -n ${resNamespace} $APP_ADDON_POD

echo "##### Describe the pod status\n"
$KUBECTL describe pods -n ${resNamespace} $APP_ADDON_POD
fi
exit 1
fi
if [ "$ignore" == "" ]; then
operatorRes=`oc get ${resKinds} -n ${resNamespace} | grep ${resName}`
else
operatorRes=`oc get ${resKinds} -n ${resNamespace} | grep ${resName} | grep -v ${ignore}`
fi
if [[ $(echo $operatorRes | grep "${running}") ]]; then
echo "* ${resName} is running"
break
elif [ "$operatorRes" == "" ]; then
operatorRes="Waiting"
fi
echo "* STATUS: $operatorRes"
sleep 5
(( MINUTE = MINUTE + 5 ))
done
}

KUBECTL=${KUBECTL:-kubectl}

echo "############ access cluster1"
$KUBECTL config use-context kind-cluster1

waitForRes "pods" "application-manager" "open-cluster-management-agent-addon" ""
exit 0
Loading

0 comments on commit 065c92b

Please sign in to comment.