generated from crossplane-contrib/provider-jet-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from crossplane-contrib/fix-provider-definition
fix provider definition
- Loading branch information
Showing
17 changed files
with
948 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
Copyright 2024 The Crossplane 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 v1beta1 contains the core resources of the template upjet provider. | ||
// +kubebuilder:object:generate=true | ||
// +groupName=equinix.jet.crossplane.io | ||
// +versionName=v1beta1 | ||
package v1beta1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
Copyright 2024 The Crossplane 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 v1beta1 | ||
|
||
import ( | ||
"reflect" | ||
|
||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
// Package type metadata. | ||
const ( | ||
Group = "equinix.jet.crossplane.io" | ||
Version = "v1beta1" | ||
) | ||
|
||
var ( | ||
// SchemeGroupVersion is group version used to register these objects | ||
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} | ||
) | ||
|
||
// ProviderConfig type metadata. | ||
var ( | ||
ProviderConfigKind = reflect.TypeOf(ProviderConfig{}).Name() | ||
ProviderConfigGroupKind = schema.GroupKind{Group: Group, Kind: ProviderConfigKind}.String() | ||
ProviderConfigKindAPIVersion = ProviderConfigKind + "." + SchemeGroupVersion.String() | ||
ProviderConfigGroupVersionKind = SchemeGroupVersion.WithKind(ProviderConfigKind) | ||
) | ||
|
||
// ProviderConfigUsage type metadata. | ||
var ( | ||
ProviderConfigUsageKind = reflect.TypeOf(ProviderConfigUsage{}).Name() | ||
ProviderConfigUsageGroupKind = schema.GroupKind{Group: Group, Kind: ProviderConfigUsageKind}.String() | ||
ProviderConfigUsageKindAPIVersion = ProviderConfigUsageKind + "." + SchemeGroupVersion.String() | ||
ProviderConfigUsageGroupVersionKind = SchemeGroupVersion.WithKind(ProviderConfigUsageKind) | ||
|
||
ProviderConfigUsageListKind = reflect.TypeOf(ProviderConfigUsageList{}).Name() | ||
ProviderConfigUsageListGroupKind = schema.GroupKind{Group: Group, Kind: ProviderConfigUsageListKind}.String() | ||
ProviderConfigUsageListKindAPIVersion = ProviderConfigUsageListKind + "." + SchemeGroupVersion.String() | ||
ProviderConfigUsageListGroupVersionKind = SchemeGroupVersion.WithKind(ProviderConfigUsageListKind) | ||
) | ||
|
||
func init() { | ||
SchemeBuilder.Register(&ProviderConfig{}, &ProviderConfigList{}) | ||
SchemeBuilder.Register(&ProviderConfigUsage{}, &ProviderConfigUsageList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
/* | ||
Copyright 2024 The Crossplane 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 v1beta1 | ||
|
||
import ( | ||
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// A ProviderConfigSpec defines the desired state of a ProviderConfig. | ||
type ProviderConfigSpec struct { | ||
// Credentials required to authenticate to this provider. | ||
Credentials ProviderCredentials `json:"credentials"` | ||
|
||
// +kubebuilder:validation:Optional | ||
Configuration ProviderConfiguration `json:"config"` | ||
} | ||
|
||
// ProviderConfiguration for configuring the terraform provider | ||
// see https://registry.terraform.io/providers/equinix/equinix/latest/docs#configuration-reference | ||
type ProviderConfiguration struct { | ||
// The Equinix API base URL to point out desired environment. This argument can also be specified with the EQUINIX_API_ENDPOINT shell environment variable. (Defaults to https://api.equinix.com) | ||
// +kubebuilder:validation:Optional | ||
Endpoint string `json:"endpoint"` | ||
|
||
// Maximum number of retries in case of network failure. | ||
// +kubebuilder:validation:Optional | ||
MaxRetries int `json:"max_retries"` | ||
|
||
// Maximum number of seconds to wait before retrying a request. | ||
// +kubebuilder:validation:Optional | ||
MaxRetryWaitSeconds int `json:"max_retry_wait_seconds"` | ||
|
||
// The duration of time, in seconds, that the Equinix Platform API Client should wait before canceling an API request. Canceled requests may still result in provisioned resources. (Defaults to 30) | ||
// +kubebuilder:validation:Optional | ||
RequestTimeout int `json:"request_timeout"` | ||
|
||
// The maximum number of records in a single response for REST queries that produce paginated responses. (Default is client specific) | ||
// +kubebuilder:validation:Optional | ||
ResponseMaxPageSize int `json:"response_max_page_size"` | ||
} | ||
|
||
// ProviderCredentials required to authenticate. | ||
type ProviderCredentials struct { | ||
// Source of the provider credentials. | ||
// +kubebuilder:validation:Enum=None;Secret;InjectedIdentity;Environment;Filesystem | ||
Source xpv1.CredentialsSource `json:"source"` | ||
|
||
xpv1.CommonCredentialSelectors `json:",inline"` | ||
} | ||
|
||
// A ProviderConfigStatus reflects the observed state of a ProviderConfig. | ||
type ProviderConfigStatus struct { | ||
xpv1.ProviderConfigStatus `json:",inline"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// A ProviderConfig configures a Linode provider. | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" | ||
// +kubebuilder:printcolumn:name="SECRET-NAME",type="string",JSONPath=".spec.credentials.secretRef.name",priority=1 | ||
// +kubebuilder:resource:scope=Cluster | ||
// +kubebuilder:resource:scope=Cluster,categories={crossplane,providerconfig,equinix} | ||
// +kubebuilder:storageversion | ||
type ProviderConfig struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ProviderConfigSpec `json:"spec"` | ||
Status ProviderConfigStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ProviderConfigList contains a list of ProviderConfig. | ||
type ProviderConfigList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ProviderConfig `json:"items"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// A ProviderConfigUsage indicates that a resource is using a ProviderConfig. | ||
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" | ||
// +kubebuilder:printcolumn:name="CONFIG-NAME",type="string",JSONPath=".providerConfigRef.name" | ||
// +kubebuilder:printcolumn:name="RESOURCE-KIND",type="string",JSONPath=".resourceRef.kind" | ||
// +kubebuilder:printcolumn:name="RESOURCE-NAME",type="string",JSONPath=".resourceRef.name" | ||
// +kubebuilder:resource:scope=Cluster,categories={crossplane,providerconfig,equinix} | ||
// +kubebuilder:storageversion | ||
type ProviderConfigUsage struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
xpv1.ProviderConfigUsage `json:",inline"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ProviderConfigUsageList contains a list of ProviderConfigUsage | ||
type ProviderConfigUsageList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ProviderConfigUsage `json:"items"` | ||
} |
Oops, something went wrong.