diff --git a/openshift/ansiblegen/examples/k8s_v1_horizontal_pod_autoscaler.yml b/openshift/ansiblegen/examples/k8s_v1_horizontal_pod_autoscaler.yml index f0fdbe4b..7dbd44ec 100644 --- a/openshift/ansiblegen/examples/k8s_v1_horizontal_pod_autoscaler.yml +++ b/openshift/ansiblegen/examples/k8s_v1_horizontal_pod_autoscaler.yml @@ -5,9 +5,9 @@ tasks: - create: name: test-scaler namespace: test - scale_target_ref_kind: ReplicaSet - scale_target_ref_name: test - min_replicas: 2 - max_replicas: 5 + spec_scale_target_ref_kind: ReplicaSet + spec_scale_target_ref_name: test + spec_min_replicas: 2 + spec_max_replicas: 5 # target_cpu_utilization_percentage: 50 name: Create replica set diff --git a/openshift/ansiblegen/examples/k8s_v1_persistent_volume.yml b/openshift/ansiblegen/examples/k8s_v1_persistent_volume.yml index 9bbb2776..e4d1b5c9 100644 --- a/openshift/ansiblegen/examples/k8s_v1_persistent_volume.yml +++ b/openshift/ansiblegen/examples/k8s_v1_persistent_volume.yml @@ -5,10 +5,10 @@ admin: yes tasks: - create: name: mypv - capacity: + spec_capacity: storage: '1Gi' - access_modes: + spec_access_modes: - ReadWriteOnce - persistent_volume_reclaim_policy: Recycle - host_path_path: /tmp/test_volume + spec_persistent_volume_reclaim_policy: Recycle + spec_host_path_path: /tmp/test_volume name: Create persitent volume diff --git a/openshift/ansiblegen/examples/k8s_v1_persistent_volume_claim.yml b/openshift/ansiblegen/examples/k8s_v1_persistent_volume_claim.yml index f32fb0db..c5b9e06b 100644 --- a/openshift/ansiblegen/examples/k8s_v1_persistent_volume_claim.yml +++ b/openshift/ansiblegen/examples/k8s_v1_persistent_volume_claim.yml @@ -5,8 +5,8 @@ tasks: - create: name: mypvc namespace: demo_project - access_modes: + spec_access_modes: - ReadWriteOnce - resources_requests: + spec_resources_requests: storage: 1Gi name: Create persitent volume claim diff --git a/openshift/ansiblegen/examples/k8s_v1_service.yml b/openshift/ansiblegen/examples/k8s_v1_service.yml index 2ea242d2..8b8015a1 100644 --- a/openshift/ansiblegen/examples/k8s_v1_service.yml +++ b/openshift/ansiblegen/examples/k8s_v1_service.yml @@ -5,48 +5,48 @@ tasks: - create: name: myservice namespace: k8s-project - selector: + spec_selector: app: django - ports: + spec_ports: - port: 8765 target_port: 8000 name: http-port - type: ClusterIP + spec_type: ClusterIP name: Create service - patch: name: myservice namespace: k8s-project - selector: + spec_selector: app: django env: production - ports: + spec_ports: - port: 8765 target_port: 8010 name: http-port - port: 8788 target_port: 8080 name: socket-port - type: ClusterIP + spec_type: ClusterIP name: Patch service - create: name: myservice01 namespace: k8s-project - selector: + spec_selector: app_name: service_testing app_env: production - ports: + spec_ports: - port: 8888 target_port: 8010 name: http - type: ClusterIP + spec_type: ClusterIP name: Create service - patch: name: myservice01 namespace: k8s-project - ports: + spec_ports: - port: 9443 target_port: 9443 name: https @@ -58,15 +58,15 @@ tasks: - replace: name: myservice01 namespace: k8s-project - selector: + spec_selector: app_name: web_site app_env: testing - ports: + spec_ports: - port: 9999 target_port: 9999 name: https - port: 8080 target_port: 8080 name: http - type: NodePort + spec_type: NodePort name: Repace service diff --git a/openshift/ansiblegen/examples/k8s_v1beta1_replica_set.yml b/openshift/ansiblegen/examples/k8s_v1beta1_replica_set.yml index 72fd0470..7e16f25e 100644 --- a/openshift/ansiblegen/examples/k8s_v1beta1_replica_set.yml +++ b/openshift/ansiblegen/examples/k8s_v1beta1_replica_set.yml @@ -5,14 +5,14 @@ tasks: - create: name: myreplicaset namespace: test - replicas: 3 + spec_replicas: 3 # spec_selector_match_labels: # name: myreplicaset # spec_selector_match_expressions: # - {key: name, operator: In, values: [myreplicaset]} spec_template_metadata_labels: name: myreplicaset - containers: + spec_template_spec_containers: - name: myreplicaset image: openshift/origin-ruby-sample:v1.0 name: Create replica set diff --git a/openshift/ansiblegen/examples/k8s_v1beta1_stateful_set.yml b/openshift/ansiblegen/examples/k8s_v1beta1_stateful_set.yml index bb59d24e..4ef9e41e 100644 --- a/openshift/ansiblegen/examples/k8s_v1beta1_stateful_set.yml +++ b/openshift/ansiblegen/examples/k8s_v1beta1_stateful_set.yml @@ -10,13 +10,13 @@ tasks: labels: name: test namespace: test - service_name: test - replicas: 3 + spec_service_name: test + spec_replicas: 3 spec_template_metadata_labels: name: test spec_template_metadata_name: test - termination_grace_period_seconds: 10 - containers: + spec_template_spec_termination_grace_period_seconds: 10 + spec_template_spec_containers: - name: test image: openshift/origin-ruby-sample:v1.0 name: Create stateful set diff --git a/openshift/ansiblegen/examples/openshift_v1_deployment_config.yml b/openshift/ansiblegen/examples/openshift_v1_deployment_config.yml index dd2ffa2c..c710204b 100644 --- a/openshift/ansiblegen/examples/openshift_v1_deployment_config.yml +++ b/openshift/ansiblegen/examples/openshift_v1_deployment_config.yml @@ -7,17 +7,17 @@ tasks: namespace: k8s-project spec_template_metadata_labels: name: frontend - containers: + spec_template_spec_containers: - name: helloworld image: openshift/origin-ruby-sample ports: - container_port: 8080 protocol: TCP name: http-port - replicas: 5 - selector: + spec_replicas: 5 + spec_selector: name: frontend - triggers: + spec_triggers: - type: ConfigChange - type: ImageChange image_change_params: @@ -35,14 +35,14 @@ tasks: namespace: k8s-project spec_template_metadata_labels: name: frontend - containers: + spec_template_spec_containers: - name: helloworld image: "openshift/origin-ruby-sample:v1.0" ports: - container_port: 9000 protocol: UDP name: udp-port - replicas: 3 + spec_replicas: 3 name: Patch deployment config - replace: @@ -50,17 +50,17 @@ tasks: namespace: k8s-project spec_template_metadata_labels: name: frontend_app - containers: + spec_template_spec_containers: - name: helloworld image: openshift/origin-ruby-sample:v2 ports: - container_port: 8888 protocol: TCP name: http-port - replicas: 2 - selector: + spec_replicas: 2 + spec_selector: name: frontend_app - triggers: + spec_triggers: - type: ConfigChange - type: ImageChange image_change_params: @@ -70,7 +70,7 @@ tasks: _from: kind: ImageStreamTag name: "origin-ruby-sample:v2" - strategy_type: Rolling + spec_strategy_type: Rolling name: Replace deployment config - remove: diff --git a/openshift/ansiblegen/examples/openshift_v1_route.yml b/openshift/ansiblegen/examples/openshift_v1_route.yml index 9de34edc..d5547390 100644 --- a/openshift/ansiblegen/examples/openshift_v1_route.yml +++ b/openshift/ansiblegen/examples/openshift_v1_route.yml @@ -8,19 +8,19 @@ tasks: - create: name: myroute namespace: k8s-project - host: www.example.com + spec_host: www.example.com spec_to_kind: Service spec_to_name: service-name - tls_termination: edge - tls_key: |- + spec_tls_termination: edge + spec_tls_key: |- -----BEGIN PRIVATE KEY----- key_file_contents -----END PRIVATE KEY----- - tls_certificate: |- + spec_tls_certificate: |- -----BEGIN CERTIFICATE----- certificate contents -----END CERTIFICATE----- - tls_ca_certificate: |- + spec_tls_ca_certificate: |- -----BEGIN CERTIFICATE----- ca_certificate_contents -----END CERTIFICATE----- @@ -29,8 +29,8 @@ tasks: - patch: name: myroute namespace: k8s-project - host: www.example.com - tls_termination: reencrypt + spec_host: www.example.com + spec_tls_termination: reencrypt spec_to_kind: Service spec_to_name: other-service-name name: Patch route @@ -38,11 +38,11 @@ tasks: - replace: name: myroute namespace: k8s-project - host: www.example.com - path: /foo/bar/baz.html + spec_host: www.example.com + spec_path: /foo/bar/baz.html spec_to_kind: Service spec_to_name: whimsy-name - tls_termination: edge + spec_tls_termination: edge name: Replace route - remove: diff --git a/openshift/helper/ansible.py b/openshift/helper/ansible.py index 4a1d2ec2..81293d84 100644 --- a/openshift/helper/ansible.py +++ b/openshift/helper/ansible.py @@ -606,8 +606,6 @@ def add_meta(prop_name, prop_prefix, prop_alt_prefix): if prop_alt_prefix != prop_prefix: if prop_alt_prefix: args[prop_prefix + prop_name]['aliases'] = [prop_alt_prefix + prop_name] - elif prop_prefix: - args[prop_prefix + prop_name]['aliases'] = [prop_name] prop_paths = copy.copy(path) # copy path from outer scope prop_paths.append('metadata') prop_paths.append(prop_name) @@ -705,8 +703,6 @@ def add_meta(prop_name, prop_prefix, prop_alt_prefix): # Use the alternate prefix to construct a human-friendly alias if arg_alt_prefix and arg_prefix != arg_alt_prefix: args[arg_prefix + prop]['aliases'] = [arg_alt_prefix + prop] - elif arg_prefix: - args[arg_prefix + prop]['aliases'] = [prop] if prop == 'type': choices = self.__convert_params_to_choices(properties)