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

docs(FluentdConfig): instructions for installing without helm produce decoding error #362

Open
josephmcasey opened this issue Jan 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@josephmcasey
Copy link

Describe the bug

Currently it is impossible to follow the instructions for installing without Helm due to an extra tab on .spec in crd.yaml

Reproduction steps

Following the instructions linked above on any Kubernetes cluster should produce the following behavior when executing kubectl apply -f ./crd.yaml:

strict decoding error: unknown field "metadata.spec" for

{
  "apiVersion": "apiextensions.k8s.io/v1",
  "kind": "CustomResourceDefinition",
  "metadata": {
    "annotations": {
      "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apiextensions.k8s.io/v1\",\"kind\":\"CustomResourceDefinition\",\"metadata\":{\"annotations\":{},\"name\":\"fluentdconfigs.logs.vdp.vmware.com\",\"spec\":{\"conversion\":{\"strategy\":\"None\"},\"group\":\"logs.vdp.vmware.com\",\"names\":{\"kind\":\"FluentdConfig\",\"listKind\":\"FluentdConfigList\",\"plural\":\"fluentdconfigs\",\"singular\":\"fluentdconfig\"},\"scope\":\"Namespaced\",\"versions\":[{\"name\":\"v1beta1\",\"schema\":{\"openAPIV3Schema\":{\"properties\":{\"spec\":{\"properties\":{\"fluentconf\":{\"type\":\"string\"}},\"type\":\"object\"}},\"type\":\"object\"}},\"served\":true,\"storage\":true}]}}}\n"
    },
    "creationTimestamp": "2023-01-06T20:59:39Z",
    "generation": 1,
    "managedFields": [
      {
        "manager": "config-reloader",
        "operation": "Update",
        "apiVersion": "apiextensions.k8s.io/v1",
        "time": "2023-01-06T20:59:39Z",
        "fieldsType": "FieldsV1",
        "fieldsV1": {
          "f:spec": {
            "f:conversion": {
              ".": {},
              "f:strategy": {}
            },
            "f:group": {},
            "f:names": {
              "f:kind": {},
              "f:listKind": {},
              "f:plural": {},
              "f:singular": {}
            },
            "f:scope": {},
            "f:versions": {}
          }
        }
      },
      {
        "manager": "kube-apiserver",
        "operation": "Update",
        "apiVersion": "apiextensions.k8s.io/v1",
        "time": "2023-01-06T20:59:39Z",
        "fieldsType": "FieldsV1",
        "fieldsV1": {
          "f:status": {
            "f:acceptedNames": {
              "f:kind": {},
              "f:listKind": {},
              "f:plural": {},
              "f:singular": {}
            },
            "f:conditions": {
              "k:{\"type\":\"Established\"}": {
                ".": {},
                "f:lastTransitionTime": {},
                "f:message": {},
                "f:reason": {},
                "f:status": {},
                "f:type": {}
              },
              "k:{\"type\":\"NamesAccepted\"}": {
                ".": {},
                "f:lastTransitionTime": {},
                "f:message": {},
                "f:reason": {},
                "f:status": {},
                "f:type": {}
              }
            }
          }
        },
        "subresource": "status"
      },
      {
        "manager": "kubectl-client-side-apply",
        "operation": "Update",
        "apiVersion": "apiextensions.k8s.io/v1",
        "time": "2023-01-06T21:08:16Z",
        "fieldsType": "FieldsV1",
        "fieldsV1": {
          "f:metadata": {
            "f:annotations": {
              ".": {},
              "f:kubectl.kubernetes.io/last-applied-configuration": {}
            }
          }
        }
      }
    ],
    "name": "fluentdconfigs.logs.vdp.vmware.com",
    "resourceVersion": "65538",
    "spec": {
      "conversion": {
        "strategy": "None"
      },
      "group": "logs.vdp.vmware.com",
      "names": {
        "kind": "FluentdConfig",
        "listKind": "FluentdConfigList",
        "plural": "fluentdconfigs",
        "singular": "fluentdconfig"
      },
      "scope": "Namespaced",
      "versions": [
        {
          "name": "v1beta1",
          "schema": {
            "openAPIV3Schema": {
              "properties": {
                "spec": {
                  "properties": {
                    "fluentconf": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            }
          },
          "served": true,
          "storage": true
        }
      ]
    },
    "uid": "ba4a9367-f694-43ec-a512-0e37cf7ac96b"
  },
  "status": {
    "conditions": [
      {
        "type": "NamesAccepted",
        "status": "True",
        "lastTransitionTime": "2023-01-06T20:59:39Z",
        "reason": "NoConflicts",
        "message": "no conflicts found"
      },
      {
        "type": "Established",
        "status": "True",
        "lastTransitionTime": "2023-01-06T20:59:39Z",
        "reason": "InitialNamesAccepted",
        "message": "the initial names have been accepted"
      }
    ],
    "acceptedNames": {
      "plural": "fluentdconfigs",
      "singular": "fluentdconfig",
      "kind": "FluentdConfig",
      "listKind": "FluentdConfigList"
    },
    "storedVersions": [
      "v1beta1"
    ]
  }
}

Expected behavior

$ kubectl apply -f ./crd.yaml 

Warning: resource customresourcedefinitions/fluentdconfigs.logs.vdp.vmware.com is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.
customresourcedefinition.apiextensions.k8s.io/fluentdconfigs.logs.vdp.vmware.com configured

Additional context

Root Cause:

@josephmcasey josephmcasey added the bug Something isn't working label Jan 6, 2023
@josephmcasey
Copy link
Author

Related PR:
#188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant