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

controller/bootstrap: use files with multiple yaml documents #577

Merged

Commits on Mar 26, 2019

  1. controller/bootstrap: use files with multiple yaml documents

    Users can push manifests during bootstrap that of the form:
    
    ```yaml
    ---
    ```
    
    Especially for the installer: setting authorizes_keys [1] and setting hyperthreading [2] will push a manifest that includes multiple machineconfig objects for
    control-plane (master) and compute (worker) roles.
    
    Single file with multiple k8s objects separated by `---` is also a supported structure for `oc create|apply` ie. there is a high chance that users trying to push machineconfigs at
    install time might create such files.
    
    This commit allows bootstrap controller to read all k8s objects, even ones described above to find all the `machineconfiguration.openshift.io` Objects.
    
    [1]: openshift/installer#1150
    [2]: openshift/installer#1392
    abhinavdahiya committed Mar 26, 2019
    Configuration menu
    Copy the full SHA
    7273740 View commit details
    Browse the repository at this point in the history
  2. controller/bootstrap: differentiate between errors when decoding

    When decoding a manifest we get 2 kinds of errors:
    - this manifest does not belong to mco apigroup and hence we do not care about these failures and we need to skip.
    - the manifest does belong to mco apigroup, but it cannot be decoded into any of the known types, this needs to be a failure.
    
    Using IsNotRegistreredError [1] allows aus to differentiate between the 2 errors. And therefore, later kind of error is now failure.
    
    [1]: https://godoc.org/k8s.io/apimachinery/pkg/runtime#IsNotRegisteredError
    abhinavdahiya committed Mar 26, 2019
    Configuration menu
    Copy the full SHA
    df19bd7 View commit details
    Browse the repository at this point in the history