Bug 1553696 - "oc export" fails for deployment types
Summary: "oc export" fails for deployment types
Keywords:
Status: CLOSED DUPLICATE of bug 1552325
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.7.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
: 1601875 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-09 10:49 UTC by Brian Dooley
Modified: 2021-09-09 13:22 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-09 15:15:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Brian Dooley 2018-03-09 10:49:25 UTC
Description of problem:
When exporting an object with "oc export", it should be able to use the output for creating new objects. And in general it does, but not for "deployments".

Version-Release number of selected component (if applicable):
3.7.23

How reproducible:
easy

Steps to Reproduce:
1. Create a deployment file.  E.g.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: foo
spec:
  selector:
    matchLabels:
      app: foo
  replicas: 1
  template:
    metadata:
      name: foo
      labels:
        app: foo
    spec:
      containers:
      - name: pause
        image: pause:latest

2. Create the object
oc create -f foo.yaml
"deployment "foo" created"

3. Try and export it
e.g.
oc export deployment/foo | sed 's/foo/baz/g' | oc create -f -

Actual results:
$ oc export deployment/foo | sed 's/foo/baz/g' | oc create -f -
error: unable to decode "STDIN": Object 'Kind' is missing in '{"Spec":{"MinReadySeconds":0,"Paused":false,"ProgressDeadlineSeconds":null,"Replicas":1,"RevisionHistoryLimit":null,"RollbackTo":null,"Selector":{"matchLabels":{"app":"baz"}},"Strategy":{"RollingUpdate":{"MaxSurge":1,"MaxUnavailable":1},"Type":"RollingUpdate"},"Template":{"Spec":{"ActiveDeadlineSeconds":null,"Affinity":null,"AutomountServiceAccountToken":null,"Containers":[{"Args":null,"Command":null,"Env":null,"EnvFrom":null,"Image":"docker-snapshots.artrepo.vegvesen.no/gcr/pause:latest","ImagePullPolicy":"Always","Lifecycle":null,"LivenessProbe":null,"Name":"pause","Ports":null,"ReadinessProbe":null,"Resources":{"Limits":null,"Requests":null},"SecurityContext":null,"Stdin":false,"StdinOnce":false,"TTY":false,"TerminationMessagePath":"/dev/termination-log","TerminationMessagePolicy":"File","VolumeMounts":null,"WorkingDir":""}],"DNSPolicy":"ClusterFirst","HostAliases":null,"Hostname":"","ImagePullSecrets":null,"InitContainers":null,"NodeName":"","NodeSelector":null,"RestartPolicy":"Always","SchedulerName":"default-scheduler","SecurityContext":{"FSGroup":null,"HostIPC":false,"HostNetwork":false,"HostPID":false,"RunAsNonRoot":null,"RunAsUser":null,"SELinuxOptions":null,"SupplementalGroups":null},"ServiceAccountName":"","Subdomain":"","TerminationGracePeriodSeconds":30,"Tolerations":null,"Volumes":null},"creationTimestamp":null,"labels":{"app":"baz"},"name":"baz"}},"Status":{"AvailableReplicas":1,"CollisionCount":null,"Conditions":[{"LastTransitionTime":"2018-03-08T11:12:27Z","LastUpdateTime":"2018-03-08T11:12:27Z","Message":"Deployment has minimum availability.","Reason":"MinimumReplicasAvailable","Status":"True","Type":"Available"}],"ObservedGeneration":1,"ReadyReplicas":1,"Replicas":1,"UnavailableReplicas":0,"UpdatedReplicas":1},"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":null,"generation":1,"labels":{"app":"baz"},"name":"baz"}'

Expected results:
"deployment "baz" created"

Additional info:
This may be unique to 3.7.23.  This error does not occur on version 3.6 or v3.7.0-alpha.1+fdbd3dc

Also, "oc get --export" works fine as a workaround

Comment 1 Juan Vallejo 2018-03-09 15:15:20 UTC
This is a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1552325

*** This bug has been marked as a duplicate of bug 1552325 ***

Comment 2 Juan Vallejo 2018-07-17 14:18:20 UTC
*** Bug 1601875 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.