Skip to content

Instantly share code, notes, and snippets.

@danehans
Last active September 26, 2018 19:15
Show Gist options
  • Save danehans/7f1ea3831bf8a767ac3b43dd53b22092 to your computer and use it in GitHub Desktop.
Save danehans/7f1ea3831bf8a767ac3b43dd53b22092 to your computer and use it in GitHub Desktop.
k8s_fed_v2_prop_ver_plugin_testing
# After e2e test "Create". Notice that all the prop versions are correct:
$ kubectl get clusterpropagatedversion/clusterrole-test-crud-nfshf -o yaml
apiVersion: core.federation.k8s.io/v1alpha1
kind: ClusterPropagatedVersion
metadata:
creationTimestamp: 2018-09-26T18:26:23Z
generation: 1
name: clusterrole-test-crud-nfshf
resourceVersion: "112821"
selfLink: /apis/core.federation.k8s.io/v1alpha1/clusterpropagatedversions/clusterrole-test-crud-nfshf
uid: abd7b3e2-c1b9-11e8-b018-42010a8a0002
spec: {}
status:
clusterVersions:
- clusterName: cluster1
version: "112751"
- clusterName: cluster2
version: "108090"
templateVersion: "112750"
$ kubectl get federatedclusterroles/test-crud-nfshf -o yaml
apiVersion: core.federation.k8s.io/v1alpha1
kind: FederatedClusterRole
metadata:
creationTimestamp: 2018-09-26T18:25:41Z
finalizers:
- federation.kubernetes.io/delete-from-underlying-clusters
- orphan
generateName: test-crud-
generation: 1
name: test-crud-nfshf
resourceVersion: "112750"
selfLink: /apis/core.federation.k8s.io/v1alpha1/federatedclusterroles/test-crud-nfshf
uid: 92ccfc98-c1b9-11e8-b018-42010a8a0002
spec:
template:
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
$ kubectl get clusterroles/test-crud-nfshf -o yaml --context cluster1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: 2018-09-26T18:26:10Z
name: test-crud-nfshf
resourceVersion: "112751"
selfLink: /apis/rbac.authorization.k8s.io/v1/clusterroles/test-crud-nfshf
uid: a4965630-c1b9-11e8-b018-42010a8a0002
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
$ kubectl get clusterroles/test-crud-nfshf -o yaml --context cluster2
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: 2018-09-26T18:26:10Z
name: test-crud-nfshf
resourceVersion: "108090"
selfLink: /apis/rbac.authorization.k8s.io/v1/clusterroles/test-crud-nfshf
uid: a477c9af-c1b9-11e8-b41d-42010a8a0003
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
// After e2e test "Update". Notice the annotation gets set properly and the resourceVersion gets updated from "112750"
// to "113514".
$ kubectl get federatedclusterroles/test-crud-nfshf -o yaml
apiVersion: core.federation.k8s.io/v1alpha1
kind: FederatedClusterRole
metadata:
annotations:
federation.kubernetes.io/test-federation-crud-update: updated
creationTimestamp: 2018-09-26T18:25:41Z
finalizers:
- federation.kubernetes.io/delete-from-underlying-clusters
- orphan
generateName: test-crud-
generation: 1
name: test-crud-nfshf
resourceVersion: "113514"
selfLink: /apis/core.federation.k8s.io/v1alpha1/federatedclusterroles/test-crud-nfshf
uid: 92ccfc98-c1b9-11e8-b018-42010a8a0002
spec:
template:
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
// However, the cluster prop ver does not get updated:
$ kubectl get clusterpropagatedversion/clusterrole-test-crud-nfshf -o yaml
apiVersion: core.federation.k8s.io/v1alpha1
kind: ClusterPropagatedVersion
metadata:
creationTimestamp: 2018-09-26T18:26:23Z
generation: 1
name: clusterrole-test-crud-nfshf
resourceVersion: "112821"
selfLink: /apis/core.federation.k8s.io/v1alpha1/clusterpropagatedversions/clusterrole-test-crud-nfshf
uid: abd7b3e2-c1b9-11e8-b018-42010a8a0002
spec: {}
status:
clusterVersions:
- clusterName: cluster1
version: "112751"
- clusterName: cluster2
version: "108090"
templateVersion: "112750"
// Therefore the cluster role resources in cluster1/cluster2 do not get updated:
$ kubectl get clusterroles/test-crud-nfshf -o yaml --context cluster1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: 2018-09-26T18:26:10Z
name: test-crud-nfshf
resourceVersion: "112751"
selfLink: /apis/rbac.authorization.k8s.io/v1/clusterroles/test-crud-nfshf
uid: a4965630-c1b9-11e8-b018-42010a8a0002
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
$ kubectl get clusterroles/test-crud-nfshf -o yaml --context cluster2
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: 2018-09-26T18:26:10Z
name: test-crud-nfshf
resourceVersion: "108090"
selfLink: /apis/rbac.authorization.k8s.io/v1/clusterroles/test-crud-nfshf
uid: a477c9af-c1b9-11e8-b41d-42010a8a0003
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment