Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Fix crds for tilt after CRDS moved in #5065 #5100

Merged
merged 1 commit into from
Sep 8, 2022
Merged
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
22 changes: 8 additions & 14 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ def remove_securityContext(yaml_stream):

return yaml_stream

def dockerfile_gen(binary_name):
def dockerfile_gen(binary_name, additionalCommands=[]):
tilt_dockerfile_header = """
FROM gcr.io/distroless/base:debug as tilt
WORKDIR /
COPY ./{} /{}
""".format(binary_name, binary_name)

return "\n".join([
tilt_dockerfile_header,
])
tilt_dockerfile_header
] + additionalCommands)

local("kubectl create ns osm-system || true", quiet = True)

Expand Down Expand Up @@ -74,8 +74,8 @@ local_resource(

local_resource(
'bootstrap-compile',
'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./build/osm-bootstrap ./cmd/osm-bootstrap',
deps=['./cmd/osm-bootstrap/osm-bootstrap.go', 'pkg'],
'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./build/osm-bootstrap ./cmd/osm-bootstrap && cp -r ./cmd/osm-bootstrap/crds ./build',
deps=['./cmd/osm-bootstrap/osm-bootstrap.go', 'pkg', './cmd/osm-bootstrap/crds'],
labels=['compile']
)

Expand Down Expand Up @@ -112,13 +112,6 @@ docker_build_with_restart(
]
)

docker_build(
'openservicemesh/osm-crds',
dockerfile='./dockerfiles/Dockerfile.osm-crds',
context='./cmd/osm-bootstrap/crds/',
platform = 'linux/amd64'
)

docker_build_with_restart(
'openservicemesh/osm-injector',
context='./build/',
Expand All @@ -137,9 +130,10 @@ docker_build_with_restart(
'openservicemesh/osm-bootstrap',
context='./build/',
target='tilt',
dockerfile_contents = dockerfile_gen('osm-bootstrap'),
dockerfile_contents = dockerfile_gen('osm-bootstrap', ["COPY ./crds/* /osm-crds/"]),
only=[
'osm-bootstrap'
'osm-bootstrap',
'crds/'
],
entrypoint=['/osm-bootstrap'],
live_update=[
Expand Down