qbec icon indicating copy to clipboard operation
qbec copied to clipboard

fix example deployment

Open kvaps opened this issue 5 years ago • 7 comments

This PR fixes two errors in example app:

First is missing selector for the Deployment:

error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false

Second is missing name for the Job (replaces generateName):

error: from tj-: cannot use generate name with apply

kvaps avatar Sep 02 '20 21:09 kvaps

Are you using qbec show envKey | kubectl apply -f -? qbec apply should work with generateName

harsimranmaan avatar Sep 04 '20 21:09 harsimranmaan

Yes, I'm going to use qbec with Argo CD, example setup: https://github.com/argoproj/argo-cd/issues/2930#issuecomment-686048925

kvaps avatar Sep 04 '20 21:09 kvaps

I understand the changes to the deployment object but why doesn't generateName work? It is part of the k8s API spec and both kubectl and qbec honor it.

I think one of the unit tests relies on the object having a generated name which is why I cannot accept that particular change.

Happy to have you create a secondary test app under examples/ if you want to keep it tied to the qbec source tree

gotwarlost avatar Sep 05 '20 16:09 gotwarlost

I don't know, may be because I was testing it on newest 1.19

kvaps avatar Sep 05 '20 18:09 kvaps

Kubectl has a defect with first apply on generateName. I'll dig up the details. Kubectl create is recommended

harsimranmaan avatar Sep 05 '20 18:09 harsimranmaan

Possibly this https://github.com/kubernetes/kubernetes/issues/44501

harsimranmaan avatar Sep 05 '20 18:09 harsimranmaan

Codecov Report

Merging #151 (fb6b612) into master (b72657c) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #151   +/-   ##
=======================================
  Coverage   73.41%   73.41%           
=======================================
  Files          51       51           
  Lines        4300     4300           
=======================================
  Hits         3157     3157           
  Misses        966      966           
  Partials      177      177           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b72657c...fb6b612. Read the comment docs.

codecov-io avatar Jan 06 '21 10:01 codecov-io