-
Notifications
You must be signed in to change notification settings - Fork 126
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
base: master
Are you sure you want to change the base?
Conversation
gianrubio
commented
May 14, 2018
- 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) |
There was a problem hiding this comment.
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{}) |
There was a problem hiding this comment.
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()
.
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 |
There was a problem hiding this comment.
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.