Skip to content

Commit

Permalink
add controller target in makefile. (istio#307)
Browse files Browse the repository at this point in the history
* add controller target in makefile.

* apply comments.

* Cleanup build

* Docker build fixes
  • Loading branch information
morvencao authored and istio-testing committed Oct 8, 2019
1 parent b0eed8c commit dcf0abb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ build/_output/
.mesh-cli.log
#mandiff output
out/
build/out/
data/charts/
19 changes: 17 additions & 2 deletions Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

TAG ?= latest

pwd := $(shell pwd)

# make targets
Expand Down Expand Up @@ -39,7 +41,6 @@ update-charts: installer.sha

clean-charts:
@rm -fr data/charts

# make target dependencies
vfsgen: data/ update-charts
go generate ./...
Expand All @@ -63,6 +64,21 @@ mesh: vfsgen
go build -o $(GOPATH)/bin/mesh ./cmd/mesh.go
GOARCH=$(TARGET_ARCH) GOOS=$(TARGET_OS) go build -o /work/mesh ./cmd/mesh.go

# NOTE: docker targets only work with local builds.

controller: vfsgen
go build -o $(GOPATH)/bin/istio-operator ./cmd/manager

docker: controller
mkdir -p build/out
cp $(GOPATH)/bin/istio-operator build/out/.
docker build -t $(HUB)/operator:$(TAG) -f build/Dockerfile .

docker.push:
docker push $(HUB)/operator:$(TAG)

docker.all: docker docker.push

update-goldens:
export REFRESH_GOLDEN=true
@go test ./cmd/mesh/...
Expand All @@ -87,7 +103,6 @@ protoc_gen_docs_plugin := --docs_out=warnings=true,mode=html_fragment_with_front
protoc_gen_k8s_support_plugins := --jsonshim_out=$(gogo_mapping):$(out_path) --deepcopy_out=$(gogo_mapping):$(out_path)

########################

types_v1alpha2_path := pkg/apis/istio/v1alpha2
types_v1alpha2_protos := $(wildcard $(types_v1alpha2_path)/*.proto)
types_v1alpha2_pb_gos := $(types_v1alpha2_protos:.proto=.pb.go)
Expand Down
3 changes: 1 addition & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ ENV OPERATOR=/usr/local/bin/istio-operator \
USER_NAME=istio-operator

# install operator binary
COPY build/_output/bin/istio-operator ${OPERATOR}

COPY build/out/istio-operator /usr/local/bin/.
COPY build/bin /usr/local/bin
RUN /usr/local/bin/user_setup

Expand Down
3 changes: 1 addition & 2 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ spec:
serviceAccountName: istio-operator
containers:
- name: istio-operator
# Replace this with the built image name
image: REPLACE_IMAGE
image: docker.io/istio/controller
command:
- istio-operator
- server
Expand Down

0 comments on commit dcf0abb

Please sign in to comment.