Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

replicas set to 0 if not specified #357

Closed
kadel opened this issue Oct 13, 2017 · 4 comments · Fixed by #361
Closed

replicas set to 0 if not specified #357

kadel opened this issue Oct 13, 2017 · 4 comments · Fixed by #361

Comments

@kadel
Copy link
Member

kadel commented Oct 13, 2017

If replicas is not set in Kedge file, the generated output shouldn't have it either.

Now it defaults to 0, which leads to a confusing situation where your containers are not started when DC id deployed.

name: foo
controller: deploymentconfig
containers:
  - image: quay.io/tomkral/sleeper
▶ ./kedge generate -f test.yaml
---
apiVersion: v1
kind: DeploymentConfig
metadata:
  creationTimestamp: null
  name: foo
spec:
  replicas: 0
  strategy:
    resources: {}
  template:
    metadata:
      creationTimestamp: null
    spec:
      containers:
      - image: quay.io/tomkral/sleeper
        name: foo
        resources: {}
  test: false
  triggers: null
status:
  availableReplicas: 0
  latestVersion: 0
  observedGeneration: 0
  replicas: 0
  unavailableReplicas: 0
  updatedReplicas: 0

replicas shouldn't be set if it's not set in Kedge file, OpenShift default will be used on the cluster side.

@surajssd
Copy link
Member

@surajssd
Copy link
Member

We are not setting the value anywhere inside the code!

@kadel
Copy link
Member Author

kadel commented Oct 13, 2017

If there is no other solution than We will have to default to 1 manually.

But we have to be careful and correctly recognize if replicas in kedge wasn't set or it was explicitly set to 0

@cdrage
Copy link
Collaborator

cdrage commented Oct 13, 2017

@kadel @surajssd

I originally had this in the code, you can access replicas by reading in the variable deploymentConfig.Replicas

Checking to see if the default is 0 and change it to 1..

concaf added a commit to concaf/kedge that referenced this issue Oct 13, 2017
Setting no value for the "replicas" field in a DeploymentConfig
sets the value as 0, while we should be setting this value as 1.

This commit fixes that.

Fixes kedgeproject#357
@concaf concaf self-assigned this Oct 13, 2017
concaf added a commit to concaf/kedge that referenced this issue Oct 13, 2017
Setting no value for the "replicas" field in a DeploymentConfig
sets the value as 0, while we should be setting this value as 1.

This commit fixes that.

Fixes kedgeproject#357
concaf added a commit to concaf/kedge that referenced this issue Oct 16, 2017
Setting no value for the "replicas" field in a DeploymentConfig
sets the value as 0, while we should be setting this value as 1.

This commit fixes that and adds tests for the behavior.

Fixes kedgeproject#357
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants