Uploaded image for project: 'OpenShift Cloud'
  1. OpenShift Cloud
  2. OCPCLOUD-1438

Implement webhook validations for CPMS resource

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • 3
    • False
    • None
    • False
    • OCPPLAN-9749 - Control Plane Scaling and Recovery (IPI clusters only) - Phase 0
    • CLOUD Sprint 217, CLOUD Sprint 218, CLOUD Sprint 219, CLOUD Sprint 220, CLOUD Sprint 221

      User Story

      As a user of OpenShift, I want validation on resources as and when they are created/updated to ensure that i have appropriate feedback when configuring my resources.

      Background

      Some basic webhook infrastructure has now been set up for the ControlPlaneMachineSet, however none of the validations have been implemented.

      We need to implement the following validations:

      • Ensure Control Plane Machine count matches the ControlPlaneMachineSet replicas on create
      • Ensure failure domains of Control Plane Machines match the ControlPlaneMachineSet on create
      • Ensure selector and template labels match on create/update
      • Ensure selector is immutable
      • Ensure CPMS created with invalid name is not allowed
      • Ensure CPMS with invalid namespace is not allowed
      • Ensure spec.Replicas is immutable on update

      Tests have been added for most of these already and are marked pending, though individual unit tests should also be included.

       

      The validations should be implemented in this file  and the tests are here.

      Steps

      • Review existing tests and validation cases, implement clean code for the webhooks based on existing webhook patterns

      Stakeholders

      • Cluster Infra (Joel in particular)
      • SD
      • etcd

      Definition of Done

      • Webhook validation is implemented and thoroughly tested
      • Docs
      • Restrictions and validations should be noted, they are already mentioned within the API 
      • Testing
      • Check validations described above and possibly other negative validations

              rmanak@redhat.com Radek Manak
              joelspeed Joel Speed
              Zhaohua Sun Zhaohua Sun
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: