Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sumup-oss/janos
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: pgold30/janos
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 7 commits
  • 3 files changed
  • 2 contributors

Commits on Jan 25, 2023

  1. Remove sumup

    pgold30 authored Jan 25, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c9f0ece View commit details
  2. Update README.md

    pgold30 authored Jan 25, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    09f0fc4 View commit details

Commits on Jan 26, 2023

  1. Copy the full SHA
    65f1af4 View commit details
  2. remove references

    pgold30 committed Jan 26, 2023
    Copy the full SHA
    552db1c View commit details
  3. add conversions for 1.22

    pgold30 committed Jan 26, 2023
    Copy the full SHA
    9fbbc1d View commit details
  4. format

    pgold30 authored Jan 26, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1236231 View commit details
  5. typo

    pgold30 authored Jan 26, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    66fb37c View commit details
Showing with 92 additions and 16 deletions.
  1. +1 −1 CONTRIBUTING.md
  2. +23 −13 README.md
  3. +68 −2 src/migration.js
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

## Prerequisites

To start contributing to SumUp Open Source projects, please accept our [Contributor License Agreement](https://opensource.sumup.com/cla). Should you have any questions or concerns, please get in touch with [opensource@sumup.com](mailto:opensource@sumup.com).
To start contributing to SumUp Open Source projects, please accept our [Contributor License Agreement](https://opensource.sumup.com/cla).

## Code of Conduct (CoC)

36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ Janos is a K8s migration tool that update your manifests in order to be compatib
- [Installation](#installation)
- [Usage](#usage)
- [List of Changes](#list-of-changes)
- [About SumUp](#about-sumup)
- [More Info](#more-info)

## Overview
Janos will convert all your manifest files, updating it inplace. If you pass a directory as a parameter, it will do a recursive search. All comments are removed, and the file formatting may change.
@@ -47,22 +47,32 @@ janos {-d|-f}
All the rules are in the file migration.js.

## List of Changes
- 1.16: for Kind: Deployment |Daemonset |Statefulset |ReplicaSet Replace for extensions/v1beta1 | apps/v1beta1 | apps/v1beta2 with apps/v1
- 1.16: for Kind: Deployment |Daemonset |Statefulset |ReplicaSet Replace: extensions/v1beta1 | apps/v1beta1 | apps/v1beta2 with apps/v1
- 1.16: for Kind: Ingress. Replace: extensions/v1beta1 with networking.k8s.io/v1beta1
- 1.16: for Kind: PodSecurityPolicy. Replace: extensions/v1beta1 |apps/v1beta2 with policy/v1beta1
- 1.16: Generates the now required spec.selector for Kind Deployment |Daemonset |Statefulset |ReplicaSet (using matchLabels app name, you can read more about these here), only if it doesn't exist
- 1.17: for Kinds:Role |ClusterRole |RoleBinding |ClusterRoleBinding: Replace rbac.authorization.k8s.io/v1alpha1 | rbac.authorization.k8s.io/v1beta1 with rbac.authorization.k8s.io/v1
- 1.19: for Kind: HorizontalPodAutoscaler. Replace: autoscaling/v2beta1 with autoscaling/v2beta2
- 1.21: for ValidatingWebhookConfiguration and MutatingWebhookConfiguration: Replace admissionregistration.k8s.io/v1beta1 with admissionregistration.k8s.io/v1
- 1.21: for CustomResourceDefinition |TokenReview |SubjectAccessReview |LocalSubjectAccessReview |SelfSubjectAccessReview: Replace apiextensions.k8s.io/v1beta1 with apiextensions.k8s.io/v1
- 1.21: for CertificateSigningRequest: Replace certificates.k8s.io/v1beta1 with certificates.k8s.io/v1
- 1.21: for Lease: Replace coordination.k8s.io/v1beta1 with coordination.k8s.io/v1
- 1.21: for Ingress: Replace extensions/v1beta1 |networking.k8s.io/v1beta1 with networking.k8s.io/v1
- 1.21: for RBAC: Replace rbac.authorization.k8s.io/v1beta1 with rbac.authorization.k8s.io/v1
- 1.21: for PriorityClasss: Replace scheduling.k8s.io/v1beta1 with scheduling.k8s.io/v1
- 1.21: for CSIDriver, CSINode and StorageClass: Replace VolumeAttachmentstorage.k8s.io/v1beta1 with storage.k8s.io/v1

## More Info
There is more information about other changes here :). Thanks https://marcincuber.medium.com/

* [1.16 to 1.17](https://marcincuber.medium.com/amazon-eks-upgrade-journey-from-1-16-to-1-17-cb9e88191165)
* [1.17 to 1.18](https://marcincuber.medium.com/amazon-eks-upgrade-journey-from-1-17-to-1-18-e35e134ca898)
* [1.18 to 1.19](https://marcincuber.medium.com/amazon-eks-upgrade-journey-from-1-18-to-1-19-cca82de84333)
* [1.19 to 1.20](https://marcincuber.medium.com/amazon-eks-upgrade-journey-from-1-19-to-1-20-78c9a7edddb5)
* [1.20 to 1.21](https://marcincuber.medium.com/amazon-eks-upgrade-journey-from-1-20-to-1-21-caf1475deaa4)
* [1.21 to 1.22](https://marcincuber.medium.com/amazon-eks-upgrade-journey-from-1-21-to-1-22-9546da932af6)
* [1.22 to 1.23](https://marcincuber.medium.com/amazon-eks-upgrade-journey-from-1-22-to-1-23-3b9eaa8c57de)
* [1.23 to 1.24](https://marcincuber.medium.com/amazon-eks-upgrade-journey-from-1-23-to-1-24-b7b0b1afa5b4)

### Maintainers

- [Denis Policastro](mailto:denis.policastro@sumup.com)
- [Pablo Loschi](mailto:pablo.loschi@sumup.com)

## About SumUp

![SumUp logo](https://raw.githubusercontent.com/sumup-oss/assets/master/sumup-logo.svg?sanitize=true)

[SumUp](https://sumup.com) is a mobile-point of sale provider. It is our mission to make easy and fast card payments a reality across the *entire* world. You can pay with SumUp in more than 30 countries, already. Our engineers work in Berlin, Cologne, Sofia, and Sāo Paulo. They write code in JavaScript, Swift, Ruby, Go, Java, Erlang, Elixir, and more.

Want to come work with us? [Head to our careers page](https://sumup.com/careers) to find out more.
- [Pablo Loschi](mailto:loschi.pablo@gmail.com)
70 changes: 68 additions & 2 deletions src/migration.js
Original file line number Diff line number Diff line change
@@ -54,15 +54,45 @@ function replaceDeprecatedAPIs(resource) {
break;

case 'Ingress':
legacyAPIs = ['extensions/v1beta1'];
legacyAPIs = ['extensions/v1beta1', 'networking.k8s.io/v1beta1 '];
if (legacyAPIs.includes(result.apiVersion)) {
console.log(
`Replace apiVersion for "${resource.kind}" - "${resource.metadata.name}"`,
);
result.apiVersion = 'networking.k8s.io/v1beta1';
result.apiVersion = 'networking.k8s.io/v1';
}
break;

case 'CertificateSigningRequest':
legacyAPIs = ['certificates.k8s.io/v1beta1'];
if (legacyAPIs.includes(result.apiVersion)) {
console.log(
`Replace apiVersion for "${resource.kind}" - "${resource.metadata.name}"`,
);
result.apiVersion = 'certificates.k8s.io/v1';
}
break;

case 'PriorityClasss':
legacyAPIs = ['scheduling.k8s.io/v1beta1'];
if (legacyAPIs.includes(result.apiVersion)) {
console.log(
`Replace apiVersion for "${resource.kind}" - "${resource.metadata.name}"`,
);
result.apiVersion = 'scheduling.k8s.io/v1';
}
break;

case 'Lease':
legacyAPIs = ['coordination.k8s.io/v1beta1'];
if (legacyAPIs.includes(result.apiVersion)) {
console.log(
`Replace apiVersion for "${resource.kind}" - "${resource.metadata.name}"`,
);
result.apiVersion = 'coordination.k8s.io/v1';
}
break;

case 'Role':
case 'RoleBinding':
case 'ClusterRole':
@@ -78,6 +108,42 @@ function replaceDeprecatedAPIs(resource) {
result.apiVersion = 'rbac.authorization.k8s.io/v1';
}
break;

case 'CustomResourceDefinition':
case 'TokenReview':
case 'SubjectAccessReview':
case 'LocalSubjectAccessReview':
legacyAPIs = ['apiextensions.k8s.io/v1beta1'];
if (legacyAPIs.includes(result.apiVersion)) {
console.log(
`Replace apiVersion for "${resource.kind}" - "${resource.metadata.name}"`,
);
result.apiVersion = 'apiextensions.k8s.io/v1';
}

case 'ValidatingWebhookConfiguration':
case 'MutatingWebhookConfiguration':
legacyAPIs = ['admissionregistration.k8s.io/v1beta1'];
if (legacyAPIs.includes(result.apiVersion)) {
console.log(
`Replace apiVersion for "${resource.kind}" - "${resource.metadata.name}"`,
);
result.apiVersion = 'admissionregistration.k8s.io/v1';
}

case 'CSIDriver':
case 'CSINode':
case 'StorageClass':
legacyAPIs = ['VolumeAttachmentstorage.k8s.io/v1beta1'];
if (legacyAPIs.includes(result.apiVersion)) {
console.log(
`Replace apiVersion for "${resource.kind}" - "${resource.metadata.name}"`,
);
result.apiVersion = 'storage.k8s.io/v1';
}

break;

default:
}