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

Commit

Permalink
fix crds after #5065
Browse files Browse the repository at this point in the history
Signed-off-by: James Sturtevant <[email protected]>
  • Loading branch information
jsturtevant committed Sep 7, 2022
1 parent 4d8c632 commit 04751c5
Showing 1 changed file with 8 additions and 14 deletions.
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

0 comments on commit 04751c5

Please sign in to comment.