Skip to content

Commit 6bf44ce

Browse files
authored
Update to Kubernetes v1.18.3 (#1149)
Signed-off-by: 1gtm <1gtm@appscode.com>
1 parent bcbb3a9 commit 6bf44ce

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ require (
3434
k8s.io/client-go v12.0.0+incompatible
3535
k8s.io/kube-aggregator v0.18.3
3636
k8s.io/kubernetes v1.18.3
37-
kmodules.xyz/client-go v0.0.0-20200713013004-81c7c59b7cfa
37+
kmodules.xyz/client-go v0.0.0-20200714060506-0b57b4060595
3838
kmodules.xyz/constants v0.0.0-20200506032633-a21e58ceec72
3939
kmodules.xyz/custom-resources v0.0.0-20200604135349-9e9f5c4fdba9
4040
kmodules.xyz/objectstore-api v0.0.0-20200521103120-92080446e04d

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,8 @@ kmodules.xyz/client-go v0.0.0-20200525195850-2fd180961371 h1:PPawDOMyDHGeDPN8j1e
980980
kmodules.xyz/client-go v0.0.0-20200525195850-2fd180961371/go.mod h1:sY/eoe4ktxZEoHpr5NpAQ5s22VSwTE8psJtKVeVgLRY=
981981
kmodules.xyz/client-go v0.0.0-20200630053911-20d035822d35 h1:gDzZWVvgAaEBzo4lxMGhPUWqySgFyFDkcqw3NskZiwQ=
982982
kmodules.xyz/client-go v0.0.0-20200630053911-20d035822d35/go.mod h1:sY/eoe4ktxZEoHpr5NpAQ5s22VSwTE8psJtKVeVgLRY=
983-
kmodules.xyz/client-go v0.0.0-20200713013004-81c7c59b7cfa h1:yMP0egjWCvqKty8SAgyhVEjvUeM4/z5VxuU9Oo+sYGk=
984-
kmodules.xyz/client-go v0.0.0-20200713013004-81c7c59b7cfa/go.mod h1:sY/eoe4ktxZEoHpr5NpAQ5s22VSwTE8psJtKVeVgLRY=
983+
kmodules.xyz/client-go v0.0.0-20200714060506-0b57b4060595 h1:KgvN4M8VbHU6JV4rgYzsUKYhUtF1uCt//dLOyEdG330=
984+
kmodules.xyz/client-go v0.0.0-20200714060506-0b57b4060595/go.mod h1:sY/eoe4ktxZEoHpr5NpAQ5s22VSwTE8psJtKVeVgLRY=
985985
kmodules.xyz/constants v0.0.0-20200506032633-a21e58ceec72 h1:0sM6nE7aJon/PSdqZTj0bKJlPyzobXkG0wVYKpjcJJE=
986986
kmodules.xyz/constants v0.0.0-20200506032633-a21e58ceec72/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY=
987987
kmodules.xyz/crd-schema-fuzz v0.0.0-20200521005638-2433a187de95/go.mod h1:jpu8xFsDKd6kAWUAKk8oTu/GQGBWqhrcaDeOJdaCJnk=

vendor/kmodules.xyz/client-go/dynamic/kubernetes.go

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,3 +327,62 @@ func EnsureOwnerReferenceForSelector(
327327
}
328328
return utilerrors.NewAggregate(errs)
329329
}
330+
331+
func ResourceExists(
332+
ctx context.Context,
333+
c dynamic.Interface,
334+
gvr schema.GroupVersionResource,
335+
namespace string,
336+
name string,
337+
) (bool, error) {
338+
var ri dynamic.ResourceInterface
339+
if namespace == "" {
340+
ri = c.Resource(gvr)
341+
} else {
342+
ri = c.Resource(gvr).Namespace(namespace)
343+
}
344+
_, err := ri.Get(ctx, name, metav1.GetOptions{})
345+
if err != nil {
346+
if kerr.IsNotFound(err) {
347+
return false, nil
348+
}
349+
return false, err
350+
}
351+
return true, nil
352+
}
353+
354+
func ResourcesExists(
355+
c dynamic.Interface,
356+
gvr schema.GroupVersionResource,
357+
namespace string,
358+
names ...string,
359+
) (bool, error) {
360+
for _, name := range names {
361+
ok, err := ResourceExists(context.TODO(), c, gvr, namespace, name)
362+
if err != nil {
363+
return false, err
364+
}
365+
if !ok {
366+
return false, nil
367+
}
368+
}
369+
return true, nil
370+
}
371+
372+
func ResourcesNotExists(
373+
c dynamic.Interface,
374+
gvr schema.GroupVersionResource,
375+
namespace string,
376+
names ...string,
377+
) (bool, error) {
378+
for _, name := range names {
379+
ok, err := ResourceExists(context.TODO(), c, gvr, namespace, name)
380+
if err != nil {
381+
return false, err
382+
}
383+
if ok {
384+
return false, nil
385+
}
386+
}
387+
return true, nil
388+
}

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ k8s.io/utils/net
10441044
k8s.io/utils/path
10451045
k8s.io/utils/pointer
10461046
k8s.io/utils/trace
1047-
# kmodules.xyz/client-go v0.0.0-20200713013004-81c7c59b7cfa
1047+
# kmodules.xyz/client-go v0.0.0-20200714060506-0b57b4060595
10481048
kmodules.xyz/client-go
10491049
kmodules.xyz/client-go/admissionregistration/v1beta1
10501050
kmodules.xyz/client-go/api/v1

0 commit comments

Comments
 (0)