apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: spinnakeraccounts.spinnaker.io
spec:
  group: spinnaker.io
  names:
    kind: SpinnakerAccount
    listKind: SpinnakerAccountList
    plural: spinnakeraccounts
    shortNames:
      - spinaccount
    singular: spinnakeraccount
  scope: Namespaced
  versions:
  - name: v1alpha2
    subresources:
      status: { }
    storage: true
    served: true
    additionalPrinterColumns:
      - jsonPath: .spec.type
        description: Type
        name: type
        type: string
      - jsonPath: .status.LastValidatedAt
        description: Last Validated
        name: lastValidated
        type: date
      - jsonPath: .status.InvalidReason
        description: Invalid Reason
        name: reason
        type: string
    schema:
      openAPIV3Schema:
        description: SpinnakerAccount is the Schema for the spinnakeraccounts API
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: SpinnakerAccountSpec defines the desired state of SpinnakerAccount
            properties:
              enabled:
                type: boolean
              kubernetes:
                properties:
                  kubeconfig:
                    description: Kubeconfig config referenced directly
                    properties:
                      apiVersion:
                        description: 'Legacy field from pkg/api/types.go TypeMeta. TODO(jlowdermilk):
                          remove this after eliminating downstream dependencies.'
                        type: string
                      clusters:
                        description: Clusters is a map of referencable names to cluster configs
                        items:
                          description: NamedCluster relates nicknames to cluster information
                          properties:
                            cluster:
                              description: Cluster holds the cluster information
                              properties:
                                certificate-authority:
                                  description: CertificateAuthority is the path to a
                                    cert file for the certificate authority.
                                  type: string
                                certificate-authority-data:
                                  description: CertificateAuthorityData contains PEM-encoded
                                    certificate authority certificates. Overrides CertificateAuthority
                                  format: byte
                                  type: string
                                extensions:
                                  description: Extensions holds additional information.
                                    This is useful for extenders so that reads and writes
                                    don't clobber unknown fields
                                  items:
                                    description: NamedExtension relates nicknames to
                                      extension information
                                    properties:
                                      extension:
                                        description: Extension holds the extension information
                                        type: object
                                      name:
                                        description: Name is the nickname for this Extension
                                        type: string
                                    required:
                                      - extension
                                      - name
                                    type: object
                                  type: array
                                insecure-skip-tls-verify:
                                  description: InsecureSkipTLSVerify skips the validity
                                    check for the server's certificate. This will make
                                    your HTTPS connections insecure.
                                  type: boolean
                                server:
                                  description: Server is the address of the kubernetes
                                    cluster (https://hostname:port).
                                  type: string
                              required:
                                - server
                              type: object
                            name:
                              description: Name is the nickname for this Cluster
                              type: string
                          required:
                            - cluster
                            - name
                          type: object
                        type: array
                      contexts:
                        description: Contexts is a map of referencable names to context
                          configs
                        items:
                          description: NamedContext relates nicknames to context information
                          properties:
                            context:
                              description: Context holds the context information
                              properties:
                                cluster:
                                  description: Cluster is the name of the cluster for
                                    this context
                                  type: string
                                extensions:
                                  description: Extensions holds additional information.
                                    This is useful for extenders so that reads and writes
                                    don't clobber unknown fields
                                  items:
                                    description: NamedExtension relates nicknames to
                                      extension information
                                    properties:
                                      extension:
                                        description: Extension holds the extension information
                                        type: object
                                      name:
                                        description: Name is the nickname for this Extension
                                        type: string
                                    required:
                                      - extension
                                      - name
                                    type: object
                                  type: array
                                namespace:
                                  description: Namespace is the default namespace to
                                    use on unspecified requests
                                  type: string
                                user:
                                  description: AuthInfo is the name of the authInfo
                                    for this context
                                  type: string
                              required:
                                - cluster
                                - user
                              type: object
                            name:
                              description: Name is the nickname for this Context
                              type: string
                          required:
                            - context
                            - name
                          type: object
                        type: array
                      current-context:
                        description: CurrentContext is the name of the context that
                          you would like to use by default
                        type: string
                      extensions:
                        description: Extensions holds additional information. This is
                          useful for extenders so that reads and writes don't clobber
                          unknown fields
                        items:
                          description: NamedExtension relates nicknames to extension
                            information
                          properties:
                            extension:
                              description: Extension holds the extension information
                              type: object
                            name:
                              description: Name is the nickname for this Extension
                              type: string
                          required:
                            - extension
                            - name
                          type: object
                        type: array
                      kind:
                        description: 'Legacy field from pkg/api/types.go TypeMeta. TODO(jlowdermilk):
                          remove this after eliminating downstream dependencies.'
                        type: string
                      preferences:
                        description: Preferences holds general information to be use
                          for cli interactions
                        properties:
                          colors:
                            type: boolean
                          extensions:
                            description: Extensions holds additional information. This
                              is useful for extenders so that reads and writes don't
                              clobber unknown fields
                            items:
                              description: NamedExtension relates nicknames to extension
                                information
                              properties:
                                extension:
                                  description: Extension holds the extension information
                                  type: object
                                name:
                                  description: Name is the nickname for this Extension
                                  type: string
                              required:
                                - extension
                                - name
                              type: object
                            type: array
                        type: object
                      users:
                        description: AuthInfos is a map of referencable names to user
                          configs
                        items:
                          description: NamedAuthInfo relates nicknames to auth information
                          properties:
                            name:
                              description: Name is the nickname for this AuthInfo
                              type: string
                            user:
                              description: AuthInfo holds the auth information
                              properties:
                                as:
                                  description: Impersonate is the username to imperonate.  The
                                    name matches the flag.
                                  type: string
                                as-groups:
                                  description: ImpersonateGroups is the groups to imperonate.
                                  items:
                                    type: string
                                  type: array
                                as-user-extra:
                                  additionalProperties:
                                    items:
                                      type: string
                                    type: array
                                  description: ImpersonateUserExtra contains additional
                                    information for impersonated user.
                                  type: object
                                auth-provider:
                                  description: AuthProvider specifies a custom authentication
                                    plugin for the kubernetes cluster.
                                  properties:
                                    config:
                                      additionalProperties:
                                        type: string
                                      type: object
                                    name:
                                      type: string
                                  required:
                                    - config
                                    - name
                                  type: object
                                client-certificate:
                                  description: ClientCertificate is the path to a client
                                    cert file for TLS.
                                  type: string
                                client-certificate-data:
                                  description: ClientCertificateData contains PEM-encoded
                                    data from a client cert file for TLS. Overrides
                                    ClientCertificate
                                  format: byte
                                  type: string
                                client-key:
                                  description: ClientKey is the path to a client key
                                    file for TLS.
                                  type: string
                                client-key-data:
                                  description: ClientKeyData contains PEM-encoded data
                                    from a client key file for TLS. Overrides ClientKey
                                  format: byte
                                  type: string
                                exec:
                                  description: Exec specifies a custom exec-based authentication
                                    plugin for the kubernetes cluster.
                                  properties:
                                    apiVersion:
                                      description: Preferred input version of the ExecInfo.
                                        The returned ExecCredentials MUST use the same
                                        encoding version as the input.
                                      type: string
                                    args:
                                      description: Arguments to pass to the command
                                        when executing it.
                                      items:
                                        type: string
                                      type: array
                                    command:
                                      description: Command to execute.
                                      type: string
                                    env:
                                      description: Env defines additional environment
                                        variables to expose to the process. These are
                                        unioned with the host's environment, as well
                                        as variables client-go uses to pass argument
                                        to the plugin.
                                      items:
                                        description: ExecEnvVar is used for setting
                                          environment variables when executing an exec-based
                                          credential plugin.
                                        properties:
                                          name:
                                            type: string
                                          value:
                                            type: string
                                        required:
                                          - name
                                          - value
                                        type: object
                                      type: array
                                  required:
                                    - command
                                  type: object
                                extensions:
                                  description: Extensions holds additional information.
                                    This is useful for extenders so that reads and writes
                                    don't clobber unknown fields
                                  items:
                                    description: NamedExtension relates nicknames to
                                      extension information
                                    properties:
                                      extension:
                                        description: Extension holds the extension information
                                        type: object
                                      name:
                                        description: Name is the nickname for this Extension
                                        type: string
                                    required:
                                      - extension
                                      - name
                                    type: object
                                  type: array
                                password:
                                  description: Password is the password for basic authentication
                                    to the kubernetes cluster.
                                  type: string
                                token:
                                  description: Token is the bearer token for authentication
                                    to the kubernetes cluster.
                                  type: string
                                tokenFile:
                                  description: TokenFile is a pointer to a file that
                                    contains a bearer token (as described above).  If
                                    both Token and TokenFile are present, Token takes
                                    precedence.
                                  type: string
                                username:
                                  description: Username is the username for basic authentication
                                    to the kubernetes cluster.
                                  type: string
                              type: object
                          required:
                            - name
                            - user
                          type: object
                        type: array
                    required:
                      - clusters
                      - contexts
                      - current-context
                      - preferences
                      - users
                    type: object
                  kubeconfigFile:
                    description: KubeconfigFile referenced as an encrypted secret
                    type: string
                  kubeconfigSecret:
                    description: Kubeconfig referenced as a Kubernetes secret
                    properties:
                      key:
                        type: string
                      name:
                        type: string
                    required:
                      - key
                      - name
                    type: object
                  useServiceAccount:
                    description: UseServiceAccount authenticate to the target cluster
                      using the service account mounted in Spinnaker's pods
                    type: boolean
                type: object
              permissions:
                additionalProperties:
                  items:
                    type: string
                  type: array
                type: object
              settings:
                type: string
              validation:
                properties:
                  enabled:
                    description: Enable or disable validation, defaults to false
                    type: boolean
                  failOnError:
                    description: Report errors but do not fail validation, defaults
                      to true
                    type: boolean
                  frequencySeconds:
                    x-kubernetes-int-or-string: true
                    description: Number of seconds between each validation
                required:
                  - enabled
                type: object
            required:
              - enabled
              - type
            type: object
          status:
            description: SpinnakerAccountStatus defines the observed state of SpinnakerAccount
            properties:
              invalidReason:
                type: string
              lastValidatedAt:
                description: Timestamp is a struct that is equivalent to Time, but intended
                  for protobuf marshalling/unmarshalling. It is generated into a serialization
                  that matches Time. Do not use in Go structs.
                properties:
                  nanos:
                    description: Non-negative fractions of a second at nanosecond resolution.
                      Negative second values with fractions must still have non-negative
                      nanos values that count forward in time. Must be from 0 to 999,999,999
                      inclusive. This field may be limited in precision depending on
                      context.
                    format: int32
                    type: integer
                  seconds:
                    description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.
                      Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.
                    format: int64
                    type: integer
                required:
                  - nanos
                  - seconds
                type: object
            required:
              - invalidReason
              - lastValidatedAt
            type: object
        type: object

