MortalHappiness commented on a change in pull request #571:
URL: https://github.com/apache/submarine/pull/571#discussion_r622719289



##########
File path: submarine-cloud-v2/Makefile
##########
@@ -28,6 +28,9 @@ api:
 
 .PHONY: image
 image:
+ifeq (,$(wildcard ./charts/))
+       cp -r ../helm-charts/submarine/charts  .
+endif
        GOOS=linux go build -o submarine-operator
        docker build -t submarine-operator .
        go build -o submarine-operator

Review comment:
       You only copy `../helm-charts/submarine/charts` to current directory 
when we run `make image`. Therefore, if we run `make` without running `make 
image`, the `charts` directory will not exist and out-of-cluster operator will 
throw an error.
   Maybe a better workaround is making the `charts` folder a non-phony target 
and let `make` and `make image` dependent on it
   ```make
   all: # The default target
   
   charts:
        cp -r ../helm-charts/submarine/charts .
   
   .PHONY: all
   all: charts
        go build -o submarine-operator
   
   .PHONY: image
   image: charts
        GOOS=linux go build -o submarine-operator
        docker build -t submarine-operator .
        go build -o submarine-operator
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to