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

generated DeploymnetConfig is invalid! #352

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

generated DeploymnetConfig is invalid! #352

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

Comments

@kadel
Copy link
Member

kadel commented Oct 13, 2017

Generated DC by #315 is invalid.
Selector is missing

name: foo
controller: deploymentconfig
containers:
  - image: quay.io/tomkral/sleeper
▶ ./kedge generate -f test.yaml | oc create -f -
The DeploymentConfig "foo" is invalid: spec.selector: Invalid value: map[string]string(nil): selector cannot be empty
▶ ./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
@surajssd
Copy link
Member

I think it has to match the labels!

@kadel
Copy link
Member Author

kadel commented Oct 13, 2017

selector should match pod labels.

spec.selector = spec.template.metadata.labels

@kadel
Copy link
Member Author

kadel commented Oct 13, 2017

plus deployment config is completely missing labels. It should have autogenerated app label

@kadel
Copy link
Member Author

kadel commented Oct 13, 2017

Labels are not working at all. Even if I put labels to kedge they don't show up in DeploymentConfig

name: foo
controller: deploymentconfig
labels:
   foo: bar
containers:
  - image: quay.io/tomkral/sleeper

---
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

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.

2 participants