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

Dronev06 #33

Merged
merged 4 commits into from
Aug 10, 2017
Merged

Dronev06 #33

merged 4 commits into from
Aug 10, 2017

Conversation

stephansnyt
Copy link
Contributor

@stephansnyt stephansnyt commented Jun 15, 2017

There are still a few open questions I'll call out in comments.

I also haven't thought about versioning and tagging yet. I think we need to two branches (or tags) to indicate the most up-to-date versions of the v0.4 and v0.5+ style of the plugin.

@@ -135,78 +224,76 @@ func wrapMain() error {

e := os.Environ()
e = append(e, fmt.Sprintf("GOOGLE_APPLICATION_CREDENTIALS=%s", keyPath))
runner := NewEnviron(workspace.Path, e, os.Stdout, os.Stderr)
wd, err := os.Getwd()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

using os.Getwd() instead of workspace.Path seems to work in my limited testing, but I'm new to golang and I would be very surprised if this is the correct/best practice way to handle this, can anyone more fluent in golang please review?

Copy link
Member

Choose a reason for hiding this comment

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

I did some testing and this works as is, however we can also just remove wd as well and use "" instead.

This is used to set the command runner's environment:

    // Dir specifies the working directory of the command.
    // If Dir is the empty string, Run runs the command in the
    // calling process's current directory.
    Dir string

-- https://golang.org/pkg/os/exec/#Cmd

"repo": repo,
"build": build,
"system": system,
// TODO do we really need these?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know if these are needed -- it would allow people to reference variables in kube templates that aren't explicitly called out in the pipeline configuration. I think we should not allow that. If a pipeline author wants to reference this data, they should explicitly pass it in as a var in .drone.yml

vargs.Template: data,
vargs.SecretTemplate: secrets,
kubeTemplate: data,
secretTemplate: secretsAndData,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a significant difference in behavior with the old version. Previously, only secrets were passed to secret templates, now secret templates have access to both variables and secrets.

fmt.Println("Skipping kubectl apply, because dry_run: true")
return nil
}

// Set the execution namespace.
if len(vargs.Namespace) > 0 {
fmt.Printf("Configuring kubectl to the %s namespace\n", vargs.Namespace)
if len(c.String("namespace")) > 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did NO TESTING of the namespace feature.

@schugh
Copy link

schugh commented Jul 14, 2017

Really looking forward to using this when ready. What's holding up the merge at the moment?

@tonglil
Copy link
Member

tonglil commented Aug 3, 2017

Hi @schugh, a few other things came up in our priorities, but we are back to working on the upgrade now. Hope to have things ready for users soon!

@schugh
Copy link

schugh commented Aug 4, 2017

Thanks for the update! looking forward to taking it for a test drive.

@@ -0,0 +1,9 @@
#v0.60 tag (tagging strategy TBD)
Copy link
Member

Choose a reason for hiding this comment

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

My proposal is we follow a similar versioning scheme as np internally:

Tag the current versions as: 0.4 and 0.4.0
Release when this is merged: 0.6.0
latest -> master
stable -> latest tag

@@ -135,78 +224,76 @@ func wrapMain() error {

e := os.Environ()
e = append(e, fmt.Sprintf("GOOGLE_APPLICATION_CREDENTIALS=%s", keyPath))
runner := NewEnviron(workspace.Path, e, os.Stdout, os.Stderr)
wd, err := os.Getwd()
Copy link
Member

Choose a reason for hiding this comment

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

I did some testing and this works as is, however we can also just remove wd as well and use "" instead.

This is used to set the command runner's environment:

    // Dir specifies the working directory of the command.
    // If Dir is the empty string, Run runs the command in the
    // calling process's current directory.
    Dir string

-- https://golang.org/pkg/os/exec/#Cmd

@tonglil tonglil changed the base branch from master to develop August 10, 2017 03:04
@tonglil
Copy link
Member

tonglil commented Aug 10, 2017

I changed the base for this to develop instead of master so your changes can merged in and used as the starting point.

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

Successfully merging this pull request may close these issues.

3 participants