Error upgrading mode: operator k8s charms

Bug #1928074 reported by David
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Ian Booth

Bug Description

Summary: Cannot upgrade an operator charm in k8s without getting an error.

This is the metadata.yaml of the charm I am trying to deploy:

```yaml
name: kdu-proxy
description: |
  TEMPLATE-TODO: fill out the charm's description
summary: |
  TEMPLATE-TODO: fill out the charm's summary
series: [kubernetes]
deployment:
  mode: operator
```

The deployment:mode: operator means that there is not workload associated to the charm. When I upgrade the charm, I get the following error in the debug log:

```
ERROR juju.worker.caasoperator.uniter.kdu-proxy/0.operation hook "upgrade-charm" (via hook dispatching script: dispatch) failed: cannot apply changes: cannot set k8s spec on an operator charm
```

I think the problem is that in Juju 2.8.10 we are setting the pod spec on every upgrade-charm hook (something I don-t like either because we get pod rollback on every upgrade of the charms), and its failing because there is no pod spec associated to the operator charms.

Revision history for this message
Ian Booth (wallyworld) wrote :

Correct, pod-spec-set is not (currently) supported on operator charms. Juju does not attempt to track any workload pods for these charms. Does you charm have a pod spec that it wants to use? What resources are in that pod spec?

Revision history for this message
David (davigar15) wrote :

Ian: this is the example charm that is not setting any pod spec. As we thought, this could be an Operator Framework bug, and not juju.

https://github.com/davigar15/kdu-proxy-operator

Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.9.2
assignee: nobody → Ian Booth (wallyworld)
importance: Undecided → High
status: New → Incomplete
status: Incomplete → In Progress
Revision history for this message
Ian Booth (wallyworld) wrote :

It was an issue in juju - we always do a pod spec set on upgrade to increment the charm modified version. We just need to allow spec = nil to go through. PR will also remove the feature flag.

https://github.com/juju/juju/pull/12984

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.

Other bug subscribers

Remote bug watches

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