Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support kubectl deploy absolute manifest files #2011

Conversation

tossmilestone
Copy link
Contributor

Signed-off-by: Xiaoxi He xxhe@alauda.io

Fix #2010

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@tossmilestone
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@codecov-io
Copy link

codecov-io commented Apr 24, 2019

Codecov Report

Merging #2011 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2011      +/-   ##
==========================================
+ Coverage   55.96%   55.98%   +0.01%     
==========================================
  Files         173      173              
  Lines        7556     7559       +3     
==========================================
+ Hits         4229     4232       +3     
  Misses       2924     2924              
  Partials      403      403
Impacted Files Coverage Δ
pkg/skaffold/util/util.go 65.69% <100%> (+0.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6184872...4d81529. Read the comment docs.

@tossmilestone tossmilestone force-pushed the kubectl-support-absolute-path branch 4 times, most recently from df67ecf to 2d63f6f Compare April 24, 2019 08:17
@tejal29
Copy link
Contributor

tejal29 commented Apr 24, 2019

@tossmilestone before we review it, i want to understand more about your usecase.
You are using skaffold deploy to deploy a manifest which is not part of your workspace, but references artifacts built by your workspace?

Thanks
Tejal

@tossmilestone
Copy link
Contributor Author

@tejal29 Yes, I am using one skaffold yaml for several projects located in different directory. So it's useful if I can deploy using absolute file.

@@ -89,6 +89,12 @@ func StrSliceContains(sl []string, s string) bool {
func ExpandPathsGlob(workingDir string, paths []string) ([]string, error) {
expandedPaths := make(map[string]bool)
for _, p := range paths {
if _, err := os.Stat(p); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you instead use AbsolutePaths here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func AbsolutePaths(workspace string, paths []string) []string {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Copy link
Contributor Author

@tossmilestone tossmilestone Apr 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use filepath.IsAbs instead, cause the AbsolutePaths is used to prepend the relative paths.

@tejal29 tejal29 added the kokoro:run runs the kokoro jobs on a PR label Apr 25, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Apr 25, 2019
Signed-off-by: Xiaoxi He <xxhe@alauda.io>
@tossmilestone tossmilestone force-pushed the kubectl-support-absolute-path branch from 2d63f6f to 4d81529 Compare April 26, 2019 06:35
Copy link
Contributor

@tejal29 tejal29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to me.

@tejal29 tejal29 added the kokoro:run runs the kokoro jobs on a PR label Apr 26, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Apr 26, 2019
@tejal29 tejal29 merged commit 9a68f2a into GoogleContainerTools:master Apr 26, 2019
if filepath.IsAbs(p) {
// This is a absolute file reference
expandedPaths[p] = true
continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this short-circuits the glob expansion further below. Should it be that way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deploy with kubectl support absolute manifest path
6 participants