Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg: Migrate from cluster-config-v1 to Infrastructure.config.openshift.io #260

Closed
wants to merge 5 commits into from

Commits on Apr 22, 2019

  1. vendor: Remove unused packages

    Generated with:
    
      $ dep ensure
    
    using:
    
      $ dep version
      dep:
       version     : v0.5.1
       build date  : 2019-03-20
       git hash    : faa61893
       go version  : go1.10.3
       go compiler : gc
       platform    : linux/amd64
       features    : ImportDuringSolve=false
    
    I'm not sure why there are so many changes.  For example, the
    go.opencensus.io stuff is originally from a531f87 (Update vendor,
    2018-09-19, 2018-09-19, openshift#11), where it was used by
    vendor/cloud.google.com and vendor/google.golang.org/api/transport.
    Those consumers are still there, but are apparently unused by the
    operator, because I can build the operator without issues after
    removing them.  I expect this project wants a:
    
      [prune]
        non-go = true
        go-tests = true
        unused-packages = true
    
    or similar in Gopkg.toml, but am punting on that for now.
    wking committed Apr 22, 2019
    Configuration menu
    Copy the full SHA
    788ebbc View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2019

  1. vendor: Bump openshift/api

    Because I need InfrastructureName from openshift/api@c9b4e5b2d7 (Adds
    platform-specific specs to Infrastructure in config.openshift.io,
    2019-03-01, openshift/api#266) in order to drop the cluster-config-v1
    stuff here.
    
    Generated with:
    
      $ sed -i s/ea5d05408a95a765d44b5a4b31561b530f0b1f4c/ea5d05408a95a765d44b5a4b31561b530f0b1f4c/ Gopkg.toml  # openshift/api
      $ sed -i s/31ef839c86359881d2c312c4f0131febc6662400/0255926f53935175fe90b8e7672c4c06c17d79e6/ Gopkg.toml  # openshift/client-go, to avoid "undefined Features" errors after the API bump
      $ emacs Gopkg.toml  # remove openshift/installer, now that we're using the Infrastructure config
      $ dep ensure
    
    using:
    
      $ dep version
      dep:
       version     : v0.5.1
       build date  : 2019-03-20
       git hash    : faa61893
       go version  : go1.10.3
       go compiler : gc
       platform    : linux/amd64
       features    : ImportDuringSolve=false
    wking committed Apr 23, 2019
    Configuration menu
    Copy the full SHA
    1e4baa8 View commit details
    Browse the repository at this point in the history
  2. pkg/clusterconfig/clusterconfig: Rename "GetCoreClient" -> "getCoreCl…

    …ient"
    
    The function was unused outside this package, and the lowercase name
    makes the package's public API (which does not include this function)
    more clear.
    wking committed Apr 23, 2019
    Configuration menu
    Copy the full SHA
    82e0ca6 View commit details
    Browse the repository at this point in the history
  3. pkg: Migrate from cluster-config-v1 to Infrastructure.config.openshif…

    …t.io
    
    Mostly, this is replacing cluster-config-v1 (which is deprecated [1])
    with the Infrastructure config object.  As part of that, I'm dropping
    UserTags support (see discussion in [2,3]).  I'm also replacing the
    openshiftClusterID tag with a "kubernetes.io/cluster/{infraName}:
    owned" tag [4,5].
    
    The trip through clientcorev1.NewForConfig is because calling
    RESTClientFor on the InClusterConfig raises:
    
      $ curl -s https://storage.googleapis.com/origin-ci-test/pr-logs/pull/openshift_cluster-image-registry-operator/260/pull-ci-openshift-cluster-image-registry-operator-master-e2e-aws/1304/artifacts/e2e-aws/pods/openshift-image-registry_cluster-image-registry-operator-fc9948cc-b767n_cluster-image-registry-operator.log.gz | gunzip
      I0423 05:43:03.599910       1 main.go:18] Cluster Image Registry Operator Version: 4.0.0-142-g38fc8f9-dirty
      ...
      I0423 05:43:04.942285       1 bootstrap.go:38] generating registry custom resource
      E0423 05:43:04.942775       1 controller.go:235] unable to sync: unable to get storage configuration from cluster install config: GroupVersion is required when initializing a RESTClient, requeuing
    
    InClusterConfig does not set GroupVersion [6] and RESTClientFor
    requires it [7] while UnversionedRESTClientFor can fill it in [8].
    But UnversionedRESTClientFor leaves NegotiatedSerializer unset:
    
      $ curl -s https://storage.googleapis.com/origin-ci-test/pr-logs/pull/openshift_cluster-image-registry-operator/260/pull-ci-openshift-cluster-image-registry-operator-master-e2e-aws/1305/artifacts/e2e-aws/pods/openshift-image-registry_cluster-image-registry-operator-66d8b56784-5wt9v_cluster-image-registry-operator.log.gz | gunzip
      I0423 09:21:42.998300       1 main.go:18] Cluster Image Registry Operator Version: 4.0.0-142-g64d5f62-dirty
      ...
      I0423 09:21:44.345677       1 bootstrap.go:38] generating registry custom resource
      E0423 09:21:44.346403       1 controller.go:235] unable to sync: unable to get storage configuration from cluster install config: NegotiatedSerializer is required when initializing a RESTClient, requeuing
    
    So I'm washing through clientcorev1.NewForConfig to get defaults for
    both [9].
    
    The RBAC change avoids:
    
      $ curl -s https://storage.googleapis.com/origin-ci-test/pr-logs/pull/openshift_cluster-image-registry-operator/260/pull-ci-openshift-cluster-image-registry-operator-master-e2e-aws/1306/artifacts/e2e-aws/pods/openshift-image-registry_cluster-image-registry-operator-7f59899bf6-8c8x8_cluster-image-registry-operator.log.gz | gunzip | head -n7
      I0423 10:44:51.121540       1 main.go:18] Cluster Image Registry Operator Version: 4.0.0-142-gfa5b59b-dirty
      ...
      I0423 10:44:52.461691       1 bootstrap.go:38] generating registry custom resource
      E0423 10:44:52.464035       1 controller.go:235] unable to sync: unable to get storage configuration from cluster install config: infrastructures "cluster" is forbidden: User "system:serviceaccount:openshift-image-registry:cluster-image-registry-operator" cannot get resource "infrastructures" in API group "" at the cluster scope, requeuing
    
    [1]: openshift/installer#680
    [2]: openshift/api#231 (comment)
    [3]: openshift/api#266
    [4]: openshift/installer#1280
    [5]: https://bugzilla.redhat.com/show_bug.cgi?id=1685089#c11
    [6]: https://github.com/kubernetes/client-go/blob/59781b88d0faa9d51be48b4ca49eb08e05246de4/rest/config.go#L422-L428
    [7]: https://github.com/kubernetes/client-go/blob/59781b88d0faa9d51be48b4ca49eb08e05246de4/rest/config.go#L269-L270
    [8]: https://github.com/kubernetes/client-go/blob/59781b88d0faa9d51be48b4ca49eb08e05246de4/rest/config.go#L331-L333
    [9]: https://github.com/kubernetes/client-go/blob/59781b88d0faa9d51be48b4ca49eb08e05246de4/kubernetes/typed/core/v1/core_client.go#L144-L155
    wking committed Apr 23, 2019
    Configuration menu
    Copy the full SHA
    bb90d24 View commit details
    Browse the repository at this point in the history
  4. pkg: Replace OperatorFailing with OperatorDegraded

    Catching up with openshift/api@8e476cb732 (Create a new
    ClusterStatusCondition Degraded, 2019-04-16, openshift/api#287) and
    openshift/api@a9fb3b1629 (Remove ClusterStatusConditionType Failing,
    2019-04-16, openshift/api#287).
    wking committed Apr 23, 2019
    Configuration menu
    Copy the full SHA
    7a58c7c View commit details
    Browse the repository at this point in the history