forked from pulp/pulp-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (133 loc) · 4.95 KB
/
Copy pathupgrade.yml
File metadata and controls
143 lines (133 loc) · 4.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: "bundle upgrade"
on:
workflow_call:
jobs:
bundle-upgrade:
runs-on: ubuntu-latest
if: github.ref_name != 'main'
steps:
- uses: actions/checkout@v4
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: false
- name: Install kind
run: .ci/scripts/kind_with_registry.sh v1.31.6
- name: Install OLM
run: |
make sdkbin LOCALBIN=/tmp
/tmp/operator-sdk olm install
shell: bash
- uses: actions/checkout@v4
with:
repository: pulp/pulp-operator
ref: 1.1.0
- name: Build bundle image
run: make bundle-build bundle-push BUNDLE_IMG=localhost:5001/pulp-operator-bundle:old
- name: Install the operator
run: /tmp/operator-sdk run bundle --skip-tls localhost:5001/pulp-operator-bundle:old --timeout 4m
- uses: actions/checkout@v4
- name: Build bundle image
run: make docker-build docker-push bundle bundle-build bundle-push VERSION=1.0.0-dev IMG=localhost:5001/pulp-operator:upgrade BUNDLE_IMG=localhost:5001/pulp-operator-bundle:new
- name: Upgrade the operator
run: /tmp/operator-sdk run bundle-upgrade --use-http localhost:5001/pulp-operator-bundle:new --timeout 4m
- name: Logs
if: always()
run: .github/workflows/scripts/show_logs.sh --kind
- name: OLM Logs
if: always()
run: |
echo ::group::SUB
kubectl get sub -oyaml -A
echo ::endgroup::
echo ::group::InstallPlan
kubectl get ip -A -oyaml
echo ::endgroup::
echo ::group::PODS
kubectl -nolm get pods
kubectl get pods -A
echo ::endgroup::
echo ::group::CATALOG-OPERATOR-LOGS
kubectl -nolm logs deployment/catalog-operator
echo ::endgroup::
echo ::group::OLM-OPERATOR-LOGS
kubectl -nolm logs deployment/olm-operator
echo ::endgroup::
echo ::group::CSV
kubectl get csv -A -oyaml
echo ::endgroup::
shell: bash
test-upgrade:
runs-on: ubuntu-latest
if: github.ref_name != 'main'
strategy:
fail-fast: false
matrix:
include:
- INGRESS_TYPE: ingress
- INGRESS_TYPE: nodeport
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pre-reqs
with:
ingress-type: ${{ matrix.INGRESS_TYPE }}
- uses: actions/checkout@v4
with:
repository: pulp/pulp-operator
ref: main
- name: Deploy pulp-operator to K8s
run: |
make local
kubectl get namespace
kubectl config set-context --current --namespace=pulp-operator-system
kubectl apply -f .ci/assets/kubernetes/pulp-admin-password.secret.yaml
if [[ "$INGRESS_TYPE" == "ingress" ]]; then
kubectl apply -f config/samples/simple.ingress.yaml
else
kubectl apply -f config/samples/simple.yaml
kubectl patch pulp example-pulp --type=merge -p '{"spec":{"api":{"strategy":{"type":"Recreate"}}}}'
fi
shell: bash
- name: Check and wait pulp-operator deploy [before upgrade]
run: |
journalctl --unit=pulp-operator -f &
kubectl logs -f -l app.kubernetes.io/component=operator -c manager &
kubectl wait --for condition=Pulp-Operator-Finished-Execution pulp/example-pulp --timeout=900s
shell: bash
- name: Logs [before upgrade]
if: always()
run: .github/workflows/scripts/show_logs.sh
- uses: actions/checkout@v4
- name: Upgrade pulp-operator
run: |
make install
sleep 1
kubectl get pulps.repo-manager.pulpproject.org
sudo systemctl stop pulp-operator.service
make local
if [[ "$INGRESS_TYPE" == "ingress" ]]; then
kubectl apply -f config/samples/simple.ingress.yaml
kubectl patch pulp example-pulp --type=merge -p '{"spec": { "web": {"replicas": 1 }}}'
kubectl patch pulp example-pulp --type=merge -p '{"spec": { "ingress_annotations": { "nginx.ingress.kubernetes.io/proxy-body-size": "0" } }}'
else
kubectl apply -f config/samples/simple.yaml
kubectl patch pulp example-pulp --type=merge -p '{"spec":{"api":{"strategy":{"type":"Recreate"}}}}'
fi
sleep 10
shell: bash
- name: Check and wait pulp-operator deploy
run: kubectl wait --for condition=Pulp-Operator-Finished-Execution pulp/example-pulp --timeout=900s
shell: bash
- name: KubeLinter
if: github.event_name == 'pull_request'
run: .ci/scripts/kubelinter.sh
- name: Test all components
run: |
.ci/scripts/pulp_tests.sh -m
shell: bash
env:
PY_COLORS: '1'
- name: Logs
if: always()
run: .github/workflows/scripts/show_logs.sh