Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review snapshots and daemonsets #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gianrubio
Copy link
Contributor

  • Deploy es daemonset in the same namespace of the crd
  • Delete daemonset object before a crd deletiong
  • Set history size in snapshots cronjob

…e namespace of the crd, delete daemonset object before a crd deletiong
if err != nil {
return err
}

err = c.k8sclient.CreateNodeInitDaemonset("default")
return c.k8sclient.CreateNodeInitDaemonset(crd.ObjectMeta.Namespace)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting this error:

time="2018-05-24T00:39:25Z" level=info msg="Daemonset  not found, creating..."
time="2018-05-24T00:39:25Z" level=error msg="Error in init(): an empty namespace may not be set during creation"

CRD does not have a namespace as it is cluster-wide.

Would this work to just create it in the same namespace as the controller?

ns, _ := os.LookupEnv("NAMESPACE")
return c.k8sclient.CreateNodeInitDaemonset(ns)

// DeleteNodeInitDaemonset delete the node init daemonset
func (k *K8sutil) DeleteNodeInitDaemonset(namespace string) error {

ds, err := k.Kclient.ExtensionsV1beta1().DaemonSets(namespace).Get(esOperatorSysctlName, metav1.GetOptions{})
Copy link
Contributor

@danisla danisla May 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the .Delete() function, not the.Get().

@stevesloka
Copy link
Member

Hey @gianrubio do you have time to look at the comments from @danisla?

@@ -221,7 +221,7 @@ func (k *K8sutil) CreateKubernetesCustomResourceDefinition() error {
logrus.Infof("SKIPPING: already exists %#v\n", crd.ObjectMeta.Name)
}

return nil
return crd, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be: return crd, nil otherwise on first install, if the CRD doesn't exist, it will return the value of err from the first test. This breaks the controller init() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants