@@ -26,8 +26,6 @@ import (
2626 "strings"
2727 "time"
2828
29- "github.com/confidential-containers/cloud-api-adaptor/src/peerpodconfig-ctrl/api/v1alpha1"
30-
3129 appsv1 "k8s.io/api/apps/v1"
3230
3331 "k8s.io/apimachinery/pkg/labels"
@@ -1238,7 +1236,7 @@ func (r *KataConfigOpenShiftReconciler) processKataConfigInstallRequest() (ctrl.
12381236 }
12391237 }
12401238
1241- // create Pod VM image PeerPodConfig CRD and runtimeclass for peerpods
1239+ // create Pod VM image CRD and runtimeclass for peerpods
12421240 if r .kataConfig .Spec .EnablePeerPods {
12431241 //Get pull-secret from openshift-config ns and save it as auth-json-secret in our ns
12441242 //This will be used by the podvm image provider to pull the pause image for embedding
@@ -2264,28 +2262,8 @@ func (r *KataConfigOpenShiftReconciler) enablePeerPodsMc() error {
22642262
22652263// Create the PeerPodConfig CRDs and misc configs required for peer-pods
22662264func (r * KataConfigOpenShiftReconciler ) enablePeerPodsMiscConfigs () error {
2267- peerPodConfig := v1alpha1.PeerPodConfig {
2268- TypeMeta : metav1.TypeMeta {},
2269- ObjectMeta : metav1.ObjectMeta {
2270- Name : peerpodConfigCrdName ,
2271- Namespace : OperatorNamespace ,
2272- },
2273- Spec : v1alpha1.PeerPodConfigSpec {
2274- CloudSecretName : "peer-pods-secret" ,
2275- ConfigMapName : "peer-pods-cm" ,
2276- Limit : DEFAULT_PEER_PODS ,
2277- NodeSelector : r .getNodeSelectorAsMap (),
2278- },
2279- }
2280-
2281- err := r .Client .Create (context .TODO (), & peerPodConfig )
2282- if err != nil && ! k8serrors .IsAlreadyExists (err ) {
2283- r .Log .Info ("Error in creating peerpodconfig" , "err" , err )
2284- return err
2285- }
2286-
22872265 // Create the mutating webhook deployment
2288- err = r .createMutatingWebhookDeployment ()
2266+ err : = r .createMutatingWebhookDeployment ()
22892267 if err != nil {
22902268 r .Log .Info ("Error in creating mutating webhook deployment for peerpods" , "err" , err )
22912269 return err
@@ -2315,19 +2293,6 @@ func (r *KataConfigOpenShiftReconciler) enablePeerPodsMiscConfigs() error {
23152293}
23162294
23172295func (r * KataConfigOpenShiftReconciler ) disablePeerPods () error {
2318- peerPodConfig := v1alpha1.PeerPodConfig {
2319- TypeMeta : metav1.TypeMeta {},
2320- ObjectMeta : metav1.ObjectMeta {
2321- Name : peerpodConfigCrdName ,
2322- Namespace : OperatorNamespace ,
2323- },
2324- }
2325- err := r .Client .Delete (context .TODO (), & peerPodConfig )
2326- if err != nil {
2327- // error during removing peerpodconfig. Just log the error and move on.
2328- r .Log .Info ("Error found deleting PeerPodConfig. If the PeerPodConfig object exists after uninstallation it can be safely deleted manually" , "err" , err )
2329- }
2330-
23312296 mc := mcfgv1.MachineConfig {
23322297 TypeMeta : metav1.TypeMeta {
23332298 APIVersion : "machineconfiguration.openshift.io/v1" ,
@@ -2338,7 +2303,7 @@ func (r *KataConfigOpenShiftReconciler) disablePeerPods() error {
23382303 },
23392304 }
23402305
2341- err = r .Client .Delete (context .TODO (), & mc )
2306+ err : = r .Client .Delete (context .TODO (), & mc )
23422307 if err != nil {
23432308 // error during removing mc. Just log the error and move on.
23442309 r .Log .Info ("Error found deleting mc. If the MachineConfig object exists after uninstallation it can be safely deleted manually" ,
0 commit comments