Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
aa277804
Unverified
Commit
aa277804
authored
Dec 11, 2018
by
Kubernetes Prow Robot
Committed by
GitHub
Dec 11, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71916 from apelisse/automated-cherry-pick-of-#71854-upstream-release-1.13
Automated cherry pick of #71854: apply: fix detection of non-dry-run enabled servers
parents
83f92079
c7ba05ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
apply.go
pkg/kubectl/cmd/apply/apply.go
+7
-6
No files found.
pkg/kubectl/cmd/apply/apply.go
View file @
aa277804
...
@@ -343,6 +343,13 @@ func (o *ApplyOptions) Run() error {
...
@@ -343,6 +343,13 @@ func (o *ApplyOptions) Run() error {
return
err
return
err
}
}
// If server-dry-run is requested but the type doesn't support it, fail right away.
if
o
.
ServerDryRun
{
if
err
:=
dryRunVerifier
.
HasSupport
(
info
.
Mapping
.
GroupVersionKind
);
err
!=
nil
{
return
err
}
}
if
info
.
Namespaced
()
{
if
info
.
Namespaced
()
{
visitedNamespaces
.
Insert
(
info
.
Namespace
)
visitedNamespaces
.
Insert
(
info
.
Namespace
)
}
}
...
@@ -366,12 +373,6 @@ func (o *ApplyOptions) Run() error {
...
@@ -366,12 +373,6 @@ func (o *ApplyOptions) Run() error {
if
!
errors
.
IsNotFound
(
err
)
{
if
!
errors
.
IsNotFound
(
err
)
{
return
cmdutil
.
AddSourceToErr
(
fmt
.
Sprintf
(
"retrieving current configuration of:
\n
%s
\n
from server for:"
,
info
.
String
()),
info
.
Source
,
err
)
return
cmdutil
.
AddSourceToErr
(
fmt
.
Sprintf
(
"retrieving current configuration of:
\n
%s
\n
from server for:"
,
info
.
String
()),
info
.
Source
,
err
)
}
}
// If server-dry-run is requested but the type doesn't support it, fail right away.
if
o
.
ServerDryRun
{
if
err
:=
dryRunVerifier
.
HasSupport
(
info
.
Mapping
.
GroupVersionKind
);
err
!=
nil
{
return
err
}
}
// Create the resource if it doesn't exist
// Create the resource if it doesn't exist
// First, update the annotation used by kubectl apply
// First, update the annotation used by kubectl apply
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment