Skip to content

Commit 437be4d

Browse files
Merge pull request #620 from stuggi/tlse_base
[tls] Add functionality to create service certs if internal tls enabled
2 parents 40b1370 + b1a7f05 commit 437be4d

24 files changed

+895
-209
lines changed

apis/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15951,6 +15951,24 @@ spec:
1595115951
- type
1595215952
type: object
1595315953
type: array
15954+
tls:
15955+
properties:
15956+
caBundleSecretName:
15957+
type: string
15958+
endpoint:
15959+
additionalProperties:
15960+
properties:
15961+
expires:
15962+
format: date-time
15963+
type: string
15964+
name:
15965+
type: string
15966+
required:
15967+
- expires
15968+
- name
15969+
type: object
15970+
type: object
15971+
type: object
1595415972
type: object
1595515973
type: object
1595615974
served: true

apis/core/v1beta1/openstackcontrolplane_types.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,23 @@ type OpenStackControlPlaneStatus struct {
652652
//+operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
653653
// Conditions
654654
Conditions condition.Conditions `json:"conditions,omitempty" optional:"true"`
655+
656+
//+operator-sdk:csv:customresourcedefinitions:type=spec
657+
// TLS
658+
TLS TLSStatus `json:"tls,omitempty" optional:"true"`
659+
}
660+
661+
// TLSStatus defines the observed state of TLS
662+
type TLSStatus struct {
663+
Endpoint map[service.Endpoint]TLSCAStatus `json:"endpoint,omitempty"`
664+
tls.Ca `json:",inline"`
665+
}
666+
667+
// TLSCAStatus defines the observed state of TLS
668+
type TLSCAStatus struct {
669+
Name string `json:"name"`
670+
// +kubebuilder:validation:Format="date-time"
671+
Expires string `json:"expires"`
655672
}
656673

657674
//+kubebuilder:object:root=true
@@ -748,3 +765,13 @@ func SetupDefaults() {
748765

749766
SetupOpenStackControlPlaneDefaults(openstackControlPlaneDefaults)
750767
}
768+
769+
// Enabled - returns status of tls configuration for the passed in endpoint type
770+
func (t *TLSSection) Enabled(endpt service.Endpoint) bool {
771+
if t != nil {
772+
if cfg, ok := t.Endpoint[service.EndpointInternal]; ok && cfg.Enabled {
773+
return true
774+
}
775+
}
776+
return false
777+
}

apis/core/v1beta1/zz_generated.deepcopy.go

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15951,6 +15951,24 @@ spec:
1595115951
- type
1595215952
type: object
1595315953
type: array
15954+
tls:
15955+
properties:
15956+
caBundleSecretName:
15957+
type: string
15958+
endpoint:
15959+
additionalProperties:
15960+
properties:
15961+
expires:
15962+
format: date-time
15963+
type: string
15964+
name:
15965+
type: string
15966+
required:
15967+
- expires
15968+
- name
15969+
type: object
15970+
type: object
15971+
type: object
1595415972
type: object
1595515973
type: object
1595615974
served: true

0 commit comments

Comments
 (0)