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

OCPBUGS-48078: Add ratcheting tests for PowerVS service endpoints #2142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
292 changes: 292 additions & 0 deletions config/v1/tests/infrastructures.config.openshift.io/AAA_ungated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1365,3 +1365,295 @@ tests:
- name: BadService
url: https://bad-service.com
expectedStatusError: "platformStatus.ibmcloud.serviceEndpoints[1].name: Unsupported value: \"BadService\": supported values: \"CIS\", \"COS\", \"COSConfig\", \"DNSServices\", \"GlobalCatalog\", \"GlobalSearch\", \"GlobalTagging\", \"HyperProtect\", \"IAM\", \"KeyProtect\", \"ResourceController\", \"ResourceManager\", \"VPC\""
- name: Should allow updating other fields with an invalid persisted PowerVS service endpoint name in spec
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/platformSpec/properties/powervs/properties/serviceEndpoints/items/properties/name
value:
pattern: "^[a-z0-9-]+$"
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
cloudConfig: {}
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
cloudConfig: {}
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
- name: Should allow updating adding another slice entry with an invalid persisted PowerVS service endpoint name in spec
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/platformSpec/properties/powervs/properties/serviceEndpoints/items/properties/name
value:
pattern: "^[a-z0-9-]+$"
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
- name: DNSServices
url: https://abc
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
- name: DNSServices
url: https://abc
- name: Should not allow updating adding an invalid value to a still invalid value for a PowerVS service endpoint name in spec
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/platformSpec/properties/powervs/properties/serviceEndpoints/items/properties/name
value:
pattern: "^[a-z0-9-]+$"
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices2
url: https://abc
expectedError: 'spec.platformSpec.powervs.serviceEndpoints[0].name: Unsupported value: "dnsservices2": supported values: "CIS", "COS", "COSConfig", "DNSServices", "GlobalCatalog", "GlobalSearch", "GlobalTagging", "HyperProtect", "IAM", "KeyProtect", "Power", "ResourceController", "ResourceManager", "VPC"'
- name: Should allow updating adding updating an invalid value to a valid value for PowerVS service endpoint name in spec
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/platformSpec/properties/powervs/properties/serviceEndpoints/items/properties/name
value:
pattern: "^[a-z0-9-]+$"
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: DNSServices
url: https://abc
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: PowerVS
powervs:
serviceEndpoints:
- name: DNSServices
url: https://abc


- name: Should allow updating other fields with an invalid persisted PowerVS service endpoint name in status
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/status/properties/platformStatus/properties/powervs/properties/serviceEndpoints/items/properties/name
value:
pattern: "^[a-z0-9-]+$"
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
region: Foo
serviceEndpoints:
- name: dnsservices
url: https://abc
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
region: Foo
serviceEndpoints:
- name: dnsservices
url: https://abc
- name: Should allow updating adding another slice entry with an invalid persisted PowerVS service endpoint name in status
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/status/properties/platformStatus/properties/powervs/properties/serviceEndpoints/items/properties/name
value:
pattern: "^[a-z0-9-]+$"
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
- name: DNSServices
url: https://abc
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
- name: DNSServices
url: https://abc
- name: Should not allow updating adding an invalid value to a still invalid value for a PowerVS service endpoint name in status
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/status/properties/platformStatus/properties/powervs/properties/serviceEndpoints/items/properties/name
value:
pattern: "^[a-z0-9-]+$"
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices2
url: https://abc
expectedError: 'spec.platformSpec.powervs.serviceEndpoints[0].name: Unsupported value: "dnsservices2": supported values: "CIS", "COS", "COSConfig", "DNSServices", "GlobalCatalog", "GlobalSearch", "GlobalTagging", "HyperProtect", "IAM", "KeyProtect", "Power", "ResourceController", "ResourceManager", "VPC"'
- name: Should allow updating adding updating an invalid value to a valid value for PowerVS service endpoint name in status
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/status/properties/platformStatus/properties/powervs/properties/serviceEndpoints/items/properties/name
value:
pattern: "^[a-z0-9-]+$"
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
serviceEndpoints:
- name: dnsservices
url: https://abc
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
serviceEndpoints:
- name: DNSServices
url: https://abc
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
status:
platformStatus:
type: PowerVS
powervs:
serviceEndpoints:
- name: DNSServices
url: https://abc