Skip to content

Define strategy for migration from OLMv0 to OLMv1 #86

@joelanford

Description

@joelanford

As of #85, we have begun to add support for the OLMv1 APIs into this plugin via a new subcommand kubectl operator olmv1. So the current state of the world is:

  • OLMv1 stuff at kubectl operator olmv1
  • OLMv0 stuff at kubectl operator * (except olmv1)

Long term, I think the goal is:

  • OLMv1 stuff at kubectl operator
  • OLMv0 stuff no longer present.

How do we get from A to B?

Proposal 1

In #84, I proposed the use of an environment variable (I chose EXPERIMENTAL_USE_OLMV1_APIS, but we could pick something else), which would act as a switch controlling the entirety of the kubectl operator functionality:

  • EXPERIMENTAL_USE_OLMV1_APIS=on: kubectl operator is OLMv1
  • Anything else: kubectl operator is OLMv0

My thought there was that we could perform the migration like this:

  • T1. OLMv0 support only
  • T2. Default: OLMv0, require EXPERIMENTAL_USE_OLMV1_APIS=on for OLMv1
  • T3. Default: OLMv1, require EXPERIMENTAL_USE_OLMV1_APIS=off for OLMv0
  • T4. OLMv1 support only

In this proposed model, OLMv1 users can essentially opt-in early (at T2) and then not have to worry about subcommand changes later. Also in this model, OLMv0 users can explicitly opt-out early to avoid a breakage at T3. This gives both sets of users more time to adjust to incoming changes.

Proposal 2

Another option is to perform this same transition, but using subcommand renaming:

  • T1. OLMv0 support only at kubectl operator
  • T2. OLMv0 support at kubectl operator, OLMv1 support at kubectl operator olmv1
  • T3. OLMv1 support at kubectl operator, OLMv0 support at kubectl operator olmv0
  • T4. OLMv1 support only at kubectl operator

Proposal 3

Another option is a variation on Proposal 2, except we skip T3 and do a hard cutover:

  • T1. OLMv0 support only at kubectl operator
  • T2. OLMv0 support at kubectl operator, OLMv1 support at kubectl operator olmv1
  • T3. OLMv1 support only at kubectl operator

My two cents

I had always imagined this working like proposal 1, which is similar to the way that Go modules were introduced in Go. IMO, the envvar approach keeps the CLI clean, makes for less typing for OLMv1 users, and will make the transition easy to implement.

In proposal 2 and 3, we'll definitely break early users of the OLMv1 functionality at some point when we remove the olmv1 subcommand and move that functionality under the main subcommand. And I feel like it would be nice if we could help them avoid that.

This plugin is still v0 (and may always be v0), so any of these proposals is fine from a semver standpoint. I'm mainly interested in choosing a strategy that primarily minimizes user impact and secondarily minimizes developer impact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions