Skip to content

Commit

Permalink
Merge pull request #9 from hickeyma/fix/add-auth-kinds
Browse files Browse the repository at this point in the history
feat(common): Add kind mappings
  • Loading branch information
hickeyma authored May 5, 2020
2 parents d386dc8 + 1a32ace commit a9aaa77
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
44 changes: 31 additions & 13 deletions pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,37 @@ type MapOptions struct {
const UpgradeDescription = "Kubernetes deprecated API upgrade - DO NOT rollback from this version"

var mappedAPIs = map[string]string{
"apiVersion: extensions/v1beta1\nkind: NetworkPolicy": "apiVersion: networking.k8s.io/v1\nkind: NetworkPolicy",
"apiVersion: extensions/v1beta1\nkind: PodSecurityPolicy": "apiVersion: policy/v1beta1\nkind: PodSecurityPolicy",
"apiVersion: extensions/v1beta1\nkind: DaemonSet": "apiVersion: apps/v1\nkind: DaemonSet",
"apiVersion: apps/v1beta2\nkind: DaemonSet": "apiVersion: apps/v1\nkind: DaemonSet",
"apiVersion: extensions/v1beta1\nkind: Deployment": "apiVersion: apps/v1\nkind: Deployment",
"apiVersion: apps/v1beta1\nkind: Deployment": "apiVersion: apps/v1\nkind: Deployment",
"apiVersion: apps/v1beta2\nkind: Deployment": "apiVersion: apps/v1\nkind: Deployment",
"apiVersion: apps/v1beta1\nkind: StatefulSet": "apiVersion: apps/v1\nkind: StatefulSet",
"apiVersion: apps/v1beta2\nkind: StatefulSet": "apiVersion: apps/v1\nkind: StatefulSet",
"apiVersion: extensions/v1beta1\nkind: ReplicaSet": "apiVersion: apps/v1\nkind: ReplicaSet",
"apiVersion: apps/v1beta1\nkind: ReplicaSet": "apiVersion: apps/v1\nkind: ReplicaSet",
"apiVersion: apps/v1beta2\nkind: ReplicaSet": "apiVersion: apps/v1\nkind: ReplicaSet",
"apiVersion: extensions/v1beta1\nkind: Ingress": "apiVersion: networking.k8s.io/v1beta1\nkind: Ingress"}
"apiVersion: extensions/v1beta1\nkind: Deployment": "apiVersion: apps/v1\nkind: Deployment",
"apiVersion: apps/v1beta1\nkind: Deployment": "apiVersion: apps/v1\nkind: Deployment",
"apiVersion: apps/v1beta2\nkind: Deployment": "apiVersion: apps/v1\nkind: Deployment",
"apiVersion: apps/v1beta1\nkind: StatefulSet": "apiVersion: apps/v1\nkind: StatefulSet",
"apiVersion: apps/v1beta2\nkind: StatefulSet": "apiVersion: apps/v1\nkind: StatefulSet",
"apiVersion: extensions/v1beta1\nkind: DaemonSet": "apiVersion: apps/v1\nkind: DaemonSet",
"apiVersion: apps/v1beta2\nkind: DaemonSet": "apiVersion: apps/v1\nkind: DaemonSet",
"apiVersion: extensions/v1beta1\nkind: ReplicaSet": "apiVersion: apps/v1\nkind: ReplicaSet",
"apiVersion: apps/v1beta1\nkind: ReplicaSet": "apiVersion: apps/v1\nkind: ReplicaSet",
"apiVersion: apps/v1beta2\nkind: ReplicaSet": "apiVersion: apps/v1\nkind: ReplicaSet",
"apiVersion: extensions/v1beta1\nkind: NetworkPolicy": "apiVersion: networking.k8s.io/v1\nkind: NetworkPolicy",
"apiVersion: extensions/v1beta1\nkind: PodSecurityPolicy": "apiVersion: policy/v1beta1\nkind: PodSecurityPolicy",
"apiVersion: apiextensions.k8s.io/v1beta1\nkind: CustomResourceDefinition": "apiVersion: apiextensions.k8s.io/v1\nkind: CustomResourceDefinition",
"apiVersion: extensions/v1beta1\nkind: Ingress": "apiVersion: networking.k8s.io/v1beta1\nkind: Ingress",
"apiVersion: rbac.authorization.k8s.io/v1alpha1\nkind: ClusterRole": "apiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRole",
"apiVersion: rbac.authorization.k8s.io/v1alpha1\nkind: ClusterRoleList": "apiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleList",
"apiVersion: rbac.authorization.k8s.io/v1alpha1\nkind: ClusterRoleBinding": "apiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBinding",
"apiVersion: rbac.authorization.k8s.io/v1alpha1\nkind: ClusterRoleBindingList": "apiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBindingList",
"apiVersion: rbac.authorization.k8s.io/v1alpha1\nkind: Role": "apiVersion: rbac.authorization.k8s.io/v1\nkind: Role",
"apiVersion: rbac.authorization.k8s.io/v1alpha1\nkind: RoleList": "apiVersion: rbac.authorization.k8s.io/v1\nkind: RoleList",
"apiVersion: rbac.authorization.k8s.io/v1alpha1\nkind: RoleBinding": "apiVersion: rbac.authorization.k8s.io/v1\nkind: RoleBinding",
"apiVersion: rbac.authorization.k8s.io/v1alpha1\nkind: RoleBindingList": "apiVersion: rbac.authorization.k8s.io/v1\nkind: RoleBindingList",
"apiVersion: rbac.authorization.k8s.io/v1beta1\nkind: ClusterRole": "apiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRole",
"apiVersion: rbac.authorization.k8s.io/v1beta1\nkind: ClusterRoleList": "apiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleList",
"apiVersion: rbac.authorization.k8s.io/v1beta1\nkind: ClusterRoleBinding": "apiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBinding",
"apiVersion: rbac.authorization.k8s.io/v1beta1\nkind: ClusterRoleBindingList": "apiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBindingList",
"apiVersion: rbac.authorization.k8s.io/v1beta1\nkind: Role": "apiVersion: rbac.authorization.k8s.io/v1\nkind: Role",
"apiVersion: rbac.authorization.k8s.io/v1beta1\nkind: RoleList": "apiVersion: rbac.authorization.k8s.io/v1\nkind: RoleList",
"apiVersion: rbac.authorization.k8s.io/v1beta1\nkind: RoleBinding": "apiVersion: rbac.authorization.k8s.io/v1\nkind: RoleBinding",
"apiVersion: rbac.authorization.k8s.io/v1beta1\nkind: RoleBindingList": "apiVersion: rbac.authorization.k8s.io/v1\nkind: RoleBindingList",
}

// ReplaceManifestUnSupportedAPIs returns a release manifest with deprecated or removed
// Kubernetes APIs updated to supported APIs
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "mapkubeapis"
version: "0.0.8"
version: "0.0.9"
usage: "Map release deprecated Kubernetes APIs in-place"
description: "Map release deprecated Kubernetes APIs in-place"
command: "$HELM_PLUGIN_DIR/bin/mapkubeapis"
Expand Down

0 comments on commit a9aaa77

Please sign in to comment.