pod-spec-set ignores --k8s-resources when JSON used

Bug #1880637 reported by Paul Collins
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Thomas Miller

Bug Description

pod-spec-set seems to ignore --k8s-resources when the files are JSON.

== Failure ==

[agnew(charm-k8s-mattermost)] kubectl -n mattermost exec -it pod/mattermost-operator-0 -- /bin/sh
# cd /
# cat > pod.json
{
   "containers" : [
      {
         "config" : {
            "MATTERMOST_HTTPD_LISTEN_PORT" : 8000,
            "MM_ENABLEOPENSERVER" : false,
            "MM_SERVICESETTINGS_SITEURL" : "http://mattermost.catsarenice.com",
            "MM_SQLSETTINGS_DATASOURCE" : "postgresql://juju_remote-70ca660f540443928ed261b0f12a2fc4:[REDACTED]@10.9.8.195:5432/mattermost"
         },
         "imageDetails" : {
            "imagePath" : "localhost:32000/mattermost:v0",
            "password" : "",
            "username" : ""
         },
         "name" : "mattermost",
         "ports" : [
            {
               "containerPort" : 8000,
               "protocol" : "TCP"
            }
         ]
      }
   ],
   "version" : 2
}
# cat > k8s.json
{
   "kubernetesResources" : {
      "ingressResources" : [
         {
            "name" : "mattermost",
            "spec" : {
               "rules" : [
                  {
                     "host" : "mattermost.catsarenice.com",
                     "http" : {
                        "paths" : [
                           {
                              "backend" : {
                                 "serviceName" : "mattermost",
                                 "servicePort" : 8000
                              },
                              "path" : "/"
                           }
                        ]
                     }
                  }
               ]
            }
         }
      ]
   }
}
#
[agnew(charm-k8s-mattermost)] juju run --unit mattermost/1 -- pod-spec-set --file /pod.json --k8s-resources /k8s.json
[agnew(charm-k8s-mattermost)] kubectl get ingress --all-namespaces
No resources found
[agnew(charm-k8s-mattermost)]

== Success ==

[agnew(charm-k8s-mattermost)] kubectl -n mattermost exec -it pod/mattermost-operator-0 -- /bin/sh
# cd /
# cat > combined.json
{
   "containers" : [
      {
         "config" : {
            "MATTERMOST_HTTPD_LISTEN_PORT" : 8000,
            "MM_ENABLEOPENSERVER" : false,
            "MM_SERVICESETTINGS_SITEURL" : "http://mattermost.catsarenice.com",
            "MM_SQLSETTINGS_DATASOURCE" : "postgresql://juju_remote-70ca660f540443928ed261b0f12a2fc4:[REDACTED]@10.9.8.195:5432/mattermost"
         },
         "imageDetails" : {
            "imagePath" : "localhost:32000/mattermost:v0",
            "password" : "",
            "username" : ""
         },
         "name" : "mattermost",
         "ports" : [
            {
               "containerPort" : 8000,
               "protocol" : "TCP"
            }
         ]
      }
   ],
   "version" : 2,
   "kubernetesResources" : {
      "ingressResources" : [
         {
            "name" : "mattermost",
            "spec" : {
               "rules" : [
                  {
                     "host" : "mattermost.catsarenice.com",
                     "http" : {
                        "paths" : [
                           {
                              "backend" : {
                                 "serviceName" : "mattermost",
                                 "servicePort" : 8000
                              },
                              "path" : "/"
                           }
                        ]
                     }
                  }
               ]
            }
         }
      ]
   }
}
#
[agnew(charm-k8s-mattermost)] juju run -m mattermost --unit mattermost/1 -- pod-spec-set --file /combined.json
[agnew(charm-k8s-mattermost)] kubectl get ingress --all-namespaces
NAMESPACE NAME CLASS HOSTS ADDRESS PORTS AGE
mattermost mattermost <none> mattermost.catsarenice.com 80 25s
[agnew(charm-k8s-mattermost)]

Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.8.1
importance: Undecided → High
status: New → Triaged
Thomas Miller (tlmiller)
Changed in juju:
assignee: nobody → Thomas Miller (tlmiller)
status: Triaged → In Progress
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.8.1 → 2.8.2
Revision history for this message
Thomas Miller (tlmiller) wrote :
Changed in juju:
status: In Progress → Fix Committed
Ian Booth (wallyworld)
Changed in juju:
status: Fix Committed → In Progress
Ian Booth (wallyworld)
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.