Skip to content

Commit

Permalink
Adding kubevirtSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
bardielle committed Oct 11, 2020
1 parent 398c7ed commit 2b21c89
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/apis/cloudcredential/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&AzureProviderStatus{}, &AzureProviderSpec{},
&GCPProviderStatus{}, &GCPProviderSpec{},
&VSphereProviderStatus{}, &VSphereProviderSpec{},
&KubevirtProviderStatus{}, &KubevirtProviderSpec{},
)

return nil
Expand Down
36 changes: 36 additions & 0 deletions pkg/apis/cloudcredential/v1/types_kubevirt.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2019 The OpenShift Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// TODO: these types should eventually be broken out, along with the actuator,
// to a separate repo.

// KubevirtProviderSpec the specification of the credentials request in Kubevirt.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type KubevirtProviderSpec struct {
metav1.TypeMeta `json:",inline"`
}

// KubevirtProviderSpec contains the status of the credentials request in Kubevirt.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type KubevirtProviderStatus struct {
metav1.TypeMeta `json:",inline"`
}
50 changes: 50 additions & 0 deletions pkg/apis/cloudcredential/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,8 @@ func crInfraMatches(cr *minterv1.CredentialsRequest, clusterCloudPlatform config
return cloudType == reflect.TypeOf(minterv1.OvirtProviderSpec{}).Name(), nil
case configv1.VSpherePlatformType:
return cloudType == reflect.TypeOf(minterv1.VSphereProviderSpec{}).Name(), nil
case configv1.KubevirtPlatformType:
return cloudType == reflect.TypeOf(minterv1.KubevirtProviderSpec{}).Name(), nil
default:
return false, fmt.Errorf("unsupported platorm type: %v", clusterCloudPlatform)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/operator/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ func cloudProviderSpecToMetricsKey(cloud string) string {
return "ovirt"
case "VsphereProviderSpec":
return "vsphere"
case "KubevirtProviderSpec":
return "kubevirt"
default:
return "unknown"
}
Expand Down

0 comments on commit 2b21c89

Please sign in to comment.