diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index f355b14c6..31dbec8f7 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -11,7 +11,7 @@ rules: resources: - configmaps verbs: - - allowsCreate + - create - delete - get - list @@ -23,7 +23,7 @@ rules: resources: - endpoints verbs: - - allowsCreate + - create - delete - get - list @@ -35,7 +35,7 @@ rules: resources: - events verbs: - - allowsCreate + - create - delete - get - list @@ -47,7 +47,7 @@ rules: resources: - persistentvolumeclaims verbs: - - allowsCreate + - create - delete - get - list @@ -59,7 +59,7 @@ rules: resources: - pods verbs: - - allowsCreate + - create - delete - get - list @@ -71,7 +71,7 @@ rules: resources: - secrets verbs: - - allowsCreate + - create - delete - get - list @@ -83,7 +83,7 @@ rules: resources: - serviceaccounts verbs: - - allowsCreate + - create - delete - get - list @@ -95,7 +95,7 @@ rules: resources: - services verbs: - - allowsCreate + - create - delete - get - list @@ -107,7 +107,7 @@ rules: resources: - services/finalizers verbs: - - allowsCreate + - create - delete - get - list @@ -119,7 +119,7 @@ rules: resources: - HumioBootstrapTokens verbs: - - allowsCreate + - create - delete - get - list @@ -145,7 +145,7 @@ rules: resources: - humioactions verbs: - - allowsCreate + - create - delete - get - list @@ -171,7 +171,7 @@ rules: resources: - humioalerts verbs: - - allowsCreate + - create - delete - get - list @@ -197,7 +197,7 @@ rules: resources: - humioclusters verbs: - - allowsCreate + - create - delete - get - list @@ -223,7 +223,7 @@ rules: resources: - humioexternalclusters verbs: - - allowsCreate + - create - delete - get - list @@ -249,7 +249,7 @@ rules: resources: - humioingesttokens verbs: - - allowsCreate + - create - delete - get - list @@ -275,7 +275,7 @@ rules: resources: - humioparsers verbs: - - allowsCreate + - create - delete - get - list @@ -301,7 +301,7 @@ rules: resources: - humiorepositories verbs: - - allowsCreate + - create - delete - get - list @@ -327,7 +327,7 @@ rules: resources: - humioviews verbs: - - allowsCreate + - create - delete - get - list @@ -353,7 +353,7 @@ rules: resources: - ingress verbs: - - allowsCreate + - create - delete - get - list diff --git a/controllers/humioaction_controller.go b/controllers/humioaction_controller.go index bb3ecccbf..a4e196861 100644 --- a/controllers/humioaction_controller.go +++ b/controllers/humioaction_controller.go @@ -43,7 +43,7 @@ type HumioActionReconciler struct { Namespace string } -//+kubebuilder:rbac:groups=core.humio.com,resources=humioactions,verbs=get;list;watch;allowsCreate;update;patch;delete +//+kubebuilder:rbac:groups=core.humio.com,resources=humioactions,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core.humio.com,resources=humioactions/status,verbs=get;update;patch //+kubebuilder:rbac:groups=core.humio.com,resources=humioactions/finalizers,verbs=update @@ -156,7 +156,7 @@ func (r *HumioActionReconciler) reconcileHumioAction(ctx context.Context, config r.Log.Info("Action doesn't exist. Now adding action") addedAction, err := r.HumioClient.AddAction(config, req, ha) if err != nil { - return reconcile.Result{}, r.logErrorAndReturn(err, "could not allowsCreate action") + return reconcile.Result{}, r.logErrorAndReturn(err, "could not create action") } r.Log.Info("Created action", "Action", ha.Spec.Name) diff --git a/controllers/humioalert_controller.go b/controllers/humioalert_controller.go index 4b489096f..b4e921874 100644 --- a/controllers/humioalert_controller.go +++ b/controllers/humioalert_controller.go @@ -47,7 +47,7 @@ type HumioAlertReconciler struct { Namespace string } -//+kubebuilder:rbac:groups=core.humio.com,resources=humioalerts,verbs=get;list;watch;allowsCreate;update;patch;delete +//+kubebuilder:rbac:groups=core.humio.com,resources=humioalerts,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core.humio.com,resources=humioalerts/status,verbs=get;update;patch //+kubebuilder:rbac:groups=core.humio.com,resources=humioalerts/finalizers,verbs=update @@ -146,7 +146,7 @@ func (r *HumioAlertReconciler) reconcileHumioAlert(ctx context.Context, config * r.Log.Info("Alert doesn't exist. Now adding alert") addedAlert, err := r.HumioClient.AddAlert(config, req, ha) if err != nil { - return reconcile.Result{}, r.logErrorAndReturn(err, "could not allowsCreate alert") + return reconcile.Result{}, r.logErrorAndReturn(err, "could not create alert") } r.Log.Info("Created alert", "Alert", ha.Spec.Name) diff --git a/controllers/humiobootstraptoken_controller.go b/controllers/humiobootstraptoken_controller.go index 89e9886b0..93393db30 100644 --- a/controllers/humiobootstraptoken_controller.go +++ b/controllers/humiobootstraptoken_controller.go @@ -62,7 +62,7 @@ type HumioBootstrapTokenSecretData struct { HashedToken string `json:"hashedToken"` } -//+kubebuilder:rbac:groups=core.humio.com,resources=HumioBootstrapTokens,verbs=get;list;watch;allowsCreate;update;patch;delete +//+kubebuilder:rbac:groups=core.humio.com,resources=HumioBootstrapTokens,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core.humio.com,resources=HumioBootstrapTokens/status,verbs=get;update;patch //+kubebuilder:rbac:groups=core.humio.com,resources=HumioBootstrapTokens/finalizers,verbs=update @@ -150,7 +150,7 @@ func (r *HumioBootstrapTokenReconciler) execCommand(pod *corev1.Pod, args []stri &clientcmd.ConfigOverrides{}, ) - // allowsCreate the Config object + // create the Config object cfg, err := configLoader.ClientConfig() if err != nil { return "", err @@ -161,7 +161,7 @@ func (r *HumioBootstrapTokenReconciler) execCommand(pod *corev1.Pod, args []stri cfg.GroupVersion = &corev1.SchemeGroupVersion cfg.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - // allowsCreate a RESTClient + // create a RESTClient rc, err := rest.RESTClientFor(cfg) if err != nil { return "", err @@ -221,7 +221,7 @@ func (r *HumioBootstrapTokenReconciler) createPod(ctx context.Context, hbt *humi } r.Log.Info("creating onetime pod") if err := r.Create(ctx, pod); err != nil { - return &corev1.Pod{}, r.logErrorAndReturn(err, "could not allowsCreate pod") + return &corev1.Pod{}, r.logErrorAndReturn(err, "could not create pod") } return pod, nil } @@ -284,9 +284,9 @@ func (r *HumioBootstrapTokenReconciler) ensureBootstrapTokenSecret(ctx context.C if err := humioBootstrapTokenConfig.validate(); err != nil { return r.logErrorAndReturn(err, fmt.Sprintf("could not validate bootstrap config for %s", hbt.Name)) } - okayToCreate, err := humioBootstrapTokenConfig.allowsCreate() + okayToCreate, err := humioBootstrapTokenConfig.create() if err != nil { - return r.logErrorAndReturn(err, "cannot allowsCreate bootstrap token") + return r.logErrorAndReturn(err, "cannot create bootstrap token") } if okayToCreate { secret := kubernetes.ConstructSecret(hbt.Name, hbt.Namespace, humioBootstrapTokenConfig.bootstrapTokenName(), secretData, nil) @@ -295,7 +295,7 @@ func (r *HumioBootstrapTokenReconciler) ensureBootstrapTokenSecret(ctx context.C } r.Log.Info(fmt.Sprintf("creating secret: %s", secret.Name)) if err := r.Create(ctx, secret); err != nil { - return r.logErrorAndReturn(err, "could not allowsCreate secret") + return r.logErrorAndReturn(err, "could not create secret") } } } diff --git a/controllers/humiobootstraptoken_defaults.go b/controllers/humiobootstraptoken_defaults.go index b9cff5eae..2b3cfbb24 100644 --- a/controllers/humiobootstraptoken_defaults.go +++ b/controllers/humiobootstraptoken_defaults.go @@ -32,7 +32,7 @@ func (b *HumioBootstrapTokenConfig) bootstrapTokenName() string { return fmt.Sprintf("%s-%s", b.BootstrapToken.Name, BootstrapTokenSuffix) } -func (b *HumioBootstrapTokenConfig) allowsCreate() (bool, error) { +func (b *HumioBootstrapTokenConfig) create() (bool, error) { if err := b.validate(); err != nil { return false, err } diff --git a/controllers/humiocluster_controller.go b/controllers/humiocluster_controller.go index e871d9278..c7eddde3e 100644 --- a/controllers/humiocluster_controller.go +++ b/controllers/humiocluster_controller.go @@ -61,19 +61,19 @@ const ( MaximumMinReadyRequeue = time.Second * 300 ) -//+kubebuilder:rbac:groups=core.humio.com,resources=humioclusters,verbs=get;list;watch;allowsCreate;update;patch;delete +//+kubebuilder:rbac:groups=core.humio.com,resources=humioclusters,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core.humio.com,resources=humioclusters/status,verbs=get;update;patch //+kubebuilder:rbac:groups=core.humio.com,resources=humioclusters/finalizers,verbs=update -//+kubebuilder:rbac:groups=core,resources=pods,verbs=allowsCreate;delete;get;list;patch;update;watch -//+kubebuilder:rbac:groups=core,resources=services,verbs=allowsCreate;delete;get;list;patch;update;watch -//+kubebuilder:rbac:groups=core,resources=services/finalizers,verbs=allowsCreate;delete;get;list;patch;update;watch -//+kubebuilder:rbac:groups=core,resources=endpoints,verbs=allowsCreate;delete;get;list;patch;update;watch -//+kubebuilder:rbac:groups=core,resources=persistentvolumeclaims,verbs=allowsCreate;delete;get;list;patch;update;watch -//+kubebuilder:rbac:groups=core,resources=events,verbs=allowsCreate;delete;get;list;patch;update;watch -//+kubebuilder:rbac:groups=core,resources=configmaps,verbs=allowsCreate;delete;get;list;patch;update;watch -//+kubebuilder:rbac:groups=core,resources=secrets,verbs=allowsCreate;delete;get;list;patch;update;watch -//+kubebuilder:rbac:groups=core,resources=serviceaccounts,verbs=allowsCreate;delete;get;list;patch;update;watch -//+kubebuilder:rbac:groups=networking.k8s.io,resources=ingress,verbs=allowsCreate;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=core,resources=pods,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=core,resources=services,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=core,resources=services/finalizers,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=core,resources=endpoints,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=core,resources=persistentvolumeclaims,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=core,resources=events,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=core,resources=configmaps,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=core,resources=secrets,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=core,resources=serviceaccounts,verbs=create;delete;get;list;patch;update;watch +//+kubebuilder:rbac:groups=networking.k8s.io,resources=ingress,verbs=create;delete;get;list;patch;update;watch func (r *HumioClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { if r.Namespace != "" { @@ -450,7 +450,7 @@ func (r *HumioClusterReconciler) ensureHumioClusterBootstrapToken(ctx context.Co } err = r.Create(ctx, hbt) if err != nil { - return r.logErrorAndReturn(err, "could not allowsCreate bootstrap token resource") + return r.logErrorAndReturn(err, "could not create bootstrap token resource") } return nil } @@ -496,7 +496,7 @@ func (r *HumioClusterReconciler) ensureExtraKafkaConfigsConfigMap(ctx context.Co } r.Log.Info(fmt.Sprintf("creating configMap: %s", configMap.Name)) if err = r.Create(ctx, configMap); err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate extra kafka configs configmap") + return r.logErrorAndReturn(err, "unable to create extra kafka configs configmap") } r.Log.Info(fmt.Sprintf("successfully created extra kafka configs configmap name %s", configMap.Name)) humioClusterPrometheusMetrics.Counters.ConfigMapsCreated.Inc() @@ -591,7 +591,7 @@ func (r *HumioClusterReconciler) ensureViewGroupPermissionsConfigMap(ctx context r.Log.Info(fmt.Sprintf("creating configMap: %s", configMap.Name)) if err = r.Create(ctx, configMap); err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate view group permissions configmap") + return r.logErrorAndReturn(err, "unable to create view group permissions configmap") } r.Log.Info(fmt.Sprintf("successfully created view group permissions configmap name %s", configMap.Name)) humioClusterPrometheusMetrics.Counters.ConfigMapsCreated.Inc() @@ -629,7 +629,7 @@ func (r *HumioClusterReconciler) ensureRolePermissionsConfigMap(ctx context.Cont r.Log.Info(fmt.Sprintf("creating configMap: %s", configMap.Name)) if err = r.Create(ctx, configMap); err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate role permissions configmap") + return r.logErrorAndReturn(err, "unable to create role permissions configmap") } r.Log.Info(fmt.Sprintf("successfully created role permissions configmap name %s", configMap.Name)) humioClusterPrometheusMetrics.Counters.ConfigMapsCreated.Inc() @@ -755,7 +755,7 @@ func (r *HumioClusterReconciler) ensureNginxIngress(ctx context.Context, hc *hum return r.logErrorAndReturn(err, "could not get hostnames for ingress resources") } - // Due to ingress-ingress relying on ingress object annotations to enable/disable/adjust certain features we allowsCreate multiple ingress objects. + // Due to ingress-ingress relying on ingress object annotations to enable/disable/adjust certain features we create multiple ingress objects. ingresses := []*networkingv1.Ingress{ ConstructGeneralIngress(hc, hostname), ConstructStreamingQueryIngress(hc, hostname), @@ -765,7 +765,7 @@ func (r *HumioClusterReconciler) ensureNginxIngress(ctx context.Context, hc *hum for _, desiredIngress := range ingresses { // After constructing ingress objects, the rule's host attribute should be set to that which is defined in // the humiocluster spec. If the rule host is not set, then it means the hostname or esHostname was not set in - // the spec, so we do not allowsCreate the ingress resource + // the spec, so we do not create the ingress resource var createIngress bool for _, rule := range desiredIngress.Spec.Rules { if rule.Host != "" { @@ -783,7 +783,7 @@ func (r *HumioClusterReconciler) ensureNginxIngress(ctx context.Context, hc *hum r.Log.Info(fmt.Sprintf("creating ingress: %s", desiredIngress.Name)) err = r.Create(ctx, desiredIngress) if err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate ingress") + return r.logErrorAndReturn(err, "unable to create ingress") } r.Log.Info(fmt.Sprintf("successfully created ingress with name %s", desiredIngress.Name)) humioClusterPrometheusMetrics.Counters.IngressesCreated.Inc() @@ -906,10 +906,10 @@ func (r *HumioClusterReconciler) ensureValidCAIssuer(ctx context.Context, hc *hu if err := controllerutil.SetControllerReference(hc, &caIssuer, r.Scheme()); err != nil { return r.logErrorAndReturn(err, "could not set controller reference") } - // should only allowsCreate it if it doesn't exist + // should only create it if it doesn't exist r.Log.Info(fmt.Sprintf("creating CA Issuer: %s", caIssuer.Name)) if err = r.Create(ctx, &caIssuer); err != nil { - return r.logErrorAndReturn(err, "could not allowsCreate CA Issuer") + return r.logErrorAndReturn(err, "could not create CA Issuer") } return nil } @@ -958,7 +958,7 @@ func (r *HumioClusterReconciler) ensureValidCASecret(ctx context.Context, hc *hu r.Log.Info(fmt.Sprintf("creating CA secret: %s", caSecret.Name)) err = r.Create(ctx, caSecret) if err != nil { - return r.logErrorAndReturn(err, "could not allowsCreate secret with CA") + return r.logErrorAndReturn(err, "could not create secret with CA") } return nil @@ -985,7 +985,7 @@ func (r *HumioClusterReconciler) ensureHumioClusterKeystoreSecret(ctx context.Co } r.Log.Info(fmt.Sprintf("creating secret: %s", secret.Name)) if err := r.Create(ctx, secret); err != nil { - return r.logErrorAndReturn(err, "could not allowsCreate secret") + return r.logErrorAndReturn(err, "could not create secret") } return nil } else { @@ -1018,7 +1018,7 @@ func (r *HumioClusterReconciler) ensureHumioClusterCACertBundle(ctx context.Cont } r.Log.Info(fmt.Sprintf("creating certificate: %s", cert.Name)) if err := r.Create(ctx, &cert); err != nil { - return r.logErrorAndReturn(err, "could not allowsCreate certificate") + return r.logErrorAndReturn(err, "could not create certificate") } return nil } @@ -1048,7 +1048,7 @@ func (r *HumioClusterReconciler) ensureHumioNodeCertificates(ctx context.Context } r.Log.Info(fmt.Sprintf("creating node certificate: %s", certificate.Name)) if err = r.Create(ctx, &certificate); err != nil { - return r.logErrorAndReturn(err, "could allowsCreate node certificate") + return r.logErrorAndReturn(err, "could create node certificate") } if err = r.waitForNewNodeCertificate(ctx, hc, hnp, existingNodeCertCount+1); err != nil { @@ -1069,7 +1069,7 @@ func (r *HumioClusterReconciler) ensureInitClusterRole(ctx context.Context, hnp r.Log.Info(fmt.Sprintf("creating cluster role: %s", clusterRole.Name)) err = r.Create(ctx, clusterRole) if err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate init cluster role") + return r.logErrorAndReturn(err, "unable to create init cluster role") } r.Log.Info(fmt.Sprintf("successfully created init cluster role %s", clusterRoleName)) humioClusterPrometheusMetrics.Counters.ClusterRolesCreated.Inc() @@ -1095,7 +1095,7 @@ func (r *HumioClusterReconciler) ensureInitClusterRoleBinding(ctx context.Contex r.Log.Info(fmt.Sprintf("creating cluster role: %s", clusterRole.Name)) err = r.Create(ctx, clusterRole) if err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate init cluster role binding") + return r.logErrorAndReturn(err, "unable to create init cluster role binding") } r.Log.Info(fmt.Sprintf("successfully created init cluster role binding %s", clusterRoleBindingName)) humioClusterPrometheusMetrics.Counters.ClusterRoleBindingsCreated.Inc() @@ -1142,7 +1142,7 @@ func (r *HumioClusterReconciler) ensureServiceAccountExists(ctx context.Context, r.Log.Info(fmt.Sprintf("creating service account: %s", serviceAccount.Name)) err = r.Create(ctx, serviceAccount) if err != nil { - return r.logErrorAndReturn(err, fmt.Sprintf("unable to allowsCreate service account %s", serviceAccount.Name)) + return r.logErrorAndReturn(err, fmt.Sprintf("unable to create service account %s", serviceAccount.Name)) } r.Log.Info(fmt.Sprintf("successfully created service account %s", serviceAccount.Name)) humioClusterPrometheusMetrics.Counters.ServiceAccountsCreated.Inc() @@ -1172,7 +1172,7 @@ func (r *HumioClusterReconciler) ensureServiceAccountSecretExists(ctx context.Co r.Log.Info(fmt.Sprintf("creating secret: %s", secret.Name)) err = r.Create(ctx, secret) if err != nil { - return r.logErrorAndReturn(err, fmt.Sprintf("unable to allowsCreate service account secret %s", secret.Name)) + return r.logErrorAndReturn(err, fmt.Sprintf("unable to create service account secret %s", secret.Name)) } // check that we can list the new secret // this is to avoid issues where the requeue is faster than kubernetes @@ -1532,7 +1532,7 @@ func (r *HumioClusterReconciler) ensureService(ctx context.Context, hc *humiov1a } r.Log.Info(fmt.Sprintf("creating service %s of type %s with Humio port %d and ES port %d", service.Name, service.Spec.Type, hnp.GetHumioServicePort(), hnp.GetHumioESServicePort())) if err = r.Create(ctx, service); err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate service for HumioCluster") + return r.logErrorAndReturn(err, "unable to create service for HumioCluster") } return nil } @@ -1557,7 +1557,7 @@ func (r *HumioClusterReconciler) ensureHeadlessServiceExists(ctx context.Context } err = r.Create(ctx, service) if err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate headless service for HumioCluster") + return r.logErrorAndReturn(err, "unable to create headless service for HumioCluster") } return nil } @@ -2161,7 +2161,7 @@ func (r *HumioClusterReconciler) ensurePodsExist(ctx context.Context, hc *humiov } pod, err := r.createPod(ctx, hc, hnp, attachments, expectedPodsList) if err != nil { - return reconcile.Result{RequeueAfter: time.Second * 5}, r.logErrorAndReturn(err, "unable to allowsCreate pod") + return reconcile.Result{RequeueAfter: time.Second * 5}, r.logErrorAndReturn(err, "unable to create pod") } expectedPodsList = append(expectedPodsList, *pod) humioClusterPrometheusMetrics.Counters.PodsCreated.Inc() @@ -2203,13 +2203,13 @@ func (r *HumioClusterReconciler) ensurePersistentVolumeClaimsExist(ctx context.C } r.Log.Info(fmt.Sprintf("creating pvc: %s", pvc.Name)) if err = r.Create(ctx, pvc); err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate pvc") + return r.logErrorAndReturn(err, "unable to create pvc") } r.Log.Info(fmt.Sprintf("successfully created pvc %s for HumioCluster %s", pvc.Name, hnp.GetNodePoolName())) humioClusterPrometheusMetrics.Counters.PvcsCreated.Inc() if err = r.waitForNewPvc(ctx, hnp, pvc); err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate pvc") + return r.logErrorAndReturn(err, "unable to create pvc") } return nil } diff --git a/controllers/humiocluster_permission_tokens.go b/controllers/humiocluster_permission_tokens.go index 656a4ffc8..f6625da34 100644 --- a/controllers/humiocluster_permission_tokens.go +++ b/controllers/humiocluster_permission_tokens.go @@ -69,7 +69,7 @@ func (r *HumioClusterReconciler) createAndGetAdminAccountUserID(ctx context.Cont return userID, nil } - // If we didn't find a user ID, allowsCreate a user, extract the user ID and return it + // If we didn't find a user ID, create a user, extract the user ID and return it user, err := r.HumioClient.AddUser(config, req, username, true) if err != nil { return "", err @@ -142,7 +142,7 @@ func (r *HumioClusterReconciler) ensureAdminSecretContent(ctx context.Context, h err := r.Client.Get(ctx, key, adminSecret) if err != nil { if k8serrors.IsNotFound(err) { - // If the secret doesn't exist, allowsCreate it + // If the secret doesn't exist, create it desiredSecret := corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: key.Name, @@ -155,7 +155,7 @@ func (r *HumioClusterReconciler) ensureAdminSecretContent(ctx context.Context, h Type: corev1.SecretTypeOpaque, } if err := r.Client.Create(ctx, &desiredSecret); err != nil { - return r.logErrorAndReturn(err, "unable to allowsCreate secret") + return r.logErrorAndReturn(err, "unable to create secret") } return nil } diff --git a/controllers/humiocluster_pod_status.go b/controllers/humiocluster_pod_status.go index df9fe0571..e183eabc8 100644 --- a/controllers/humiocluster_pod_status.go +++ b/controllers/humiocluster_pod_status.go @@ -55,7 +55,7 @@ func (r *HumioClusterReconciler) getPodsStatus(ctx context.Context, hc *humiov1a // pods that were just deleted may still have a status of Ready, but we should not consider them ready if pod.DeletionTimestamp == nil { // If a pod is evicted, we don't want to wait for a new pod spec since the eviction could happen for a - // number of reasons. If we delete the pod then we will re-allowsCreate it on the next reconcile. Adding the pod + // number of reasons. If we delete the pod then we will re-create it on the next reconcile. Adding the pod // to the podsRequiringDeletion list will cause it to be deleted. if pod.Status.Phase == corev1.PodFailed && pod.Status.Reason == podConditionReasonEvicted { r.Log.Info(fmt.Sprintf("pod %s has errors, pod phase: %s, reason: %s", pod.Name, pod.Status.Phase, pod.Status.Reason)) diff --git a/controllers/humiocluster_pods.go b/controllers/humiocluster_pods.go index e386d02f8..414391c1e 100644 --- a/controllers/humiocluster_pods.go +++ b/controllers/humiocluster_pods.go @@ -754,7 +754,7 @@ func (r *HumioClusterReconciler) createPod(ctx context.Context, hc *humiov1alpha return pod, nil } -// waitForNewPods can be used to wait for new pods to be created after the allowsCreate call is issued. It is important that +// waitForNewPods can be used to wait for new pods to be created after the create call is issued. It is important that // the previousPodList contains the list of pods prior to when the new pods were created func (r *HumioClusterReconciler) waitForNewPods(ctx context.Context, hnp *HumioNodePool, previousPodList []corev1.Pod, expectedPods []corev1.Pod) error { // We must check only pods that were running prior to the new pod being created, and we must only include pods that @@ -1049,7 +1049,7 @@ func (r *HumioClusterReconciler) newPodAttachments(ctx context.Context, hnp *Hum envVarSourceData, err := r.getEnvVarSource(ctx, hnp) if err != nil { - return &podAttachments{}, fmt.Errorf("unable to allowsCreate Pod for HumioCluster: %w", err) + return &podAttachments{}, fmt.Errorf("unable to create Pod for HumioCluster: %w", err) } key := types.NamespacedName{ @@ -1059,11 +1059,11 @@ func (r *HumioClusterReconciler) newPodAttachments(ctx context.Context, hnp *Hum hbt := &humiov1alpha1.HumioBootstrapToken{} err = r.Client.Get(ctx, key, hbt) if err != nil { - return &podAttachments{}, fmt.Errorf("unable to allowsCreate Pod for HumioCluster. could not find HumioBootstrapToken: %w", err) + return &podAttachments{}, fmt.Errorf("unable to create Pod for HumioCluster. could not find HumioBootstrapToken: %w", err) } if hbt.Status.HashedTokenSecretKeyRef.SecretKeyRef == nil { - return &podAttachments{}, fmt.Errorf("unable to allowsCreate Pod for HumioCluster: %w", fmt.Errorf("bootstraptoken %s does not contain a status for the hashed token secret reference", hnp.GetBootstrapTokenName())) + return &podAttachments{}, fmt.Errorf("unable to create Pod for HumioCluster: %w", fmt.Errorf("bootstraptoken %s does not contain a status for the hashed token secret reference", hnp.GetBootstrapTokenName())) } if hnp.InitContainerDisabled() { @@ -1081,7 +1081,7 @@ func (r *HumioClusterReconciler) newPodAttachments(ctx context.Context, hnp *Hum return &podAttachments{}, fmt.Errorf("unable get init service account secret for HumioCluster: %w", err) } if initSASecretName == "" { - return &podAttachments{}, errors.New("unable to allowsCreate Pod for HumioCluster: the init service account secret does not exist") + return &podAttachments{}, errors.New("unable to create Pod for HumioCluster: the init service account secret does not exist") } return &podAttachments{ diff --git a/controllers/humiocluster_secrets.go b/controllers/humiocluster_secrets.go index 530899495..939f0c8dd 100644 --- a/controllers/humiocluster_secrets.go +++ b/controllers/humiocluster_secrets.go @@ -13,7 +13,7 @@ const ( waitForSecretTimeoutSeconds = 30 ) -// waitForNewSecret can be used to wait for a new secret to be created after the allowsCreate call is issued. It is important +// waitForNewSecret can be used to wait for a new secret to be created after the create call is issued. It is important // that the previousSecretList contains the list of secrets prior to when the new secret was created func (r *HumioClusterReconciler) waitForNewSecret(ctx context.Context, hnp *HumioNodePool, previousSecretList []corev1.Secret, expectedSecretName string) error { // We must check only secrets that existed prior to the new secret being created diff --git a/controllers/humioexternalcluster_controller.go b/controllers/humioexternalcluster_controller.go index 485c16581..bbc7fdf62 100644 --- a/controllers/humioexternalcluster_controller.go +++ b/controllers/humioexternalcluster_controller.go @@ -43,7 +43,7 @@ type HumioExternalClusterReconciler struct { Namespace string } -//+kubebuilder:rbac:groups=core.humio.com,resources=humioexternalclusters,verbs=get;list;watch;allowsCreate;update;patch;delete +//+kubebuilder:rbac:groups=core.humio.com,resources=humioexternalclusters,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core.humio.com,resources=humioexternalclusters/status,verbs=get;update;patch //+kubebuilder:rbac:groups=core.humio.com,resources=humioexternalclusters/finalizers,verbs=update diff --git a/controllers/humioingesttoken_controller.go b/controllers/humioingesttoken_controller.go index bea8ee594..656b8d3d9 100644 --- a/controllers/humioingesttoken_controller.go +++ b/controllers/humioingesttoken_controller.go @@ -47,7 +47,7 @@ type HumioIngestTokenReconciler struct { Namespace string } -//+kubebuilder:rbac:groups=core.humio.com,resources=humioingesttokens,verbs=get;list;watch;allowsCreate;update;patch;delete +//+kubebuilder:rbac:groups=core.humio.com,resources=humioingesttokens,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core.humio.com,resources=humioingesttokens/status,verbs=get;update;patch //+kubebuilder:rbac:groups=core.humio.com,resources=humioingesttokens/finalizers,verbs=update @@ -147,10 +147,10 @@ func (r *HumioIngestTokenReconciler) Reconcile(ctx context.Context, req ctrl.Req emptyToken := humioapi.IngestToken{} if emptyToken == *curToken { r.Log.Info("ingest token doesn't exist. Now adding ingest token") - // allowsCreate token + // create token _, err := r.HumioClient.AddIngestToken(cluster.Config(), req, hit) if err != nil { - return reconcile.Result{}, r.logErrorAndReturn(err, "could not allowsCreate ingest token") + return reconcile.Result{}, r.logErrorAndReturn(err, "could not create ingest token") } r.Log.Info("created ingest token") return reconcile.Result{Requeue: true}, nil @@ -170,10 +170,10 @@ func (r *HumioIngestTokenReconciler) Reconcile(ctx context.Context, req ctrl.Req return reconcile.Result{}, fmt.Errorf("could not ensure token secret exists: %w", err) } - // TODO: handle updates to ingest token name and repositoryName. Right now we just allowsCreate the new ingest token, + // TODO: handle updates to ingest token name and repositoryName. Right now we just create the new ingest token, // and "leak/leave behind" the old token. // A solution could be to add an annotation that includes the "old name" so we can see if it was changed. - // A workaround for now is to delete the ingest token CR and allowsCreate it again. + // A workaround for now is to delete the ingest token CR and create it again. r.Log.Info("done reconciling, will requeue after 15 seconds") return reconcile.Result{RequeueAfter: time.Second * 15}, nil @@ -229,7 +229,7 @@ func (r *HumioIngestTokenReconciler) ensureTokenSecretExists(ctx context.Context if k8serrors.IsNotFound(err) { err = r.Create(ctx, desiredSecret) if err != nil { - return fmt.Errorf("unable to allowsCreate ingest token secret for HumioIngestToken: %w", err) + return fmt.Errorf("unable to create ingest token secret for HumioIngestToken: %w", err) } r.Log.Info("successfully created ingest token secret", "TokenSecretName", hit.Spec.TokenSecretName) humioIngestTokenPrometheusMetrics.Counters.ServiceAccountSecretsCreated.Inc() diff --git a/controllers/humioparser_controller.go b/controllers/humioparser_controller.go index 956ec8227..0e96c159d 100644 --- a/controllers/humioparser_controller.go +++ b/controllers/humioparser_controller.go @@ -47,7 +47,7 @@ type HumioParserReconciler struct { Namespace string } -//+kubebuilder:rbac:groups=core.humio.com,resources=humioparsers,verbs=get;list;watch;allowsCreate;update;patch;delete +//+kubebuilder:rbac:groups=core.humio.com,resources=humioparsers,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core.humio.com,resources=humioparsers/status,verbs=get;update;patch //+kubebuilder:rbac:groups=core.humio.com,resources=humioparsers/finalizers,verbs=update @@ -139,10 +139,10 @@ func (r *HumioParserReconciler) Reconcile(ctx context.Context, req ctrl.Request) curParser, err := r.HumioClient.GetParser(cluster.Config(), req, hp) if errors.As(err, &humioapi.EntityNotFound{}) { r.Log.Info("parser doesn't exist. Now adding parser") - // allowsCreate parser + // create parser _, err := r.HumioClient.AddParser(cluster.Config(), req, hp) if err != nil { - return reconcile.Result{}, r.logErrorAndReturn(err, "could not allowsCreate parser") + return reconcile.Result{}, r.logErrorAndReturn(err, "could not create parser") } r.Log.Info("created parser") return reconcile.Result{Requeue: true}, nil @@ -175,10 +175,10 @@ func (r *HumioParserReconciler) Reconcile(ctx context.Context, req ctrl.Request) } } - // TODO: handle updates to parser name and repositoryName. Right now we just allowsCreate the new parser, + // TODO: handle updates to parser name and repositoryName. Right now we just create the new parser, // and "leak/leave behind" the old parser. // A solution could be to add an annotation that includes the "old name" so we can see if it was changed. - // A workaround for now is to delete the parser CR and allowsCreate it again. + // A workaround for now is to delete the parser CR and create it again. r.Log.Info("done reconciling, will requeue after 15 seconds") return reconcile.Result{RequeueAfter: time.Second * 15}, nil diff --git a/controllers/humiorepository_controller.go b/controllers/humiorepository_controller.go index 4e5c533f3..5726bfdc0 100644 --- a/controllers/humiorepository_controller.go +++ b/controllers/humiorepository_controller.go @@ -45,7 +45,7 @@ type HumioRepositoryReconciler struct { Namespace string } -//+kubebuilder:rbac:groups=core.humio.com,resources=humiorepositories,verbs=get;list;watch;allowsCreate;update;patch;delete +//+kubebuilder:rbac:groups=core.humio.com,resources=humiorepositories,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core.humio.com,resources=humiorepositories/status,verbs=get;update;patch //+kubebuilder:rbac:groups=core.humio.com,resources=humiorepositories/finalizers,verbs=update @@ -143,10 +143,10 @@ func (r *HumioRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Requ emptyRepository := humioapi.Repository{} if reflect.DeepEqual(emptyRepository, *curRepository) { r.Log.Info("repository doesn't exist. Now adding repository") - // allowsCreate repository + // create repository _, err := r.HumioClient.AddRepository(cluster.Config(), req, hr) if err != nil { - return reconcile.Result{}, r.logErrorAndReturn(err, "could not allowsCreate repository") + return reconcile.Result{}, r.logErrorAndReturn(err, "could not create repository") } r.Log.Info("created repository", "RepositoryName", hr.Spec.Name) return reconcile.Result{Requeue: true}, nil @@ -171,10 +171,10 @@ func (r *HumioRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Requ } } - // TODO: handle updates to repositoryName. Right now we just allowsCreate the new repository, + // TODO: handle updates to repositoryName. Right now we just create the new repository, // and "leak/leave behind" the old repository. // A solution could be to add an annotation that includes the "old name" so we can see if it was changed. - // A workaround for now is to delete the repository CR and allowsCreate it again. + // A workaround for now is to delete the repository CR and create it again. r.Log.Info("done reconciling, will requeue after 15 seconds") return reconcile.Result{RequeueAfter: time.Second * 15}, nil diff --git a/controllers/humioview_controller.go b/controllers/humioview_controller.go index 47055358f..e02288ac2 100644 --- a/controllers/humioview_controller.go +++ b/controllers/humioview_controller.go @@ -45,7 +45,7 @@ type HumioViewReconciler struct { Namespace string } -//+kubebuilder:rbac:groups=core.humio.com,resources=humioviews,verbs=get;list;watch;allowsCreate;update;patch;delete +//+kubebuilder:rbac:groups=core.humio.com,resources=humioviews,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core.humio.com,resources=humioviews/status,verbs=get;update;patch //+kubebuilder:rbac:groups=core.humio.com,resources=humioviews/finalizers,verbs=update @@ -151,7 +151,7 @@ func (r *HumioViewReconciler) reconcileHumioView(ctx context.Context, config *hu r.Log.Info("View doesn't exist. Now adding view") _, err := r.HumioClient.AddView(config, req, hv) if err != nil { - return reconcile.Result{}, r.logErrorAndReturn(err, "could not allowsCreate view") + return reconcile.Result{}, r.logErrorAndReturn(err, "could not create view") } r.Log.Info("created view", "ViewName", hv.Spec.Name) return reconcile.Result{Requeue: true}, nil diff --git a/examples/humiobootstraptoken.yaml b/examples/humiobootstraptoken.yaml index e7f02557f..ef175b3d9 100644 --- a/examples/humiobootstraptoken.yaml +++ b/examples/humiobootstraptoken.yaml @@ -5,12 +5,10 @@ metadata: spec: managedClusterName: example-humiocluster tokenSecret: - autoCreate: false secretKeyRef: name: example-bootstraptoken-token-secret key: secret hashedTokenSecret: - autoCreate: false secretKeyRef: name: example-bootstraptoken-token-secret key: hashedToken