| ... | ... |
@@ -2,6 +2,7 @@ package controller |
| 2 | 2 |
|
| 3 | 3 |
import ( |
| 4 | 4 |
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api" |
| 5 |
+ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors" |
|
| 5 | 6 |
kclient "github.com/GoogleCloudPlatform/kubernetes/pkg/client" |
| 6 | 7 |
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields" |
| 7 | 8 |
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels" |
| ... | ... |
@@ -104,7 +105,7 @@ func deleteTemplates(client osclient.Interface, ns string) error {
|
| 104 | 104 |
} |
| 105 | 105 |
for i := range items.Items {
|
| 106 | 106 |
err := client.Templates(ns).Delete(items.Items[i].Name) |
| 107 |
- if err != nil {
|
|
| 107 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 108 | 108 |
return err |
| 109 | 109 |
} |
| 110 | 110 |
} |
| ... | ... |
@@ -118,7 +119,7 @@ func deleteRoutes(client osclient.Interface, ns string) error {
|
| 118 | 118 |
} |
| 119 | 119 |
for i := range items.Items {
|
| 120 | 120 |
err := client.Routes(ns).Delete(items.Items[i].Name) |
| 121 |
- if err != nil {
|
|
| 121 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 122 | 122 |
return err |
| 123 | 123 |
} |
| 124 | 124 |
} |
| ... | ... |
@@ -132,7 +133,7 @@ func deleteRoles(client osclient.Interface, ns string) error {
|
| 132 | 132 |
} |
| 133 | 133 |
for i := range items.Items {
|
| 134 | 134 |
err := client.Roles(ns).Delete(items.Items[i].Name) |
| 135 |
- if err != nil {
|
|
| 135 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 136 | 136 |
return err |
| 137 | 137 |
} |
| 138 | 138 |
} |
| ... | ... |
@@ -146,7 +147,7 @@ func deleteRoleBindings(client osclient.Interface, ns string) error {
|
| 146 | 146 |
} |
| 147 | 147 |
for i := range items.Items {
|
| 148 | 148 |
err := client.RoleBindings(ns).Delete(items.Items[i].Name) |
| 149 |
- if err != nil {
|
|
| 149 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 150 | 150 |
return err |
| 151 | 151 |
} |
| 152 | 152 |
} |
| ... | ... |
@@ -160,7 +161,7 @@ func deletePolicyBindings(client osclient.Interface, ns string) error {
|
| 160 | 160 |
} |
| 161 | 161 |
for i := range items.Items {
|
| 162 | 162 |
err := client.PolicyBindings(ns).Delete(items.Items[i].Name) |
| 163 |
- if err != nil {
|
|
| 163 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 164 | 164 |
return err |
| 165 | 165 |
} |
| 166 | 166 |
} |
| ... | ... |
@@ -174,7 +175,7 @@ func deletePolicies(client osclient.Interface, ns string) error {
|
| 174 | 174 |
} |
| 175 | 175 |
for i := range items.Items {
|
| 176 | 176 |
err := client.Policies(ns).Delete(items.Items[i].Name) |
| 177 |
- if err != nil {
|
|
| 177 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 178 | 178 |
return err |
| 179 | 179 |
} |
| 180 | 180 |
} |
| ... | ... |
@@ -188,7 +189,7 @@ func deleteImageStreams(client osclient.Interface, ns string) error {
|
| 188 | 188 |
} |
| 189 | 189 |
for i := range items.Items {
|
| 190 | 190 |
err := client.ImageStreams(ns).Delete(items.Items[i].Name) |
| 191 |
- if err != nil {
|
|
| 191 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 192 | 192 |
return err |
| 193 | 193 |
} |
| 194 | 194 |
} |
| ... | ... |
@@ -202,7 +203,7 @@ func deleteDeploymentConfigs(client osclient.Interface, ns string) error {
|
| 202 | 202 |
} |
| 203 | 203 |
for i := range items.Items {
|
| 204 | 204 |
err := client.DeploymentConfigs(ns).Delete(items.Items[i].Name) |
| 205 |
- if err != nil {
|
|
| 205 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 206 | 206 |
return err |
| 207 | 207 |
} |
| 208 | 208 |
} |
| ... | ... |
@@ -216,7 +217,7 @@ func deleteBuilds(client osclient.Interface, ns string) error {
|
| 216 | 216 |
} |
| 217 | 217 |
for i := range items.Items {
|
| 218 | 218 |
err := client.Builds(ns).Delete(items.Items[i].Name) |
| 219 |
- if err != nil {
|
|
| 219 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 220 | 220 |
return err |
| 221 | 221 |
} |
| 222 | 222 |
} |
| ... | ... |
@@ -230,7 +231,7 @@ func deleteBuildConfigs(client osclient.Interface, ns string) error {
|
| 230 | 230 |
} |
| 231 | 231 |
for i := range items.Items {
|
| 232 | 232 |
err := client.BuildConfigs(ns).Delete(items.Items[i].Name) |
| 233 |
- if err != nil {
|
|
| 233 |
+ if err != nil && !errors.IsNotFound(err) {
|
|
| 234 | 234 |
return err |
| 235 | 235 |
} |
| 236 | 236 |
} |