Skip to content

Commit

Permalink
Fix fabric8io#1570: change API_APPS_VERSION to apps/v1
Browse files Browse the repository at this point in the history
Change API_APPS_VERSION to apps/v1 and move deployment fragment creation
with apps/v1 apiVersion rather than extensions
  • Loading branch information
rohanKanojia committed Mar 13, 2019
1 parent f253a34 commit 335521d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ After this we will switch probably to real [Semantic Versioning 2.0.0](http://se
* Feature 1498: Allow users to define secrets from annotations
* Feature 1498: Allow users to define secrets from annotations
* Fix 1522: Remove need to initialize DockerAccess when on Openshift
* Fix 1570: Failure in applying Deployments using fabric8-maven-plugin
* Fix 1517: update vmp groupid and vert.x version
* Feature 456: Add labels from label-schema.org to the generator images.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class KubernetesResourceUtil {

public static final String API_VERSION = "v1";
public static final String API_EXTENSIONS_VERSION = "extensions/v1beta1";
public static final String API_APPS_VERSION = "apps/v1beta1";
public static final String API_APPS_VERSION = "apps/v1";
public static final String JOB_VERSION = "batch/v1";
public static final String OPENSHIFT_V1_VERSION = "apps.openshift.io/v1";
public static final ResourceVersioning DEFAULT_RESOURCE_VERSIONING = new ResourceVersioning()
Expand Down Expand Up @@ -249,9 +249,9 @@ private static Map<String, Object> readAndEnrichFragment(PlatformMode platformMo
addKind(fragment, kind, file.getName());

String apiVersion = apiVersions.getCoreVersion();
if (Objects.equals(kind, "Deployment") || Objects.equals(kind, "Ingress")) {
if (Objects.equals(kind, "Ingress")) {
apiVersion = apiVersions.getExtensionsVersion();
} else if (Objects.equals(kind, "StatefulSet")) {
} else if (Objects.equals(kind, "StatefulSet") || Objects.equals(kind, "Deployment")) {
apiVersion = apiVersions.getAppsVersion();
} else if (Objects.equals(kind, "Job")) {
apiVersion = apiVersions.getJobVersion();
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/custom-environment/expected/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ items:
app: fabric8-maven-sample-custom-environment
provider: fabric8
group: io.fabric8
- apiVersion: extensions/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/remote-resources/expected/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ items:
app: fabric8-maven-sample-remote-resources
provider: fabric8
group: io.fabric8
- apiVersion: extensions/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/statefulset/expected/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ items:
app: fabric8-maven-sample-statefulset
provider: fabric8
group: io.fabric8
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/statefulset/expected/openshift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ items:
to:
kind: Service
name: fabric8-maven-sample-statefulset
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion it/src/it/vertx/expected/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ items:
app: fabric8-maven-sample-vertx
provider: fabric8
group: io.fabric8
- apiVersion: extensions/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
Expand Down

0 comments on commit 335521d

Please sign in to comment.