Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions .tilt-support
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,24 @@ def process_yaml(yaml):

# data format:
# {
# 'image': 'quay.io/operator-framework/rukpak',
# 'yaml': 'manifests/overlays/cert-manager',
# 'binaries': {
# 'core': 'core',
# 'crdvalidator': 'crd-validation-webhook',
# 'helm': 'helm-provisioner',
# 'webhooks': 'rukpak-webhooks',
# 'repos': {
# 'catalogd': {
# 'image': 'quay.io/operator-framework/catalogd',
# 'binary': './cmd/catalogd',
# 'deployment': 'catalogd-controller-manager',
# 'deps': ['api', 'cmd/catalogd', 'internal/catalogd', 'internal/shared', 'go.mod', 'go.sum'],
# 'starting_debug_port': 20000,
# },
# ... additional entries here ...
# },
# 'deps': ['api', 'cmd/binary_name', 'internal', 'pkg'],
# },
def deploy_repo(repo, data, tags="", debug=True):
print('Deploying repo {}'.format(repo))
deploy_cert_manager_if_needed()
# 'yaml': 'config/overlays/tilt-local-dev',
# }

local_port = data['starting_debug_port']
for binary, deployment in data['binaries'].items():
build_binary(repo, binary, data['deps'], data['image'], tags, debug)
k8s_resource(deployment, port_forwards=['{}:30000'.format(local_port)])
local_port += 1
def deploy_repo(data, tags="", debug=True):
deploy_cert_manager_if_needed()
for reponame, repo in data['repos'].items():
print('Deploying repo {}'.format(reponame))
local_port = repo['starting_debug_port']
build_binary(reponame, repo['binary'], repo['deps'], repo['image'], tags, debug)
k8s_resource(repo['deployment'], port_forwards=['{}:30000'.format(local_port)])
process_yaml(kustomize(data['yaml']))
37 changes: 18 additions & 19 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
load('.tilt-support', 'deploy_repo')

operator_controller = {
'image': 'quay.io/operator-framework/operator-controller',
'yaml': 'config/overlays/tilt-local-dev/operator-controller',
'binaries': {
'./cmd/operator-controller': 'operator-controller-controller-manager',
olmv1 = {
'repos': {
'catalogd': {
'image': 'quay.io/operator-framework/catalogd',
'binary': './cmd/catalogd',
'deployment': 'catalogd-controller-manager',
'deps': ['api', 'cmd/catalogd', 'internal/catalogd', 'internal/shared', 'go.mod', 'go.sum'],
'starting_debug_port': 20000,
},
'operator-controller': {
'image': 'quay.io/operator-framework/operator-controller',
'binary': './cmd/operator-controller',
'deployment': 'operator-controller-controller-manager',
'deps': ['api', 'cmd/operator-controller', 'internal/operator-controller', 'internal/shared', 'go.mod', 'go.sum'],
'starting_debug_port': 30000,
},
},
'deps': ['api', 'cmd/operator-controller', 'internal/operator-controller', 'internal/shared', 'go.mod', 'go.sum'],
'starting_debug_port': 30000,
'yaml': 'config/overlays/tilt-local-dev',
}
deploy_repo('operator-controller', operator_controller, '-tags containers_image_openpgp')

catalogd = {
'image': 'quay.io/operator-framework/catalogd',
'yaml': 'config/overlays/tilt-local-dev/catalogd',
'binaries': {
'./cmd/catalogd': 'catalogd-controller-manager',
},
'deps': ['api', 'cmd/catalogd', 'internal/catalogd', 'internal/shared', 'go.mod', 'go.sum'],
'starting_debug_port': 20000,
}

deploy_repo('catalogd', catalogd, '-tags containers_image_openpgp')
deploy_repo(olmv1, '-tags containers_image_openpgp')
20 changes: 0 additions & 20 deletions config/overlays/tilt-local-dev/catalogd/kustomization.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions config/overlays/tilt-local-dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# kustomization file for secure OLMv1
# DO NOT ADD A NAMESPACE HERE
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonAnnotations:
olm.operatorframework.io/feature-set: tilt-experimental
components:
- ../../components/base/experimental
# This must be last due to namespace overwrite issues of the ca
- ../../components/cert-manager
patches:
- target:
kind: Deployment
name: operator-controller-controller-manager
path: patches/operator-controller.yaml
- target:
kind: Deployment
name: catalogd-controller-manager
path: patches/catalogd.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
value: null
- op: remove
# remove --leader-elect so container doesn't restart during breakpoints
path: /spec/template/spec/containers/0/args/0
path: /spec/template/spec/containers/0/args/2
Loading