Skip to content

Commit 587a46c

Browse files
committed
Update Tilt to use a single manifest
This makes tilt use the equivalent of the experimental manifest with the additional patches. Git seems to get confused about the rename because the two patch files are identical. Signed-off-by: Todd Short <[email protected]>
1 parent eb4b979 commit 587a46c

File tree

7 files changed

+57
-77
lines changed

7 files changed

+57
-77
lines changed

.tilt-support

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,24 @@ def process_yaml(yaml):
130130

131131
# data format:
132132
# {
133-
# 'image': 'quay.io/operator-framework/rukpak',
134-
# 'yaml': 'manifests/overlays/cert-manager',
135-
# 'binaries': {
136-
# 'core': 'core',
137-
# 'crdvalidator': 'crd-validation-webhook',
138-
# 'helm': 'helm-provisioner',
139-
# 'webhooks': 'rukpak-webhooks',
133+
# 'repos': {
134+
# 'catalogd': {
135+
# 'image': 'quay.io/operator-framework/catalogd',
136+
# 'binary': './cmd/catalogd',
137+
# 'deployment': 'catalogd-controller-manager',
138+
# 'deps': ['api', 'cmd/catalogd', 'internal/catalogd', 'internal/shared', 'go.mod', 'go.sum'],
139+
# 'starting_debug_port': 20000,
140+
# },
141+
# ... additional entries here ...
140142
# },
141-
# 'deps': ['api', 'cmd/binary_name', 'internal', 'pkg'],
142-
# },
143-
def deploy_repo(repo, data, tags="", debug=True):
144-
print('Deploying repo {}'.format(repo))
145-
deploy_cert_manager_if_needed()
143+
# 'yaml': 'config/overlays/tilt-local-dev',
144+
# }
146145

147-
local_port = data['starting_debug_port']
148-
for binary, deployment in data['binaries'].items():
149-
build_binary(repo, binary, data['deps'], data['image'], tags, debug)
150-
k8s_resource(deployment, port_forwards=['{}:30000'.format(local_port)])
151-
local_port += 1
146+
def deploy_repo(data, tags="", debug=True):
147+
deploy_cert_manager_if_needed()
148+
for reponame, repo in data['repos'].items():
149+
print('Deploying repo {}'.format(reponame))
150+
local_port = repo['starting_debug_port']
151+
build_binary(reponame, repo['binary'], repo['deps'], repo['image'], tags, debug)
152+
k8s_resource(repo['deployment'], port_forwards=['{}:30000'.format(local_port)])
152153
process_yaml(kustomize(data['yaml']))

Tiltfile

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
load('.tilt-support', 'deploy_repo')
22

3-
operator_controller = {
4-
'image': 'quay.io/operator-framework/operator-controller',
5-
'yaml': 'config/overlays/tilt-local-dev/operator-controller',
6-
'binaries': {
7-
'./cmd/operator-controller': 'operator-controller-controller-manager',
3+
olmv1 = {
4+
'repos': {
5+
'catalogd': {
6+
'image': 'quay.io/operator-framework/catalogd',
7+
'binary': './cmd/catalogd',
8+
'deployment': 'catalogd-controller-manager',
9+
'deps': ['api', 'cmd/catalogd', 'internal/catalogd', 'internal/shared', 'go.mod', 'go.sum'],
10+
'starting_debug_port': 20000,
11+
},
12+
'operator-controller': {
13+
'image': 'quay.io/operator-framework/operator-controller',
14+
'binary': './cmd/operator-controller',
15+
'deployment': 'operator-controller-controller-manager',
16+
'deps': ['api', 'cmd/operator-controller', 'internal/operator-controller', 'internal/shared', 'go.mod', 'go.sum'],
17+
'starting_debug_port': 30000,
18+
},
819
},
9-
'deps': ['api', 'cmd/operator-controller', 'internal/operator-controller', 'internal/shared', 'go.mod', 'go.sum'],
10-
'starting_debug_port': 30000,
20+
'yaml': 'config/overlays/tilt-local-dev',
1121
}
12-
deploy_repo('operator-controller', operator_controller, '-tags containers_image_openpgp')
1322

14-
catalogd = {
15-
'image': 'quay.io/operator-framework/catalogd',
16-
'yaml': 'config/overlays/tilt-local-dev/catalogd',
17-
'binaries': {
18-
'./cmd/catalogd': 'catalogd-controller-manager',
19-
},
20-
'deps': ['api', 'cmd/catalogd', 'internal/catalogd', 'internal/shared', 'go.mod', 'go.sum'],
21-
'starting_debug_port': 20000,
22-
}
23-
24-
deploy_repo('catalogd', catalogd, '-tags containers_image_openpgp')
23+
deploy_repo(olmv1, '-tags containers_image_openpgp')

config/overlays/tilt-local-dev/catalogd/kustomization.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# kustomization file for secure OLMv1
2+
# DO NOT ADD A NAMESPACE HERE
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
commonAnnotations:
6+
olm.operatorframework.io/feature-set: tilt-experimental
7+
components:
8+
- ../../components/base/experimental
9+
# This must be last due to namespace overwrite issues of the ca
10+
- ../../components/cert-manager
11+
patches:
12+
- target:
13+
kind: Deployment
14+
name: operator-controller-controller-manager
15+
path: patches/operator-controller.yaml
16+
- target:
17+
kind: Deployment
18+
name: catalogd-controller-manager
19+
path: patches/catalogd.yaml
20+

config/overlays/tilt-local-dev/operator-controller/kustomization.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

config/overlays/tilt-local-dev/catalogd/patches/dev-deployment.yaml renamed to config/overlays/tilt-local-dev/patches/operator-controller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
value: null
88
- op: remove
99
# remove --leader-elect so container doesn't restart during breakpoints
10-
path: /spec/template/spec/containers/0/args/0
10+
path: /spec/template/spec/containers/0/args/2

0 commit comments

Comments
 (0)