Specifications

TITLE: Overeasy Operator Requirements
-
DESCRIPTION
- AS A: Developer
- I WANT: An Operator with a single busybox pod that logs a user specified message and shuts down after a user specified amount of time. If a duration or message are not specified, then both will be supplied by a REST API call.
- SO THAT: I can demonstrate the encapsulation of operational knowlege, leveraging the Operator Design Pattern.
-
SCENARIO 1: Shutdown the busybox pod after a user specified amount of time in seconds
- GIVEN: An Operator instance
- WHEN: the specification
timeoutis set to a numeric value in seconds - THEN: the busy box pod will remain available for the specified
timeoutduration in seconds,
-
SCENARIO 2: Log a user specified message before shutting down the busybox pod
- GIVEN: An Operator instance
- WHEN: the specification
messageis set to a string value - THEN: the busy box pod will log the message, from the
messagespecification after thetimeoutduration has expired.
-
SCENARIO 3: Retrieve the
timeoutandmessagefrom a given REST API if one and/or the other is not supplied.- GIVEN: An Operator instance
- WHEN: the specification
messageORtimeoutis NOT set - THEN: the busy box pod will supply these values from the following REST API:
GET http://my-json-server.typicode.com/keunlee/test-rest-repo/golang-lab00-response
-
SCENARIO 4: Update status
expiredandloggedwhen the busybox pod has expired- GIVEN: An Operator instance
- WHEN: the busy box pod’s duration has expired
- AND: the busy box pod has logged a message
- THEN: set the operators
expiredstatus totrue - AND: set the operators
loggedstatus totrue
- The CRD must have a
timeoutspecification attribute - The Operator instance must shut down after the duration of
timeoutin seconds, has been reached - The CRD must have a
messagespecification attribute - The Operator instance must log the message
messagebefore the container has stopped - The CRD must have a
expiredstatus attribute - The Operator must set the status of the busy box pod upon expiration,
expired - The CRD must have a
loggedstatus attribute - The Operator must set the status of the busy box pod when logging a message,
logged - The Operator instance must retrieve a
messageandtimeoutvalue from a REST API call (GET http://my-json-server.typicode.com/keunlee/test-rest-repo/golang-lab00-response), if both are not initially supplied on the Operator Instance.