Documentation ¶
Overview ¶
Copyright 2024 Red Hat, Inc.
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.
Copyright 2024 Red Hat, Inc.
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.
Copyright 2024 Red Hat, Inc.
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.
Copyright 2024 Red Hat, Inc.
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.
Copyright 2024 Red Hat, Inc.
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.
Copyright 2024 Red Hat, Inc.
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.
Copyright 2024 Red Hat, Inc.
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.
Index ¶
- Variables
- func ApplyConfigPatch(applyConfig interface{}) client.Patch
- func ContainsString(slice []string, s string) bool
- func FilterNamespace(namespace string) predicate.Predicate
- func GetInfra(ctx context.Context, cl client.Reader) (*configv1.Infrastructure, error)
- func GetPlatform(ctx context.Context, infra *configv1.Infrastructure) (configv1.PlatformType, error)
- func GetReleaseVersion() string
- func IsPatchRequired(origObj client.Object, patch client.Patch) (bool, error)
- func MergeMaps(m1, m2 map[string]string) map[string]string
- func ReadImagesFile(imagesFile string) (map[string]string, error)
- func ReadProvidersFile(providersFile string) (map[string]bool, error)
- func ResolveCAPIMachineSetFromObject(namespace string) func(context.Context, client.Object) []reconcile.Request
- func RewriteNamespace(namespace string) func(context.Context, client.Object) []reconcile.Request
Constants ¶
This section is empty.
Variables ¶
var ( // LeaseDuration is the default duration for the leader election lease. LeaseDuration = metav1.Duration{Duration: 137 * time.Second} // RenewDeadline is the default duration for the leader renewal. RenewDeadline = metav1.Duration{Duration: 107 * time.Second} // RetryPeriod is the default duration for the leader election retrial. RetryPeriod = metav1.Duration{Duration: 26 * time.Second} )
The default durations for the leader election operations.
Functions ¶
func ApplyConfigPatch ¶
ApplyConfigPatch is a helper function for using applyConfigPatch.
func ContainsString ¶
ContainsString checks if a given slice of strings contains the provided string.
func FilterNamespace ¶
FilterNamespace filters a client.Object request, ensuring they are in the namespace provided.
func GetPlatform ¶
func GetPlatform(ctx context.Context, infra *configv1.Infrastructure) (configv1.PlatformType, error)
GetPlatform returns the platform type from the infrastructure resource.
func GetReleaseVersion ¶
func GetReleaseVersion() string
GetReleaseVersion is used to get the current release version from the env. This is used to identify which version of feature gates should be observed, and to know which version to set in the operator status.
func IsPatchRequired ¶
IsPatchRequired returns true if the calculated patch data is not an empty JSON object.
func ReadImagesFile ¶
ReadImagesFile reads the images file and returns the map of container images.
func ReadProvidersFile ¶
ReadProvidersFile reads the providers file and returns the map of supported providers.
func ResolveCAPIMachineSetFromObject ¶
func ResolveCAPIMachineSetFromObject(namespace string) func(context.Context, client.Object) []reconcile.Request
ResolveCAPIMachineSetFromObject should probably be renamed. It: 1. takes a client.Object (expecting a CAPI InfrastructureMachineTemplate) and checks to see if it's owned by a CAPI MachineSet 2. If it is, returns a reconcile.Request for the MAPI namespace, so we reconcile the mirror MAPI MachineSet.
func RewriteNamespace ¶
RewriteNamespace takes a client.Object and returns a reconcile.Request for it in the namespace provided.
It is intended for use with CAPI Machines and MachineSet requests, where we expect there to be a mirror object in the MAPI namespace.
Types ¶
This section is empty.