-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make all embedded fields on runner private
- Loading branch information
Showing
9 changed files
with
424 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Copyright 2019 The Skaffold Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package runner | ||
|
||
import ( | ||
"context" | ||
"io" | ||
) | ||
|
||
func (r *SkaffoldRunner) Cleanup(ctx context.Context, out io.Writer) error { | ||
return r.deployer.Cleanup(ctx, out) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
Copyright 2019 The Skaffold Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package runner | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"io" | ||
|
||
cfg "github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/config" | ||
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/build" | ||
"github.com/pkg/errors" | ||
) | ||
|
||
func (r *SkaffoldRunner) Deploy(ctx context.Context, out io.Writer, artifacts []build.Artifact) error { | ||
if cfg.IsKindCluster(r.runCtx.KubeContext) { | ||
// With `kind`, docker images have to be loaded with the `kind` CLI. | ||
if err := r.loadImagesInKindNodes(ctx, out, artifacts); err != nil { | ||
return errors.Wrapf(err, "loading images into kind nodes") | ||
} | ||
} | ||
|
||
err := r.deployer.Deploy(ctx, out, artifacts, r.labellers) | ||
r.hasDeployed = true | ||
if err != nil { | ||
return err | ||
} | ||
return r.performStatusCheck(ctx, out) | ||
} | ||
|
||
func (r *SkaffoldRunner) performStatusCheck(ctx context.Context, out io.Writer) error { | ||
// Check if we need to perform deploy status | ||
if r.runCtx.Opts.StatusCheck { | ||
fmt.Fprintln(out, "Waiting for deployments to stabilize") | ||
err := statusCheck(ctx, r.defaultLabeller, r.runCtx) | ||
if err != nil { | ||
fmt.Fprintln(out, err.Error()) | ||
} | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.